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.
You're either going to give up, or get very good with a disassembler.
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.
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.
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.
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.