Pointer Adress

Posts 1–3 of 3 · Page 1 of 1
Pointer Adress
Hey forum,

just a quick question.
I studied programming with java and now started changing from java to c++.
After i finished the basics i wanted to start messing around with the memory.
So i grabbed assault cube as i saw its a good game to start messing around with it. ( Started with minesweeper tho)

After finding out the pointer for example

Code:
-> 0x******A310 VALUE

offset 0x150

"ac_client.exe"+0011E20C
"ac_client.exe"+0010F4F4
"ac_client.exe"+00109B74
I now want to get the the adress so i can read from it via ReadProcessMemory.
And what do i need to cast PNTRADRESS to?

Code:
ReadProcessMemory(targethandle, PNTRADRESS , &targetvalue, sizeof(DWORD), 0);
How can i convert the module+pntradress to the right dword
Can anybody help ?
#
Thanks in Advance
Get the base address of your executable.

Create a snapshot of the modules inside of assault cube, and grab the base address of your executable. HINT: TlHelp32.h.

First grab the process (CreateToolhelp32Snapshot, TH32CS_SNAPPROCESS), get a handle to assault cube (OpenProcess), then grab the module (CreateToolhelp32Snapshot, TH32CS_SNAPMODULE) and get the base address of the module "ac_client.exe". Yes, it is counted as a module.

Once you got that, you can ReadProcessMemory:

Code:
ReadProcessMemory(MyHandle, (LPVOID)(BaseAddressOfModule + Offset), &MyBuffer, sizeof(MyBuffer), NULL);
If you need help, ask here.
To everyone else, please do not provide copy paste ready code as OP is trying to learn.


Code:
void readBaseAddr(PROCESSENTRY32* process) {

	DWORD  processID_ = process->th32ProcessID;
	DWORD  processBaseAddress_ = 0xFFFFFFFF;

	HANDLE moduleSnap_;
	MODULEENTRY32 moduleEntry_;

	moduleSnap_ = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, processID_);
	moduleEntry_.dwSize = sizeof(MODULEENTRY32);
	if (!Module32First(moduleSnap_, &moduleEntry_))
	{
		cout << "First module not found" << std::endl;
		CloseHandle(moduleSnap_);
	}
	processBaseAddress_ = (unsigned int)moduleEntry_.modBaseAddr;
	Values.processBaseAdress_ = processBaseAddress_;
}
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us