by VHRanger · 3y ago · 0 comments
Do they guess it based on what they end up thinking the function/variable does in the code?
If you start at the entry point of the game and trace every memory access, and you run the game in a profiling and debugging emulator, you can figure out what every variable does. It’s a long and painstaking process. Definitely one you probably don’t embark on unless you really care about the result (or you’re well paid).
Trained on enough code, couldn't it figure out reasonable enough names from the structure of the code?
On the other hand, it might not work at all if short functions tend to be incredibly generic, and all the real meaning is tied up in the nonlocal organization of it all.
And then of course you need context to know what the nouns and verbs are at all. I can imagine similar structures involving Luigis and Koopas, or invoices and payments.
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.
As if that would make a difference in how big of a copyright violation all of this is.
I’m sure people have done this, I have the leaked code somewhere so I could do it if you want