Reference only the official KDM-2016021900 game: the 9 Konami modules in contents/modules/ plus data/arkdata/prop. Remove community/PC-hardware glue (deahook/DEALibacio, spice2x/spicetools, launcher.exe, gamestart.bat, bemanitools, NVENC/CUDA stubs) and non-release modules (kmd/ksm/kuc/libinput/ libacio_mbr) as game evidence. Correct the "22-DLL" framing to the real 9-module set; reframe the boot chain on arkkdm.dll's own dll_entry_init/ dll_entry_main -> gameMain binding. Kinect10.dll referenced only as gamekdm's external Microsoft NUI runtime dependency. Fix ea3-config.xml -> eamuse-config.xml. Per-byte sizes/RVAs from the earlier contaminated install marked UNVERIFIED pending re-check against the clean-release binary.
kdm-re
A reverse-engineering and reconstruction project for DanceEvolution Arcade
(DEA) — a Konami arcade Kinect dance game whose game logic ships as
gamekdm.dll (internal engine/module codename KDM). The goal is to rebuild
gamekdm.dll's observable behavior from static and dynamic analysis of the
shipped binary, one function at a time, each proven behaviorally equal to the
original before it is shipped.
Behavioral, not byte-identical. Given the same inputs, the reconstruction aims to produce the same outputs and global-state effects as the original — proven function-by-function — not to reproduce the original machine code. The toolchain (MinGW/GCC, i686) differs from the original's (MSVC/VS2010 SP1) by construction.
What the game is
DEA is a Konami arcade dance game driven by a Kinect sensor: the player dances
in front of a depth camera and the game scores the match between the tracked
body pose and the choreography. It targets Win32 x86 on Konami's AVS2
middleware stack, with the ARK cabinet engine (arkkdm.dll) and
e-Amusement v3 networking. The game analyzed throughout is the clean
KDM-2016021900 release. The main logic DLL, gamekdm.dll (PE32 x86),
exports a single symbol, gameMain (RVA 0x00009e20, cdecl), and contains
9,728 functions tracked in re/rvadb.json.
Official scope
The spec and reverse engineering reference only the official game — the
clean release's contents/ tree: its asset/config trees (data/,
arkdata/, prop/) and exactly 9 Konami modules in contents/modules/:
libavs-win32.dll, libavs-win32-ea3.dll, libafp-win32.dll,
libafputils-win32.dll, ess.dll, libacio.dll, arkkdm.dll,
arkkdmtest.dll, gamekdm.dll. Community or PC-hardware glue that may appear
in a non-clean install — launcher.exe, deahook.dll, spice2x/bemanitools,
NVENC/CUDA stubs, a Kinect shim, and non-release Konami modules — is not
part of the game and is not used as evidence. Kinect10.dll (Microsoft's
Kinect-for-Windows NUI runtime) is referenced only as an external dependency
that gamekdm.dll's import table requires, never as a shipped game module.
See docs/companion-inventory.md.
Repository layout
| Path | What it holds |
|---|---|
docs/spec/ |
The full technical specification — start here (see below). |
docs/ |
Process docs: companion-inventory.md, conventions.md, pipeline.md, reconstruction-loop.md, cutover.md, provenance.md. |
src/, include/ |
The hand-reviewed MinGW C/C++ reconstruction, layered by subsystem (game, gs, render, movie, particle, mm, ui, util, platform, hybrid, pure, entry). |
re/ |
The RVA function database (rvadb.json, 9,728 records), pure-slice-status.json, import libs, and AVS notes. |
tools/ |
unicorn_diff/ (the differential verifier), ghidra/ helpers, gen_importlibs.sh. |
tests/ |
Golden-I/O fixtures, import-lib checks, smoke tests. |
cmake/ |
toolchain-mingw-i686.cmake (cross toolchain file) and check_pure_coverage.py (the fail-closed coverage gate). |
activate.sh |
Sources the pinned no-sudo i686-w64-mingw32 cross toolchain + wine onto PATH. |
toolchain.lock |
Exact toolchain provenance (nixpkgs rev, package versions, store paths). |
orig/, export/, bin/ |
Gitignored originals drop zone, the hand-authored gamekdm.def, and the activate.sh-generated tool aliases. |
Specification
The authoritative, fully-cited technical spec lives in docs/spec/.
Every claim in it is grounded in a real artifact (a file:line, an RVA, an
objdump listing, or a game-dir path); anything unverifiable is marked
UNVERIFIED. Sections:
- 00 — Overview and high-level architecture
- 01 — Runtime environment and boot/startup chain
- 02 — DLL architecture and dependency graph
- 03 — Kinect input and skeleton pipeline
- 04 — Player validity gate and menu hand cursor
- 05 — Data formats
- 06 — gamekdm.dll subsystem map
- 07 — Companion DLL API surfaces
- 08 — ABI, calling conventions, and struct layouts
- 09 — The kdm-re reconstruction codebase
Build
The build targets a 32-bit Windows DLL and never touches system packages —
it uses a pinned, no-sudo i686-w64-mingw32 cross toolchain plus wine, sourced
onto PATH by activate.sh.
source ./activate.sh # must be sourced, not executed
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-i686.cmake
cmake --build build
i686-w64-mingw32-objdump -p build/gamekdm.dll | grep -A6 'Export Address Table'
Output is build/gamekdm.dll, a PE32 (i386) DLL.
Build modes
- Hybrid (default) — builds
gamekdm.dllas a shared proxy plus the detour static library; reconstructed functions override the original where proven. - PURE (
-DBUILD_PURE=ON) — links/loads no original DLL at all. A fail-closed coverage gate (cmake/check_pure_coverage.py) runs at configure time and before every build; in full mode it demands 100%verifiedstatus across the call graph. - PURE slice (
-DBUILD_PURE=ON -DPURE_SLICE=ON) — builds only the verified slice with explicit stubs for the remainder.
Verification
Each reconstructed function is proven behaviorally equal to the original before it ships:
- Unicorn differential (
tools/unicorn_diff/) emulates the real routine inside the shippinggamekdm.dllas the oracle, runs the compiled C++ reconstruction under wine on the same inputs, and asserts behavioral equality, with an injected-bug non-vacuity check. - Golden I/O fixtures under
tests/golden/. - Detours are gated by an ownership allowlist: only
pod_onlyfunctions may hot-patch the original image;shared_mutable_globalsandforeign_object_abifunctions are blocked even when verified.
Status
Reconstruction is early and explicitly tracked. As of this writing,
re/rvadb.json records 1 of 9,728 functions as verified, and the
subsystem map classifies ~2.7% of functions into named subsystems by design
(positive-evidence-only). The runtime cutover path exists as a mechanism but
is deliberately gated and incomplete. Treat any claim about "what
a function does" beyond one explicitly reconstructed, decompiled, or cited to a
disassembly as unestablished.
Scope and license
- No copyrighted creative asset (song audio, video, lyrics, or art) is reproduced anywhere in this repository or spec. Only file/container formats, directory structure, and code behavior are described.
- Original game binaries are not committed; see
docs/provenance.mdfor origin and handling. - This repository is private and unlicensed — see
LICENSE. No rights to use, copy, modify, or distribute any part of it are granted; the final license (if any) has not been decided.