(I asked this question on Gaming, but was closed and ppl suggest I ask on Stackoverflow. If this doesn’t fit here, please suggest a better place before you close it. Thanks.)
One general way to cheat in game is to use a memory scan tool to track down the value you want to change. However another common way to cheat is to modify the binary file.
For example, in a game you get +5 exp when you kill an enemy, and by changing 5 to 50 stored in binary you can get +50 exp. As far as I know, many iPhone game cheats work that way, which requires you to patch a binary file or use HEX editor.
I’m interested in how those hackers locate the settings. What is the general method/tool to find out which binary file a specific value is in and the corresponding offset? If it’s a very unique number or a ascii string, like 3219 or google.com, you can just search the HEX value, but what if it’s a common value, like 1?
You could disassemble the game executable, that way you could in principle know what every memory location does. This is probably not practical for most games.
Two other approaches that more directly target specific values:
* You will probably be searching for a 32/64-bit integer not a single byte location.