1

More specifically, could you get low level code from a rom, and piece it together and translate it to a higher level language?

1
  • 2
    Decompilers exist, yes, for many different CPUs. But they're not perfect, and you'd need to understand how the code interfaces with the platform the ROM is built into if not standard, and chances are it'll take a fair amount of effort and expertise to get you something useable, depending on what level of fidelity you want and what you're trying to do with it.
    – Rup
    May 31, 2018 at 11:27

1 Answer 1

3

The source code is discarded completely by the compiler/assembler and is not present anywhere in the rom (except by accident).

However, you can convert the low-level machine code to a high level language. This process is called decompilation, and while it can be tedious and difficult, it is possible to come up with high-level code which has the same functionality as the binary code. Note that this won’t get you source code, merely equivalent code. For example, information like function or variable names is not necessary for the CPU so is discarded completely unless you elect to produce debug information, which rarely happens in released games.

On difficulties of machine code decompilation, see Why are machine code decompilers less capable than for example those for the CLR and JVM?

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.