srounet / Pymem

A python library for windows, providing the needed functions to start working on your own with memory editing.
MIT License
307 stars 44 forks source link

Getting the wrong value for a couple of addresses #3

Closed ghost closed 7 years ago

ghost commented 7 years ago

I've been using this great library extensively, however for some reason that I can't determine, i'm getting the wrong values.

It is a simply address + offset. Cheat engine shows a 0 1 or 2, pymem is giving me 1908365716 with no value change.

Any ideas?

ghost commented 7 years ago

I don't really understand why, but for this particular address I had to do this

cursorstatuspre = pm.read_int(0x06dd468)
cursorstatus = pm.read_int(cursorstatuspre + cursorstatusoffsets)
print(cursorstatus)

Instead of this

cursorstatus = pm.read_int(0x06dd468+ cursorstatusoffsets)
print(cursorstatus)

It doesn't happen for other memory addresses with offsets so I'm a little confused as to what is going on.

srounet commented 7 years ago

You are confused because the two examples are not doing the same thing.

think of it as brackets:

[ [ 0x06dd468 ] + cursorstatusoffsets ]

is not the same as

[ 0x06dd468 + cursorstatusoffsets ]

The value at 0x06dd468 may be a static pointer (pointing somewhere in memory) and you add cursorstatusoffsets to this pointer to get your cursor status (that's why uppon relaunch it's not changing).

The other memory addresses may be static addresses (never changes uppon reboot/relaunch) that's why it's working.

If it was a game, the pointer of your character will most likely change at each launch, that's why most of the time people try to find an address than never change and use this address as a start (and then add offsets to it).