{
  "added_at": "2026-10-28",
  "additional_evidence_urls": [
    "https://github.com/adonis-singh/re4/blob/9b76ff003081d6ece8b838453fb8310743a972c7/LICENSE",
    "https://github.com/adonis-singh/re4/blob/9b76ff003081d6ece8b838453fb8310743a972c7/CONTRIBUTING.md",
    "https://github.com/adonis-singh/re4/blob/9b76ff003081d6ece8b838453fb8310743a972c7/configure.py",
    "https://github.com/adonis-singh/re4/blob/9b76ff003081d6ece8b838453fb8310743a972c7/config/G4BE08/build.sha1",
    "https://github.com/adonis-singh/re4/blob/9b76ff003081d6ece8b838453fb8310743a972c7/tools/sn-gcc/build.sh",
    "https://github.com/adonis-singh/re4/blob/9b76ff003081d6ece8b838453fb8310743a972c7/tools/extract_orig.py",
    "https://github.com/adonis-singh/re4/blob/9b76ff003081d6ece8b838453fb8310743a972c7/docs/naming.md",
    "https://github.com/adonis-singh/re4/blob/9b76ff003081d6ece8b838453fb8310743a972c7/docs/research/README.md"
  ],
  "category": "reconstruction-cases",
  "description_en": "Reconstructs C and C++ source for the two-disc Resident Evil 4 GameCube debug prototype (G4BE08) and rebuilds main.dol and all 114 REL overlays with the compilers the README names, checking every output against a SHA-1 list. Function names are Capcom’s own from the debug build’s Bio4.sym files, and most struct and field names are aligned from the PS2 debug build’s debug information. The project’s research log says AI agents did the matching work; byte identity is project-reported.",
  "description_zh": "为 Resident Evil 4 的双光盘 GameCube 调试原型版（G4BE08）重建 C 与 C++ 源码，并用 README 所列编译器重新构建 main.dol 及全部 114 个 REL 覆盖模块，逐一与 SHA-1 清单比对。函数名沿用调试版 Bio4.sym 符号文件中 Capcom 自己的命名，多数结构体与字段名则依据 PS2 调试版的调试信息对齐得出。项目的研究日志称一致性工作由 AI 智能体完成；字节一致为项目报告的结果。",
  "entry_url": "https://awesomerea.org/resources/re4-gamecube-debug-decomp-case/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/re4-gamecube-debug-decomp-case/",
  "evidence_url": "https://github.com/adonis-singh/re4/blob/9b76ff003081d6ece8b838453fb8310743a972c7/README.md",
  "group": "cases",
  "id": "re4-gamecube-debug-decomp-case",
  "json_url": "https://awesomerea.org/resources/re4-gamecube-debug-decomp-case/record.json",
  "kind": "case-study",
  "markdown_url": "https://awesomerea.org/resources/re4-gamecube-debug-decomp-case/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/re4-gamecube-debug-decomp-case/index.md",
  "name": "re4: a byte-identical decompilation of the Resident Evil 4 GameCube debug build",
  "name_zh": "re4：Resident Evil 4 GameCube 调试版的字节一致反编译",
  "reconstruction_method": "matching-decompilation",
  "record_type": "resource",
  "relationship": "independent-reconstruction",
  "requirements": [
    "Reviewed at the 2026-10-02 head, under four weeks after the first commit of 2026-09-07. README calls the decompilation complete: every unit compiles to the original bytes, src/ holds about 570,000 lines of C and C++ with no assembly files, and 526 `// COMPILER-DIFF:` spots coax the compiler’s register or instruction choices without emitting code. Nearly all remaining inline assembly is in routines the vendors also wrote in assembly. The output is the debug prototype’s DOL and RELs, not a retail build or PC port.",
    "Supply your own images of both debug discs in orig/G4BE08/: disc 1 provides main.dol and most RELs, disc 2 the four island-stage RELs, and configure.py also reads the matching Bio4 symbol files from them. The game code’s compiler is built from SN Systems’ GPL source release of its ProDG 3.9.3 GCC port, which the user also supplies. The repository contains no game assets.",
    "The documented host is Linux with Python 3 and ninja. tools/sn-gcc/build.sh builds SN’s GCC 2.95.3 (SN BUILD v1.79) natively once with the project’s Linux-host and memory-flag patches; CRI middleware builds with Metrowerks CodeWarrior 2.4.7 and the Nintendo SDK, taken from dolsdk2004, with GC/1.2.5n. The first configure run downloads pinned decomp-toolkit, objdiff, wibo and CodeWarrior compiler releases.",
    "A successful build should end with ninja reporting 100% matched and linked, and dtk shasum against config/G4BE08/build.sha1 should print OK for all 115 binaries; tools/bytecmp.py compares single units and tools/asmcheck.py --all counts instructions emitted from asm templates, a total changes must not alter. The repository has no CI workflow or release, so these results are project-reported.",
    "LICENSE applies CC0 only to the project’s build scripts, tools, configuration and documentation. README and LICENSE state that the reconstructed game, SDK and middleware source in src/ and include/ remains the property of Capcom, Nintendo and CRI Middleware and is published for research and preservation only. docs/research/README.md describes its matching notes as written by the AI agents that did the matching work."
  ],
  "requirements_zh": [
    "审阅的是 2026-10-02 的最新提交，距 2026-09-07 的首次提交不到四周。README 称反编译已完成：每个单元都编译为原始字节，src/ 中约有 57 万行 C 与 C++ 代码且没有汇编文件；另有 526 处 `// COMPILER-DIFF:` 标记，在不生成额外指令的前提下引导编译器选择相同的寄存器或指令顺序。其余内联汇编几乎都位于原厂同样以汇编编写的例程中。产物是调试原型版的 DOL 与 REL，不是零售版构建，也不是 PC 移植。",
    "需将自备的两张调试版光盘镜像放入 orig/G4BE08/：光盘 1 提供 main.dol 和大部分 REL，光盘 2 提供岛屿关卡的四个 REL，configure.py 还会从中读取对应的 Bio4 符号文件。游戏代码所用编译器需从 SN Systems 公开的 ProDG 3.9.3 GCC 移植版 GPL 源码构建，该源码同样由使用者自备。仓库不含游戏素材。",
    "文档说明的构建宿主为 Linux，需 Python 3 与 ninja。tools/sn-gcc/build.sh 会结合项目的 Linux 宿主补丁和内存标志补丁，一次性在本机构建 SN 的 GCC 2.95.3（SN BUILD v1.79）；CRI 中间件使用 Metrowerks CodeWarrior 2.4.7 构建，取自 dolsdk2004 的 Nintendo SDK 则使用 GC/1.2.5n。首次运行 configure 会下载固定版本的 decomp-toolkit、objdiff、wibo 和 CodeWarrior 编译器包。",
    "构建成功时，ninja 应在最后报告 100% 匹配并完成链接，按 config/G4BE08/build.sha1 运行 dtk shasum 应对全部 115 个二进制文件输出 OK；tools/bytecmp.py 用于比较单个单元，tools/asmcheck.py --all 统计由 asm 模板生成的指令数，任何修改都不得改变该总数。仓库没有 CI 工作流或发布版本，因此这些结果均为项目报告。",
    "LICENSE 仅将 CC0 用于项目自行编写的构建脚本、工具、配置与文档。README 与 LICENSE 声明，src/ 与 include/ 中重建的游戏、SDK 及中间件源码仍归 Capcom、Nintendo 与 CRI Middleware 所有，仅为研究与保存目的发布。docs/research/README.md 称其中的匹配笔记由完成匹配工作的 AI 智能体撰写。"
  ],
  "targets": [
    "game"
  ],
  "url": "https://github.com/adonis-singh/re4",
  "verification": "source-reviewed",
  "verified_at": "2026-10-19"
}
