4 ms·
That's right. You can look for signs of what the piece of code does, or what the memory is used for. Functions will betray they purpose by doing calls to extern
by rhn_mk1 3y ago
That's right. You can look for signs of what the piece of code does, or what the memory is used for. Functions will betray they purpose by doing calls to external libraries. Those libraries have functions with certain names and their arguments have names too. Then you have counters which you can recognize by looping and incrementing by a certain amount.
Some variables are easily guessed because they refer to a string that's stored in plain text. "%d:%s" is likely to be a printf format string, so you can follow that lead and find out which arguments correspond to %d and %s. Sometimes you get lucky and the debug message tells you directly something like "Invalid value of the coin counter: %d". This is a dead giveaway for what the argument corresponding to %d is.
Other kinds of variables can be guessed by using a debugger and looking at their values, or patching code to modify them and watching what happens.