{
  "added_at": "2026-10-28",
  "additional_evidence_urls": [
    "https://github.com/gustavocanepa/gt4-decomp/blob/e35ec1ddb6a5931252489ff7d8ed27520fdabe4e/orig/README.md",
    "https://github.com/gustavocanepa/gt4-decomp/blob/e35ec1ddb6a5931252489ff7d8ed27520fdabe4e/THIRD_PARTY.md",
    "https://github.com/gustavocanepa/gt4-decomp/blob/e35ec1ddb6a5931252489ff7d8ed27520fdabe4e/project.toml",
    "https://github.com/gustavocanepa/gt4-decomp/blob/e35ec1ddb6a5931252489ff7d8ed27520fdabe4e/tools/setup_linux.sh",
    "https://github.com/gustavocanepa/gt4-decomp/blob/e35ec1ddb6a5931252489ff7d8ed27520fdabe4e/.github/workflows/check.yml",
    "https://github.com/gustavocanepa/gt4-decomp/blob/e35ec1ddb6a5931252489ff7d8ed27520fdabe4e/.github/workflows/progress.yml",
    "https://github.com/gustavocanepa/gt4-decomp/blob/e35ec1ddb6a5931252489ff7d8ed27520fdabe4e/AGENTS.md",
    "https://github.com/gustavocanepa/gt4-decomp/blob/e35ec1ddb6a5931252489ff7d8ed27520fdabe4e/PILOT.md",
    "https://github.com/gustavocanepa/gt4-decomp/blob/e35ec1ddb6a5931252489ff7d8ed27520fdabe4e/LICENSE",
    "https://github.com/gustavocanepa/gt4-decomp/blob/9bcdea300b904cc48bd81886e169ea8925f31d41/report.json",
    "https://decomp.dev/gustavocanepa/gt4-decomp"
  ],
  "category": "reconstruction-cases",
  "description_en": "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.",
  "description_zh": "将 Gran Turismo 4（《GT 赛车 4》）的 PS2 引擎可执行文件（CORE.GT4，NTSC-U v1.01）按每个函数一个 C 或 C++ 源文件反编译，面向 Sony 的 ee-gcc 2.96，并用 newlib、Expat 等公开库自身的源码匹配其函数。README 称大部分匹配工作由驱动项目工具的 AI 智能体（Anthropic 的 Claude）完成，每个函数须通过编译器与判定器的比对才算完成，并报告 2026 年 10 月某次提交时 95.4% 的函数和 83.6% 的代码字节已匹配。本地完整构建将源码链接到原始地址，其余部分用反汇编补齐，再与使用者的可执行文件比较 SHA-1。",
  "entry_url": "https://awesomerea.org/resources/gran-turismo-4-matching-decomp-case/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/gran-turismo-4-matching-decomp-case/",
  "evidence_url": "https://github.com/gustavocanepa/gt4-decomp/blob/e35ec1ddb6a5931252489ff7d8ed27520fdabe4e/README.md",
  "group": "cases",
  "id": "gran-turismo-4-matching-decomp-case",
  "json_url": "https://awesomerea.org/resources/gran-turismo-4-matching-decomp-case/record.json",
  "kind": "case-study",
  "markdown_url": "https://awesomerea.org/resources/gran-turismo-4-matching-decomp-case/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/gran-turismo-4-matching-decomp-case/index.md",
  "name": "Gran Turismo 4: an agent-assisted PS2 engine matching decompilation",
  "name_zh": "Gran Turismo 4：借助智能体的 PS2 引擎匹配反编译",
  "reconstruction_method": "matching-decompilation",
  "record_type": "resource",
  "relationship": "independent-reconstruction",
  "requirements": [
    "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.",
    "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/."
  ],
  "requirements_zh": [
    "README 称这是只针对引擎可执行文件、仍在进行中的匹配反编译：游戏逻辑大多在 Adhoc 脚本中，由独立的 OpenAdhoc 项目重建；另一个独立项目 GT4 Native PC 移植被描述为尚不可玩。progress 分支针对提交 ba5d800（2026-10-19）的报告（decomp.dev 对所审提交显示相同数字）给出 30,962 个函数中 29,551 个、代码 83.55% 已匹配，82.08% 的代码由源码链接，2.13% 的数据由源码放置；202 个原本就是手写汇编的函数不计入。",
    "需自备 Gran Turismo 4（美版）v1.01 光盘镜像（SCUS-97328）；orig/README.md 列出 SCUS_973.28、CORE.GT4 及其转换所得 ELF 的 SHA-1。仓库未提交任何游戏内容，因此 SHA-1 构建校验和进度报告只能在具备这些文件的机器上运行，CI 中无法运行。",
    "文档以 Linux 或 WSL（Ubuntu）为准，需要 Python 3.11 及以上和 rabbitizer。tools/setup_linux.sh 安装 MIPS binutils 和 32 位 libc，下载 decomp.me 的 ee-gcc 2.96 构建，克隆 decomp-permuter，并在虚拟环境中安装 splat；project.toml 还列出其他 decomp.me 编译器，其中 ee-gcc 2.9 用于约 270 个 Sony SDK 函数。",
    "当 tools/match.py（或智能体使用的 tools/swarm.py）输出 MATCH，且 tools/build.py 将每个函数链接到原始地址并比较已加载段的 SHA-1 时，函数才算匹配。CI 运行单元测试、“C 中不得夹带汇编”的策略检查和布局检查，并编译每个源文件，但没有游戏文件就无法链接或比较；匹配数字为作者报告。",
    "项目的工具、文档和源码采用 MIT 许可。THIRD_PARTY.md 列出按各自条款匹配的公开库（Expat、newlib、带例外条款的 GPL 下的 GNU libio 与 GCC 运行库、SGI STL 头文件、MT19937），可用 build.py --without 排除，并说明专有的 SCE-RT/Medius、Logitech 和 Sony SDK 代码仅作识别、未予复制。Gran Turismo 4 归 Sony Interactive Entertainment 所有。智能体说明位于 AGENTS.md、CLAUDE.md 和 .claude/。"
  ],
  "targets": [
    "game"
  ],
  "url": "https://github.com/gustavocanepa/gt4-decomp",
  "verification": "source-reviewed",
  "verified_at": "2026-10-19"
}
