[Help] Dealing with pointers from a dll
I'm currently learning how to find and use pointers in memory hacks.
I got adress + offset to a simple hack by using CE on the game, and according to some sources I found I could use this in my dll to retrieve the adress that the pointer directs to:
DWORD Addy = *((DWORD*)0x00053B78+0x44);
I'm not sure if it's correct because it seems like everyone are saying different things
. Anyway, this only gives me an error the second after I injected my dll to the game, "the instruction on xxxxxxxx refered to 0x00053B78 - error, could not read memory", something like that. So I tried using VirtualProtect on the pointer adress before retrieving the addy, which only results in the same error unfortunately.
This is a snippet from how my dll looks right now:
So, anyone could give me a helping hand? I'm sure it's a somewhat trivial error due to incorrect sources I looked at =)
I got adress + offset to a simple hack by using CE on the game, and according to some sources I found I could use this in my dll to retrieve the adress that the pointer directs to:
DWORD Addy = *((DWORD*)0x00053B78+0x44);
I'm not sure if it's correct because it seems like everyone are saying different things
. Anyway, this only gives me an error the second after I injected my dll to the game, "the instruction on xxxxxxxx refered to 0x00053B78 - error, could not read memory", something like that. So I tried using VirtualProtect on the pointer adress before retrieving the addy, which only results in the same error unfortunately.This is a snippet from how my dll looks right now:
Code:
DWORD Protection;
DWORD Addy = *((DWORD*)0x00053B78+0x44); //This gives error when injected
while(1==1){
//This part should work fine because I used it on a emulator with statical adresses and it writes the memory without error messages.
if(GetAsyncKeyState('Z') == -32767){
VirtualProtect((LPVOID)Addy, 4, PAGE_EXECUTE_READWRITE, &Protection);
*(DWORD*)Addy = 0x12;
