# th06: an independently matching Touhou 6 decompilation

> th06 reconstructs C++ source for Touhou 6: Embodiment of Scarlet Devil retail version 1.02h from the original executable. The workflow uses headless Ghidra analysis, the original MSVC and DirectX toolchain under Wine, and byte comparisons of functions and the whole executable. The author reports that all 511 game functions and the rebuilt executable match the original, with replay traces compared separately.

- Type: Case study
- Targets: Game
- Category: Independent reconstruction cases
- Relationship: Independent reconstruction project
- Sources reviewed: 2026-11-06
- Added to the catalog: 2026-11-08
- Original resource: <https://github.com/Cirno-Labs/th06>
- Primary source: <https://github.com/Cirno-Labs/th06/blob/c7bcab1f81a04169c23f8a700b5ae9ed8a858388/README.md>
- Catalog page: <https://awesomerea.org/resources/cirno-labs-th06-case/>
- Record JSON: <https://awesomerea.org/resources/cirno-labs-th06-case/record.json>
- Chinese version: [简体中文](https://awesomerea.org/zh/resources/cirno-labs-th06-case/index.md)

## Requirements & limits

- **Prerequisites:** Requires the user's own retail Touhou 6 files updated to version 1.02h.
- **Prerequisites:** Building requires Wine, Python 3, just, binutils, 7-Zip, Visual C++ .NET 2002, Windows XP SP2 Platform SDK, and DirectX 8.0 SDK.
- **Prerequisites:** Replay checks additionally require Xvfb, xdotool, ImageMagick, 32-bit Mesa, and the ja_JP.UTF-8 locale.
- **License:** GPL-3.0-only licence for the project source.

## Primary sources

1. <https://github.com/Cirno-Labs/th06/blob/c7bcab1f81a04169c23f8a700b5ae9ed8a858388/README.md>
2. <https://github.com/Cirno-Labs/th06/blob/c7bcab1f81a04169c23f8a700b5ae9ed8a858388/orig/README.md>
3. <https://github.com/Cirno-Labs/th06/blob/c7bcab1f81a04169c23f8a700b5ae9ed8a858388/docs/exe-parity.md>

## More in Games

- [TH06: reconstructing Japanese 1.02h authored functions](https://awesomerea.org/resources/th06-strict-reconstruction-case/index.md) · Case study
- [th07: reconstructing Touhou 7 retail 1.00b](https://awesomerea.org/resources/cirno-th07-case/index.md) · Case study
- [TH08: exact-source reconstruction and separately tested ports](https://awesomerea.org/resources/th08-reconstruction-case/index.md) · Case study
- [TH095: function-level reconstruction of Shoot the Bullet 1.02a](https://awesomerea.org/resources/th095-reconstruction-case/index.md) · Case study
- [TH10: reconstructing Mountain of Faith 1.00a](https://awesomerea.org/resources/th10-reconstruction-case/index.md) · Case study
- [TH11: byte-exact source reconstruction of Subterranean Animism](https://awesomerea.org/resources/th11-reconstruction-case/index.md) · Case study

## About this entry

The description was reviewed against primary sources.
Original editorial content: MIT. Linked projects, papers and assets retain their own rights and licenses.
