** Edit ** After some great help from @tylernygaard I have discovered that the same variable is being written to two difference places in the memory. They are both 'static' addresses. Problem solved. Original question below....
I posted a question earlier regarding "reading" a variable from an executable here (Please excuse my naivety in this area)
I simply wanted to "read" a Total variable from an executable whilst it was running.
I was recommended a program called Cheat Engine which I have downloaded, completed the tutorial and then used.
On one PC, Cheat Engine showed the variable at address "0096E0B4".
Out of curiosity I installed Cheat Engine on another PC and the variable was at address "0096E0A4"
These addresses are so close that I'm assuming this isn't just dynamically chosen at runtime (is it?). So I wondered if anyone knew why they would be different?
And whether it would still be possible to write some code to read the correct value?
Also, if the address is found using a base pointer with module + offset, that module could possibly vary ever so slightly from your PC to the other's? Different OS, executable version, etc.
– tylernygaard Jun 08 '17 at 07:02add [DOCU.thisForm+D8],eax
and on the other PC it isadd [DOCU.thisForm+E8],eax
. Also Cheat Engine on one reportsthe value of the pointer needed to find this address is probably 000000D8
and on the other one it's000000E8
. Does that help? (please excuse my ignorance) Is it just a difference in PC's and I'll have to change my 'reading' code to suit whatever PC the program runs on? Or is there a way of getting the 'reading' code to always find the correct address? Thanks :) – John T Jun 08 '17 at 07:21add [DOCU,thisForm+D8],eax
then the next lineadd [DOCU,thisForum+E8],eax
. I don't speak assembly but I'm guessing this is writing that value to two areas in memory that are D8 and E8 offsets fromeax
, is that correct? – John T Jun 08 '17 at 07:58