hn.today

Resident Evil 4 (GameCube) – complete byte-identical decompilation to C/C++

github.com53 points33 comments
Screenshot of Resident Evil 4 (GameCube) – complete byte-identical decompilation to C/C++

Complete, byte-identical decompilation of Resident Evil 4 for the Nintendo GameCube (G4BE08 debug build, Nov 25 2004 prototype, both discs) into C and C++. Building reproduces main.dol and all 114 REL overlays exactly. The tree contains 1,083 objects (675 in the DOL, 408 across RELs), 15,641 functions, roughly 555k lines of C/C++ source and 33k lines of headers, with no hand-written assembly files in game code. Toolchain details and middleware are preserved: the game is reproduced with SN Systems ProDG/GCC 2.95.3, CRI libraries from Metrowerks CodeWarrior, and Nintendo SDK units; the repository itself contains no game assets, so original debug-disc images are required to build. Build uses Python 3 and ninja and verifies outputs with byte-level checksums and compare tools included in the repo.

The decompilation documents the matching methodology and artifacts: every unit is compiled to the original bytes, compiler-driven deviations are annotated with COMPILER-DIFF comments, and an asm-removal pass converted earlier hand-placed asm back to C where feasible. Remaining assembly is limited to code originally written in assembly or compiler-inexpressible paired-single/cache/GQR kernels and eight asm-bodied units; these are documented and isolated. Functions keep Capcom’s debug-symbol names; struct fields mix vendor names, reconstructed names, and placeholder offsets. Materials and tools are released for research and preservation; reconstructed IP remains owned by its original holders, while build tools and docs are CC0.

Read on github.com33 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.