views:

226

answers:

3

After asking this question (C++: Can I get out of the bounds of my app’s memory with a pointer?),
I decided to accept it isn't possible to modify other app's memory with pointers (with a modern OS).

But if this isn't possible, how do programs like ArtMoney and CheatEngine work?

Thanks

+5  A: 

Check these functions: ReadProcessmemory WriteProcessmemory

max
+1  A: 

It is possible to read process memory on Windows. There is a function, called ReadProcessMemory in kernel32.dll: http://msdn.microsoft.com/en-us/library/ms680553(v=VS.85).aspx

This is used by most applications that change memory of other applications. It can also be used to communicate between two processes (though mostly not recommended).

CheatEngine is a debugger with a non-traditional interface.

Pindatjuh
A: 

Just to give a plain simple explanation - dump / hot search the process memory for specified value and modify it. You can do it using some plain WinAPI functions or using some native API routines (I suppose so).

That's obviously the reason why they fail, for example, if game state is stored with some encryption. That's also the reason you would need to change your value several times and then make your search again (to avoid search collisions, because definitely different memory blocks could hold the same value).

Kotti
Obviously they also won't work for situations in which the displayed value isn't equal to the stored value in memory, i.e. `x + 1` is displayed where `x` is stored in memory. A search for `x + 1` will not yield the location of `x`. Other encryption methods are using custom data-types, like variable-length integers, different byte-ordering, XOR-inversed storage (XOR with `0xFFFF`), etc.
Pindatjuh