# gran-turismo-decomp Decompilation of **Gran Turismo for the PSP** (2009), European release **UCES-01245 v2.00**: rebuilding the game's executable (`EBOOT.BIN`, module `PDIAPP`) as **readable C/C++ that compiles and runs on other platforms** (PC first), so the game can be **modded** from its source code. How: the whole executable is first translated to C++ with [PSPRecomp](https://github.com/jessicanataliagta/PSPRecomp) so the game runs on PC from day one; then each translated function is replaced by hand-decompiled code, checked to behave exactly like the original. A byte-identical binary is not the goal (Sony's exact compilers are not public). > **Status (2026-11-09)** > > - **๐ŸŽฎ The game is playable on PC:** `build/gt_play` (SDL window, keyboard or controller, sound and music, > saves): races, Time Trial, dealer and garage. It draws with the GPU (Vulkan) or in software. Controls and > settings: [`docs/COMPILAR.md`](docs/COMPILAR.md) ยง5b. > - **๐Ÿงฉ Decompilation:** 20,240 of 23,208 functions (87 %) are already readable C/C++ (by hand or from a > template), checked against the original with the differential harness: each one leaves the same output and > the same memory as the recompiled original on the test routes (race, dealer, garage, options, Trial > Mountainโ€ฆ) or, where no route reaches it, on synthetic cases. 1,534 functions have their real name, each > with its evidence in `config/symbol_addrs.txt`. Bars and map below; report: `.venv/bin/python -m tools.progress`. > Structured rewrites of the register-level functions: 3064 of ~1,990. > - **๐Ÿ”ง Native mods** in the style of Dusklight, without touching the game's code: in > [amt911/gt-mods](https://github.com/amt911/gt-mods) (analog pedals, orbit camera, draw distance, reset to > track, rollovers, cheats). In-game menu on F9. How to write one: [`docs/MODS.md`](docs/MODS.md). > - **Next:** keep decompiling in batches, an in-game mod downloader, above 60 fps with interpolation, crash > deformation. Details in [`docs/ROADMAP.md`](docs/ROADMAP.md). ## Map of what is left ```text FUNCTIONS โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘ 87.21 % 20240 / 23208 BYTES โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 78.24 % 3266656 / 4175084 NAMED โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 6.61 % 1534 / 23208 ``` [![Decompilation map โ€” click for the interactive version](docs/progress_map.svg)](https://amt911.github.io/gran-turismo-decomp/progress/) Each rectangle is a function of the executable, its area proportional to its bytes: green = decompiled by hand, teal = decompiled from a template, grey = to do. Groups are 256 KiB slices of the game code by address, plus the SDK and Sony libraries apart (approximate boundary). Every decompiled function is verified against the original with the differential harness. **Interactive version** (hover for name, address, size and state, or search a function): **[online decompilation map](https://amt911.github.io/gran-turismo-decomp/progress/)**, or [`docs/progress/index.html`](docs/progress/index.html) in a browser after cloning. Everything (map, page and bars) is regenerated with `.venv/bin/python -m tools.progress_map`; it holds only addresses, sizes and the project's own names. ## What is here and what is not - **This repo holds no game data** โ€” no ISO, no executables (encrypted or not), no assets, no C++ generated by the recompiler, no proprietary compilers. You need **your own dump** of the UMD. - The dump is verified by hash. The expected ones are: | File | SHA1 | | --- | --- | | `Gran Turismo (v2.0) [UCES-01245].iso` | `c84473375e3cd000d8f14c5905e6514389fd6a40` | | Decrypted `EBOOT.BIN` (ELF) | `8746583fa8298f6447132988a01b236a8c5994b0` | - **Out of scope**: the Adhoc scripts (already 100 % covered by [OpenAdhoc](https://github.com/Nenkai/OpenAdhoc)), the `GT.VOL` assets ([GTPSPVolTools](https://github.com/Nenkai/GTPSPVolTools)) and Sony's PRX modules. ## Getting started Quick guide (Arch Linux; details and other uses in [`docs/COMPILAR.md`](docs/COMPILAR.md), in Spanish): ```bash # 0. Once: system dependencies sudo pacman -S --needed git curl unzip 7zip clang cmake ninja uv pkgconf ffmpeg openssl zlib \ sdl2 vulkan-icd-loader glslang # 1. Your ISO (UCES-01245 v2.00) in game_files/ โ€” checked by hash cp "/path/Gran Turismo (v2.0) [UCES-01245].iso" game_files/ # 2. Pinned tools, extract the EBOOT and recompile it to C++ (all of it stays out of git) tools/setup.sh .venv/bin/python -m tools.extract --full # --full: also GT.VOL, which the game needs .venv/bin/python -m tools.recomp # 3. Build (โ‰ˆ 4 min the first time; with a memory cap) systemd-run --user --scope -p MemoryHigh=5G -p MemoryMax=6G -p MemorySwapMax=0 -- \ sh -c 'cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER=clang++ && cmake --build build -j8' # 4. Play from the repo root (window, keyboard or controller, sound; saves in build/savedata/) build/gt_play ``` Default controls: W / Enter = accelerate and accept, S = brake, A / D = steer, arrows = menus, Backspace = back, Escape = START, F10 = settings, F11 = fullscreen (controller: triggers + stick). `build/gt_native` is the windowless build for tests and the differential harness. **Native mods** (`gt_play` only): `.so` libraries with a `mod.toml` in `build/mods//` (or `GT_MODS_DIR`), loaded through the SDK `include/gt_mod/gt_mod_api.h`; `GT_NO_MODS=1` turns them off. The mods live in the public repo [amt911/gt-mods](https://github.com/amt911/gt-mods); F9 opens their in-game menu (also on the controller: Select + Start). In-game checks: `tools/mod_*_check.sh`. How to write and install mods: [`docs/MODS.md`](docs/MODS.md). ## For agents (Claude Code / Codex) - [`AGENTS.md`](AGENTS.md) is the canonical guide; [`CLAUDE.md`](CLAUDE.md) only imports it and adds what is specific to Claude Code (REA MCP with Ghidra). - Detail per topic in [`docs/agents/`](docs/agents/): decompilation workflow, toolchain, reverse engineering, testing, runtime verification, debugging, orchestration, PR verification. - Shared memory: [`docs/FACTS.md`](docs/FACTS.md) (verified facts) and [`docs/FINDINGS.md`](docs/FINDINGS.md) (non-obvious gotchas). ## Credits and references Prior community work this builds on: PSPRecomp (jessicanataliagta) and lcs-recomp (elmasas), Nenkai (GT Modding Hub, OpenAdhoc, GTAdhocToolchain, GTPSPVolTools), rabbitizer (Decompollaborate), m2c, ghidra-allegrex (kotcrab), pspdecrypt (John-K), PPSSPP, decomp.me. Non-profit research project, not affiliated with Sony Interactive Entertainment or Polyphony Digital. *Gran Turismo* is a trademark of Sony Interactive Entertainment.