c++ builder undefined symbol Problem

0
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
const DWORD PlayerExperienceAddr = 0x94FGAC; // exp
int playerExp;
ReadProcessMemory(processHandle, (LPVOID)AlignAddress(PlayerExperienceAddr), &playerExp, 4, NULL);
}

wywala tutaj error przy ProcessHandle cos takiego :

undefined symbol 'processHandle'

może ktoś pomóc ?^^ będę wdzięczny

0

cały kod programu wygląda następująco :

#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#pragma package(smart_init)
#pragma link "SHDocVw_OCX"
#pragma resource "*.dfm"
#include <tlhelp32.h>
#include <String>


using namespace std;

DWORD GetModuleBase()
{
	MODULEENTRY32 moduleEntry = {0};
	HANDLE snapShot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
	DWORD base = 0;

	if(!snapShot)
		return 0;

	moduleEntry.dwSize = sizeof(moduleEntry);
	BOOL currentModule = Module32First(snapShot, &moduleEntry);

	if(currentModule)
	{
		static char hold[1000];
		memcpy(hold, moduleEntry.szModule, strlen(moduleEntry.szModule) + 1);

		if(std::string(hold).find("Game.exe") == std::string(hold).size() - 4)
			base = (DWORD)moduleEntry.modBaseAddr;
	}

	CloseHandle(snapShot);
	return base;
}

DWORD AlignAddress(DWORD address)
{
	static int base = (int)GetModuleBase();
	static int XPBase = 0x400000;
	address += (base - XPBase);
	return address;
}


TForm1 *Form1;

__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}



void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
const DWORD PlayerExperienceAddr = 0x94CEAC; // login
int playerExp;
ReadProcessMemory(processHandle, (LPVOID)AlignAddress(PlayerExperienceAddr), &playerExp, 4, NULL);
}

jest to kod w c++ builder i ta funkcja to czytanie aslr stąd : http://czepekpage.pl/index.php?page=threads&tid=21
z góry dzięki za pomoc.

0
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "SHDocVw_OCX"
#pragma resource "*.dfm"
#include <tlhelp32.h>
#include <String>


using namespace std;

DWORD GetModuleBase()
{
	MODULEENTRY32 moduleEntry = {0};
	HANDLE snapShot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
	DWORD base = 0;

	if(!snapShot)
		return 0;

	moduleEntry.dwSize = sizeof(moduleEntry);
	BOOL currentModule = Module32First(snapShot, &moduleEntry);

	if(currentModule)
	{
		static char hold[1000];
		memcpy(hold, moduleEntry.szModule, strlen(moduleEntry.szModule) + 1);

		if(std::string(hold).find("Game.exe") == std::string(hold).size() - 4)
			base = (DWORD)moduleEntry.modBaseAddr;
	}

	CloseHandle(snapShot);
	return base;
}

DWORD AlignAddress(DWORD address)
{
	static int base = (int)GetModuleBase();
	static int XPBase = 0x400000;
	address += (base - XPBase);
	return address;
}


TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------





void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
const DWORD PlayerExperienceAddr = 0x94CEAC; // login
int playerExp;
ReadProcessMemory(processHandle, (LPVOID)AlignAddress(PlayerExperienceAddr), &playerExp, 4, NULL);
}
//---------------------------------------------------------------------------

Wszystko co mam zapisane to tylko ten kod

0

Komunikaty typu undefined symbol pochodzą z linkera więc badanie include tutaj nic nie da.

Musisz dodać flagę do likera, aby biblioteka z której korzystasz została dołączona w etapie łączenia wszystkiego w całość.

1 użytkowników online, w tym zalogowanych: 0, gości: 1