 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Portujua How do I cheat?
Reputation: 0
Joined: 27 Feb 2012 Posts: 6
|
Posted: Sat Mar 30, 2013 5:17 am Post subject: Can anyone help me here? I'm confussed. |
|
|
Hi there, I recently started learning how to find addresses and edit them in C++.. I've been watching some tutorials and i'm a bit confussed about something..
The thing is, after i get baseAddress and offsets the tutorial guy made a function in C++ like this:
| Code: | DWORD FindDmaAddy(HANDLE hProc, DWORD baseAddress, DWORD offsets[], int pointerLevel)
{
DWORD pointer = baseAddress;
DWORD pTemp;
DWORD pointerAddress;
for (int i = 0; i < pointerLevel ; i++)
{
if (i == 0) // Initialize
ReadProcessMemory(hProc, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
pointerAddress = pTemp + offsets[i];
ReadProcessMemory(hProc, (LPCVOID)pointerAddress, &pTemp, sizeof(pTemp), NULL);
}
return pointerAddress;
} |
My guess is... We use cheat engine to get through the Lastest pointer to the base address, right? okay.. an offset plus base address equals one of those pointers, right?, then why does he wants to add those pointers to write in memory?, that function is for:
| Code: | addrToWrite = FindDmaAddy(hProc, AmmoBaseAddress, AmmoOffsets, 3);
WriteProcessMemory(hProc, (LPVOID)addrToWrite, &ammoValue, sizeof(ammoValue), NULL); |
Why would he want to go to the lastest pointer (i'm guessing thats what FindDmaAddy function does) to write in that memory? I mean, why not just write in base address the new value?
Someone help me here, i'm a bit confused
Please let me know if i explain myself well.. If not, i'll post a photo trying to explain myself better...
Thanks
|
|
| Back to top |
|
 |
TsTg Master Cheater
Reputation: 5
Joined: 12 Dec 2012 Posts: 340 Location: Somewhere....
|
Posted: Sat Mar 30, 2013 9:45 am Post subject: |
|
|
The base address of a pointer is the address that has the value of the that pointer, when for example, restart the game, load session,etc, the value changes but the base address won't, so you do not modify the value inside the base address.
And we reach to the top level of the pointer that conatins the value you are hacking (player health for example), here you can modify the value of the health.
This is an example:
[40BD80] is a base address and contains Addy_1
the first pointer level value is inside the address [Addy_1+SomeOffset], that contains Addy_2
then the second level is contained in [Addy_2+SomeOtherOffset] containing the health value.
So when you restart the game for example,Addy_1 and Addy_2 changes, but 40BD80,SomeOffset and SomeOtherOffsets won't.
This is where you use WriteProcessMemory call to actually Write the new health value to game memory.
|
|
| Back to top |
|
 |
Portujua How do I cheat?
Reputation: 0
Joined: 27 Feb 2012 Posts: 6
|
Posted: Sat Mar 30, 2013 2:44 pm Post subject: |
|
|
| Ohhh i see now... Thank you !
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|