Case study

Gran Turismo 4: an agent-assisted PS2 engine matching decompilation

Decompiles Gran Turismo 4’s PS2 engine executable (CORE.GT4, NTSC-U v1.01) into one C or C++ source per function for Sony’s ee-gcc 2.96, matching public libraries such as newlib and Expat from their own source. The README credits AI agents (Anthropic’s Claude) driving the project’s tools with most of the matching, each function accepted only on a compiler-and-judge comparison, and reports 95.4% of functions and 83.6% of code bytes matched for an October 2026 commit. A local full build links sources at their original addresses, fills the rest from disassembly and compares SHA-1 with the user’s executable.

Requirements & limits

  • README describes a work-in-progress matching decompilation of the engine executable only: most game logic lives in Adhoc scripts, which the separate OpenAdhoc project re-creates, and the separate GT4 Native PC port is described as not playable. The progress-branch report for commit ba5d800 (2026-10-19), which decomp.dev also shows for the reviewed commit, gives 29,551 of 30,962 functions and 83.55% of code matched, 82.08% of code linked from source and 2.13% of data placed from source; 202 hand-written assembly functions are not counted.
  • Supply your own Gran Turismo 4 (USA) v1.01 disc image (SCUS-97328); orig/README.md lists SHA-1 values for SCUS_973.28, CORE.GT4 and the ELF converted from it. Nothing from the game is committed, so the SHA-1 build check and the progress reports run only where those files are present, not in CI.
  • Documented for Linux or WSL (Ubuntu) with Python 3.11+ and rabbitizer. tools/setup_linux.sh installs MIPS binutils and 32-bit libc, downloads decomp.me’s ee-gcc 2.96 build, clones decomp-permuter and installs splat in a virtual environment; project.toml names further decomp.me compilers, including ee-gcc 2.9 for about 270 Sony SDK functions.
  • A function counts as matched when tools/match.py (or the agents’ tools/swarm.py) prints MATCH, and tools/build.py links every function at its original address and compares SHA-1 of the loaded segments. CI runs unit tests, an assembly-in-C policy check and layout checks and compiles every source, but cannot link or compare without the game; matching figures are author-reported, and this collection built or ran nothing.
  • MIT for the project’s tools, documentation and source. THIRD_PARTY.md lists matched public libraries under their own terms (Expat, newlib, GNU libio and the GCC runtime under GPL with exceptions, SGI STL headers, MT19937), which build.py --without can leave out, and records proprietary SCE-RT/Medius, Logitech and Sony SDK code as identified but not copied. Gran Turismo 4 belongs to Sony Interactive Entertainment. Agent instructions are in AGENTS.md, CLAUDE.md and .claude/; the reviewed sources establish no REA use.

About this entry

Type
Case study
Category
Independent reconstruction cases
Relationship
Independent reconstruction project
Targets
Game

Sources reviewed

The description was reviewed against primary sources. This does not establish runtime testing, security auditing or verified compatibility.

Report an outdated entry Suggest a translation fix

Primary sources

  1. README.md GitHub · gustavocanepa/gt4-decomp · Revision e35ec1d
  2. orig/README.md GitHub · gustavocanepa/gt4-decomp · Revision e35ec1d
  3. THIRD_PARTY.md GitHub · gustavocanepa/gt4-decomp · Revision e35ec1d
  4. project.toml GitHub · gustavocanepa/gt4-decomp · Revision e35ec1d
  5. tools/setup_linux.sh GitHub · gustavocanepa/gt4-decomp · Revision e35ec1d
  6. .github/workflows/check.yml GitHub · gustavocanepa/gt4-decomp · Revision e35ec1d
  7. .github/workflows/progress.yml GitHub · gustavocanepa/gt4-decomp · Revision e35ec1d
  8. AGENTS.md GitHub · gustavocanepa/gt4-decomp · Revision e35ec1d
  9. PILOT.md GitHub · gustavocanepa/gt4-decomp · Revision e35ec1d
  10. LICENSE GitHub · gustavocanepa/gt4-decomp · Revision e35ec1d
  11. report.json GitHub · gustavocanepa/gt4-decomp · Revision 9bcdea3
  12. https://decomp.dev/gustavocanepa/gt4-decomp

More in Games

All 231 entries in GamesGames case studies (189)