Link to home
Start Free TrialLog in
Avatar of social_suicide
social_suicide

asked on

Memory Address cheating

Hi
I've been trying to create my own trainers for games but whenever I find the memory addresses where certain values are stored, when i restart the game the memory address changes. Is this suppost to happen?
Thanx
Avatar of Jase-Coder
Jase-Coder

Other things maybe using memory at the same time so it the space your game once occupied maybe taken up by another program.
In my opinion what you have to do is, your trainer should locate the game in memory and use relative addressing. As for an example; suppose that you money is kept in DS:ESI register pair which is for the first run of the game 0010:032F; the second run 002F:032F etc.. All you have to do is to find the Data Segment starting address if the values are kept in there...
well if you're trying it for win32 just remember that we have abstract address spaces here

and just one more tip.. if you try to hack some realy big apps you're may be out of luck , cos the memory fragmentation due to lack of garbage collector makes some non-one-time-alloced-globals to just "travel aroud" depending on the allocation history... in that case you must form an regular expresion to search for, or retrack manualy, by value chnges
I'm assuming an Intel processor.  

Given a variable that lives the whole lifetime of the program, there are 3 places where it can be stored: static data, stack, and heap.  If it's just some temporary variable, you don't stand much chance of pegging it.

The only way stack data will survive the whole program run is if it's allocated within maybe one or two calls deep from main, in which case it might as well be static because its offset in memory will only depend on load-time parameters.  Therefore, either the data is at a fixed offset from the start of the program's data, in which case you can predict its location per lexicon's strategy, or it's dynamically allocated, in which case you can't.

Garbage collection has nothing to do with this topic, only whether the variable is allocated on the heap.  Even a one-time allocation from the heap will tend to vary with each run of the program because this memory can be allocated from anywhere within system RAM by the operating system.  
ASKER CERTIFIED SOLUTION
Avatar of lexicon_dominus
lexicon_dominus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of social_suicide

ASKER

Thanx for all the comments. I think ill just give up trainer making and leave it 2 the experts. Thanx for the help.