{
  "added_at": "2026-10-18",
  "additional_evidence_urls": [
    "https://github.com/Yokimitsuro/khdays-decomp/blob/261a89eaa8f65dd566ae0828b0b57c85c847a6ee/CONTRIBUTING.md",
    "https://github.com/Yokimitsuro/khdays-decomp/blob/261a89eaa8f65dd566ae0828b0b57c85c847a6ee/PROGRESS.md",
    "https://github.com/Yokimitsuro/khdays-decomp/blob/261a89eaa8f65dd566ae0828b0b57c85c847a6ee/docs/PROGRESS_POLICY.md",
    "https://github.com/Yokimitsuro/khdays-decomp/blob/261a89eaa8f65dd566ae0828b0b57c85c847a6ee/docs/ARM7.md",
    "https://github.com/Yokimitsuro/khdays-decomp/blob/261a89eaa8f65dd566ae0828b0b57c85c847a6ee/.github/workflows/checks.yml",
    "https://github.com/Yokimitsuro/khdays-decomp/blob/261a89eaa8f65dd566ae0828b0b57c85c847a6ee/.github/workflows/report.yml",
    "https://github.com/Yokimitsuro/khdays-decomp/blob/261a89eaa8f65dd566ae0828b0b57c85c847a6ee/LICENSE",
    "https://decomp.dev/Yokimitsuro/khdays-decomp",
    "https://web.archive.org/web/20261020041901/https://decomp.dev/Yokimitsuro/khdays-decomp/YKGP/261a89eaa8f65dd566ae0828b0b57c85c847a6ee.json"
  ],
  "category": "reconstruction-cases",
  "description_en": "Reconstructs the ARM9 program and overlays of the EU Nintendo DS release of Kingdom Hearts 358/2 Days as C that recompiles byte for byte with CodeWarrior. README reports all 306 modules byte-identical, with about 99.5% of functions in real C and library assembly counted separately; the ARM7 binary is outside its scope. The repository holds no ROM, game assets or extracted disassembly and produces no playable build.",
  "description_zh": "将 Nintendo DS 欧版《王国之心 358/2 Days》的 ARM9 程序及覆盖模块重建为 C 源码，以 CodeWarrior 重新编译后逐字节一致。README 报告全部 306 个模块字节一致，约 99.5% 的函数为真正的 C，库自身的汇编另行统计；ARM7 二进制不在范围内。仓库不含 ROM、游戏素材或提取的反汇编，也不生成可玩版本。",
  "entry_url": "https://awesomerea.org/resources/kingdom-hearts-days-matching-decomp-case/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/kingdom-hearts-days-matching-decomp-case/",
  "evidence_url": "https://github.com/Yokimitsuro/khdays-decomp/blob/261a89eaa8f65dd566ae0828b0b57c85c847a6ee/README.md",
  "group": "cases",
  "id": "kingdom-hearts-days-matching-decomp-case",
  "json_url": "https://awesomerea.org/resources/kingdom-hearts-days-matching-decomp-case/record.json",
  "kind": "case-study",
  "markdown_url": "https://awesomerea.org/resources/kingdom-hearts-days-matching-decomp-case/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/kingdom-hearts-days-matching-decomp-case/index.md",
  "name": "Kingdom Hearts 358/2 Days: a matching Nintendo DS decompilation",
  "name_zh": "《王国之心 358/2 Days》：逐字节一致的 Nintendo DS 反编译重建",
  "reconstruction_method": "matching-decompilation",
  "record_type": "resource",
  "relationship": "independent-reconstruction",
  "requirement_facets": [
    "scope",
    "prerequisites",
    "prerequisites",
    "testing",
    "license"
  ],
  "requirements": [
    "README reports every function of the EU (YKGP) ARM9 program and its overlays matched and all initialized data reconstructed, with 306 of 306 rebuilt modules byte-identical; the remaining work is readability, such as shared structures, naming and file grouping. It counts 23,125 of about 23,233 functions as real C and tracks 108 assembly implementations (library routines and two game functions that need clz) separately. docs/ARM7.md states that the decomp covers the ARM9 only. This is a matching decompilation, not a port, and it produces no playable build or redistributable binary.",
    "Requires the user’s own EU ROM dump, days.nds: 268,435,456 bytes, SHA-1 6fae8f5bbe80114b4e2535260eab5f4d0fc8a844 (CONTRIBUTING.md also lists SHA-256 and MD5). Other dumps will not line up with the committed addresses. The repository tracks no ROM, extracted data (including the extracted asm/ tree), build output or proprietary toolchain, and a pull-request check rejects added ROM, binary or asset files.",
    "CONTRIBUTING.md lists Python 3 with capstone, pyelftools and ndspy, the dsd extraction and delinking tool, the proprietary CodeWarrior mwccarm 3.0 build 139 compiler (not supplied), arm-none-eabi-as and a Ninja-driven mwccarm/mwldarm build; its commands call tools/dsd.exe alongside Bash scripts. A few precompiled-middleware units use an older mwccarm through per-file compiler overrides.",
    "dsd check modules compares each built module with the base ROM, verify_idx.py checks single functions including relocations, and the ROM round-trip script is expected to differ from the reference dump only in four non-functional CRC bytes. CONTRIBUTING notes that functions listed as known mismatches are kept out of the link and filled with original bytes. CI does not build the game; it rejects forbidden files and regenerates progress reports. decomp.dev reports YKGP 100.00% decompiled and fully linked at the reviewed commit, counting verified SDK assembly.",
    "Contributors’ decompilation and tooling are dedicated to the public domain under CC0 1.0; the original game and its assets remain their owners’ property, and the CodeWarrior compiler is not distributed. DS Protect sources are reconstructed after taxicat1/dsprot, and the SDK identification harness compiles NitroSDK sources from pret/pokediamond."
  ],
  "requirements_zh": [
    "README 报告欧版（YKGP）ARM9 程序及其覆盖模块的所有函数均已匹配，初始化数据全部重建，重建的 306 个模块全部字节一致；剩余工作是提升可读性，例如共享结构体、命名和按文件归类。其中约 23,233 个函数中有 23,125 个计为真正的 C，另行统计 108 个汇编实现（库例程以及两个需要 clz 指令的游戏函数）。docs/ARM7.md 说明反编译只覆盖 ARM9。这是一致性反编译而非移植，不生成可玩版本或可再分发的二进制。",
    "需使用者自备欧版 ROM 转储 days.nds：大小 268,435,456 字节，SHA-1 为 6fae8f5bbe80114b4e2535260eab5f4d0fc8a844（CONTRIBUTING.md 另列出 SHA-256 和 MD5）。其他转储与已提交的地址对不上。仓库不跟踪 ROM、提取数据（包括提取出的 asm/ 目录）、构建产物或专有工具链，拉取请求检查也会拒绝新增的 ROM、二进制或素材文件。",
    "CONTRIBUTING.md 列出所需工具：带 capstone、pyelftools 和 ndspy 的 Python 3，dsd 提取与反链接工具，专有的 CodeWarrior mwccarm 3.0 build 139 编译器（不随仓库提供），arm-none-eabi-as，以及由 Ninja 驱动的 mwccarm／mwldarm 构建；其命令同时调用 tools/dsd.exe 与 Bash 脚本。少数预编译中间件单元通过逐文件的编译器覆盖设置改用更早版本的 mwccarm。",
    "dsd check modules 将每个构建出的模块与原 ROM 比对，verify_idx.py 校验单个函数（包括重定位），ROM 往返脚本的预期结果是与参考转储只差四个不影响功能的 CRC 字节。CONTRIBUTING 说明，列为已知不匹配的函数不会参与链接，其位置以原始字节填充。CI 不构建游戏，只拒绝禁止的文件并重新生成进度报告。decomp.dev 报告所审提交的 YKGP 已 100.00% 反编译并完全链接，其中计入经验证的 SDK 汇编。",
    "贡献者的反编译和工具以 CC0 1.0 贡献到公有领域；原游戏及其素材仍归其所有者，CodeWarrior 编译器也不随仓库分发。DS Protect 源码参照 taxicat1/dsprot 重建，SDK 识别工具编译 pret/pokediamond 中的 NitroSDK 源码。"
  ],
  "targets": [
    "game"
  ],
  "url": "https://github.com/Yokimitsuro/khdays-decomp",
  "verification": "source-reviewed",
  "verified_at": "2026-10-18"
}
