Forking a Ghidra Reverse-Engineering Database for Touhou: Embodiment of Scarlet Devil
Let me be clear up front: I didn’t write this repo. It’s a backup forked from happyhavoc/th06, holding their Ghidra database. What the upstream is doing is reversing the binary of Touhou 06 (Embodiment of Scarlet Devil) piece by piece back into C++ that lines up with the original. I pulled it purely to sit on top of someone else’s work and chew through it myself, and to keep a local copy while I’m at it.
Why th06? I’ve always had a thing for reversing old games, and Embodiment of Scarlet Devil is unavoidable. It’s a danmaku shooter ZUN wrote in C++ back in 2002, running on a very old DirectX, all hand-written flavor with none of the layers of abstraction a modern compiler smears on top. That makes it perfect for practicing RE. The bullet-pattern logic, collision, and state machines are actually readable once disassembled, unlike a big modern project where you walk in, hit hundreds of thousands of symbols, and immediately want to walk back out.
The Ghidra DB is the real core here. The most valuable thing about hand-done reverse engineering isn’t the final C code, it’s the semantics that get labeled in bit by bit: which offset is the player coordinate, which is the bullet array, which function handles hit detection. All of that lives in the database. Lose it and a whole crowd of people worked for nothing, so it makes sense they back it up separately. My fork is the same mindset: if the upstream ever disappears, I’ve still got a copy to compare against.
I didn’t add anything original. I treat it as a reference. Working against the upstream’s naming and structure, I run Ghidra alongside it, watch how they carve up functions, how they reconstruct structs, what granularity they match to, then go back and chew on the raw binary to verify I’m reading it right. What I learned most, actually, was the engineering habits: how to organize multi-person collaborative reversing, how to keep the annotations from turning into a pile of everyone-does-their-own-thing garbage.
If you want to use it, go to the upstream directly. That’s where the original docs, license, and issue history are. This fork is just a local backup. I don’t guarantee it stays in sync with upstream. The repo is here: th06-re