Originally Posted by
Crtucker718
Alright, so I'll be the first to admit I'm not too experienced with C++... in-fact I started it yesterday, but I have already done quite a bit. I've created my own injector and understand how to write to the process memory, I took my old Unity3D Project that was a FPS and had some fun with it, I learned about NOP values and how to write in general using VirtualProtect.
The only thing I can not for the life of me find information on, anywhere is reading from memory. I have an basic application that I want to write the values of my players Health and mana into. I'm not trying to "hack" the game, or change any values, I'm just trying to grab information from it. I've done quite a bit of research and I've gone through the whole "Cheat-engine" process of getting the dynamic pointers -> offsets over and over again until I come to a static pointer that works after game and computer restart. (Thank god)
So, I'm going to use this as an example.. Lets say my pointer is 0x302DD0E8 and I have an offset of 0x84C how would I go about getting the value of this from the application. (Granted this is a 4-Byte integer value)
Ghetto Link to Cheat-Engine Address window: gyazo / 733d50c751119376d3195b6a5b703e9a
For what it's worth this is a DLL Injection project, so I am injecting this into the application, I don't know if this changes how things are read or not, like I said I can't really find ANY information on reading, but there's SOOOO MUCH on writing.
Cheat engine tells you exactly how to read multi level pointers:
Offsets in brackets are meant to be added to the pointer and then the value the pointer now points to (another pointer) is read. And offsets without brackets are just added to the pointer, wich now points to the value. Since you are doing a dll you can access the processes memory locally, so a few casts should do the trick. Here is how to read the above multi level pointer from a dll:
Code:
DWORD ptr1 = BaseAddress + 0x1F10AC;
DWORD ptr2 = *(DWORD*)(ptr1 + 0x220);
DWORD ptr3 = *(DWORD*)(ptr2 + 0x5B0);
DWORD ptrToValue = ptr3 + 0x20e;
BYTE value = *(BYTE*)ptrToValue;