Tutorial :Keeping address in C++ hacking game code? [closed]



Question:

I have this code that edits addresses in a game to get unlimited ammo and what not, and I found out that the addresses are different for every computer, sometimes every time you restart the game, so how would I manage making this work still even though they change.


Solution:1

If you get the address you're looking for, and then search for that address in memory to find the address of the pointer to that data, and then search for that address in memory so you can find the address of the pointer to it, and so on, you may eventually find an address that does not change. Then, at runtime, you can use that as a starting point and dereference it to find the location you're looking for. Of course, that all depends on how the data is laid out internally. It can get very complicated.


Solution:2

Signature matching for the record contents in the heap. Maybe using edit distance against specific known content.

No harm I'm answering, since you had to ask, you probably don't have the chops to pull it off.


Solution:3

The best way is to look for patterns in memory and work it out using offsets. It's not going to be simple simply because this is the sort of thing game developers want to stop.

So they're not going to have a nice text string saying "Ammo stored 27 bytes before the start of this string".

If they're doing tricky stuff like moving it around every time the game is run (and I would because I'm devious), you'll need to disassemble their code to find out how they locate the memory.

Then you do the same thing. I know, sounds easy and it is. But based on your past questions, I'm not sure 'H4cKL0rD' is a suitable moniker :-), at least in this case.

If you're uncomfortable with disassemblers, hex editors and such, there's almost certainly a program out there that will do it for you.


Solution:4

You're either going to give up, or get very good with a disassembler.


Solution:5

If you just want to get the job done and don't care about having coded it yourself, you could use a program which is designed specifically for this task, such as as T-Search.


Solution:6

I'd say, preload some custom memory allocator and try to find what malloc() size you're looking for.

Since the data you're trying to hack is very likely to be stored in a structure with other parameters, knowing the structure size will allow you to take special action when you see an allocation of this size pass.

typedef struct {     int ammo;     int damage;     int fire_distance;  } Sniper_AWP_T;    void *my_custom_malloc( int size ){     void *ret = malloc(size);     if( size == sizeof( Sniper_AWP_T ) ){         hack_address = ret;     }     return ret;  }    // later on     hack_address->ammo = 999;  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »