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

  • 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 '18 at 11:27

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?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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