A Technique for "High-Level Decompilation"
This is a writeup on something I'm calling "high-level decompilation" and how I've applied it to Armored Core.
What is a decomp/recomp?
A Decompilation or "decomp" is the process of taking a game or a piece of binary software and trying to reverse engineer what higher-level code (like C, C++, etc.) produces a matching binary or executable. The most famous decomp projects are those for Zelda 64, Super Mario 64. Once you have a decomp, that means that you have the ability to now recompile that code for a different platform or to inspect how the game worked or to modify the game in a high-level language.
Alternatively, there's the concept of a static recompilation or recomp. Comp is the process of statically analyzing all of the functions, branches, and instructions inside of a binary executable and transforming it into a new executable without ever producing necessarily the high-level source code. It's effectively translating the original binary into a form that can run natively on another platform, like on PC or Mac. Static Recompilation typically can be done faster than a decomp, but it doesn't gain you the ability to easily modify the specifics of the game's engine or to gain a deep understanding of how the game works necessarily, because you don't have the source code.
Decompilation efforts are typically complicated. Decompilation requires you to likely know the original compiler version, the flags that were used on that compiler and any sort of options. The reason for this is that you need the compiler given some C code to produce the same assembly code as output with the exact same ordering of everything, the same register assignments, etc. There are tools to help with some of this process, but it's still quite time consuming. Even after you have the correct compiler and flags and everything. The process of translating each function from the original binary is very labor-intensive for people to do. This is also quite difficult for agents to do very well. It is possible, but they're not extremely efficient at it. Even frontier models.
Armored Core and the High-Level Decompilation ("HLD") Harness
I've created an agent-assisted decompilation of Armored Core, an awesome PS1 game which didn't have any existing decomp efforts. Half so I could just analyze how the game works, half so I could modify that code and get it to run on my PC with native features like dual analog stick controls, high refresh rate rendering, add multiplayer over the internet, etc. Just that while Frontier models are capable of doing this, they're quite slow and they need a lot of iterations to try and get it right.