Do they guess it based on what they end up thinking the function/variable does in the code?
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.
Soon: Freedows 12. "Your Honor, I just looked at the compiled code, so it must be considered clean from copyright claims!".
ReactOS and Wine exists and are reimplementations of copyrighted code.
Good luck trying to prove to any judge in the world that you came up with an implementation that happens to be exactly the same as the original game code, down to the same checksum, by pure chance.
What is this, "the ChatGPT defense"? Do you really think that code has intrinsically less right to copyright than art, or what?
>ReactOS and Wine exists and are reimplementations of copyrighted code.
Clean room reimplementations that don't even dare to look at the copyrighted code.
> Good luck trying to prove to any judge in the world that you came up with an implementation that happens to be exactly the same as the original game code, down to the same checksum, by pure chance.
Not impossible if you reverse engineer the software and look how the binary code is behaving, emulators does this all the time.
A reimplementation of code that leads to the same binary output isn't covered by the copyright, as long as you don't share copyrighted assets or the actual binaries. What people do with the alternative source code is their business, you can't hold responsible that person for others' action.
We are not talking about a program that "produces the same binary output" when executed. We are talking about a program that _is exactly the same_ as the original one, bit-by-bit.
It is ridiculously impossible to "independently" discover a program that is _exactly the same machine code_ as the original program by just looking at the inputs and outputs of the original program. (Barring trivial programs, of course.)
This is not reverse engineering. This is just dissasembling and decompiling.
Do you think that I can just gzip gplprogram.c and then redistribute gplprogram.c.gz under the "Do What The Fuck You Want To Public License"?
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