# Touhou 6：重建东方红魔乡 1.02h 版源码

> 为 Touhou 6：东方红魔乡 1.02h 版的 Windows 可执行文件重建 C++ 源码，目标是用原版 Visual Studio .NET 2002 与 DirectX 8 工具链精确重新构建。reccmp 和 objdiff 将重建的二进制与使用者自备的原可执行文件逐函数比较。仓库内的进度徽章报告函数已全部实现、字节准确率为 98.03%，因此不主张整个二进制完全一致。

- 类型：案例
- 目标：游戏
- 类别：独立重建案例
- 关联：独立重建项目
- 来源复核于：2026-10-18
- 收录于：2026-10-19
- 原始资源：<https://github.com/GensokyoClub/th06>
- 一手来源：<https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/README.md>
- 目录页面：<https://awesomerea.org/zh/resources/th06-decomp-case/>
- 记录 JSON：<https://awesomerea.org/resources/th06-decomp-case/record.json>
- 英文版：[English](https://awesomerea.org/resources/th06-decomp-case/index.md)

## 使用条件与局限

- **前提条件：**需自备与 README 中 SHA-256 一致的原版 1.02h 东方紅魔郷.exe，并复制为 resources/th06.exe；reccmp 校验同一哈希，构建也会从该文件提取游戏图标。仓库不含游戏可执行文件或数据；比较工作流通过机密配置的 URL 获取原始二进制。
- **前提条件：**构建需要 Python 3.4 及以上；非 Windows 平台还需 msiextract 和 Wine（macOS 建议使用 CrossOver）；aria2c 为可选。scripts/create_devenv.py 从网络存档下载 Visual Studio .NET 2002 和 DirectX 8.0 SDK，并获取 ninja、objdiff、Ghidra 等辅助工具；scripts/build.py 生成并运行 ninja 构建。
- **范围：**README 表明目标是完美重建 1.02h 版源码；仓库内可变的进度徽章报告 TH06.EXE 已 100.0% 实现、字节准确率 98.03%。README 另指向用于 Linux 和新版 Windows 的独立 portable 分支。团队的 Ghidra 成果以 XML 形式导出到配套仓库 happyhavoc/th06-re。
- **测试证据：**贡献者使用 reccmp 比较差异，它以 HTML 报告给出重建可执行文件相对原文件的逐函数准确率。CI 在 Windows 上构建，并将 objdiff 构建与通过 Ghidra 从原文件拆出的目标文件比较；一套小型 munit 测试会读取使用者的游戏资源包。徽章数字由项目生成。
- **许可：**仓库以 CC0 1.0 释出；原游戏、下载的 Microsoft 工具链及第三方工具各有条款。

## 一手来源

1. <https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/README.md>
2. <https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/reccmp-project.yml>
3. <https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/resources/progress.svg>
4. <https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/scripts/create_devenv.py>
5. <https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/scripts/build.py>
6. <https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/scripts/extract_icon.py>
7. <https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/.github/workflows/ci.yml>
8. <https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/.github/workflows/compare.yml>
9. <https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/tests/test_Pbg3Archive.cpp>
10. <https://github.com/GensokyoClub/th06/blob/e840ab447f38579c2ea877e16a5d91a49adf016e/LICENSE>

## 同分区更多条目：游戏

- [Touhou 7：重建东方妖妖梦 1.00b 版源码](https://awesomerea.org/zh/resources/th07-decomp-case/index.md) · 案例
- [《黄昏公主》：GameCube 版代码完全一致的反编译](https://awesomerea.org/zh/resources/twilight-princess-decomp-case/index.md) · 案例
- [Underworld Exhumed：重建 Ultima Underworld I 与 II](https://awesomerea.org/zh/resources/underworld-exhumed-case/index.md) · 案例
- [wii-ipl：Wii Menu（System Menu 4.3）的反编译重建](https://awesomerea.org/zh/resources/wii-menu-ipl-decomp-case/index.md) · 案例
- [c1：PlayStation 版《古惑狼》的 C 语言移植](https://awesomerea.org/zh/resources/crash-bandicoot-c1-port-case/index.md) · 案例
- [Firefighter：将反编译的 DOS 游戏移植为 Rust](https://awesomerea.org/zh/resources/firefighter-rust-port-case/index.md) · 案例

## 关于此条目

说明已依据一手来源复核。
原创说明采用 MIT 许可；外部项目、论文与素材保留各自的权利和许可。
