EoSDecomp: A Byte-Accurate Decompilation of Touhou 6 ~ Embodiment of Scarlet Devil
EoSDecomp is a byte-accurate decompilation of Touhou 6 ~ Embodiment of Scarlet Devil. The goal is to reconstruct the original binary piece by piece into source you can actually read and modify, with a recompiled build that matches the original bit for bit. This repo isn’t mine originally, it’s a fork I pulled down to chew on myself. The upstream project is the work of a group of people in the community; I brought it under my own name to follow along with the code, learn reverse engineering, and keep a backup while I’m at it.
Embodiment of Scarlet Devil is the sixth Touhou Project game, a vertical bullet-hell shooter that ZUN basically built solo. What makes it special is that ZUN himself has said the source is effectively lost. If you want to work with this game today, you either track down a pirated copy or go hunting for a physical disc on Yahoo Auctions. An old game with no source, one you can only get at through archaeology, is bait for anyone who does reverse engineering.
On top of that, it barely runs. Embodiment of Scarlet Devil uses DirectX8, which just barely works on Win10, and on Win11 you get all kinds of weird bugs, crashes, graphical corruption, and freezes. To make it behave, people usually lean on EnbDev’s DX8-to-DX9 conversion, or a wrapper layer like dgVoodoo2. The community is willing to rebuild it from the binary, step by step, into source you can read, modify, and fix, and that work alone is worth getting close to see how it’s done.
For me it’s a live textbook. How a DirectX8-era game organizes memory and rendering, reading the actual code beats any tutorial. The project’s own goal is just as direct: get more people playing Touhou, fix a pile of known bugs along the way, and keep it playable on modern systems.
What’s interesting is that what you’re studying line by line is code a Japanese guy poured into Visual Studio 2002 back in the day. In the credits, Programming Support is attributed to pbg, and Special Thanks names two people, ant and fang, whom nobody has ever managed to identify, probably testers from back then.