Getting value from an address.

03/13/2011 07:51 metodski#1
I have a question. How should i go about getting a value from an address ? In my case i have a health address and i want to get the value so i can use it for comparison with some other value. Is there any way to do that ?
03/13/2011 11:30 black0utCpp#2
Do you know CheatEngine excellent Software !
03/13/2011 11:51 5769854332#3
there are ways to do this, of course.
If you use C/C++ you could do inline asm (there may be mistakes, because im new to all this):


in intel syntax it would be something like this:

in AT&T:

or use pointers:


you can also use memcpy, of course.
03/14/2011 14:36 metodski#4
Thanks but all of those give me some access violation .

Unhandled exception at 0x5254cac4 (msvcr100d.dll) in Trainer.exe: 0xC0000005: Access violation reading location 0x03c870a0.
03/14/2011 19:56 5769854332#5
well, the above methods only work, if you read or write to memory of your own process (i should have mentioned that earlier, sry).

If you want to read or write memory of another process, then -in order to prevent access violations- you need ReadProcessMemory() and WriteProcessMemory(). Use Google, then you will find many example programs that use those functions.