Owner confirmed the differing sizes/export counts/RVAs are just a different release of the same official game. Remove the "pending re-check against clean-release binary" / "contaminated install" caveats throughout and state those numbers (module sizes, export counts, gameMain RVA 0x9e20) as verified facts. Drop the stale 3,369,104-byte gamekdm figure in favor of the consistent 3.19 MB. Genuine format/behavior UNVERIFIED markers (undecoded .arc/.ifs/.ttc/etc. formats, Kinect dispatch/sync) are preserved.
5.8 KiB
DanceEvolution Arcade (DEA / gamekdm.dll) — game internals & RE jumpstart
Everything reverse-engineered about how DEA consumes the Microsoft NUI runtime, plus a
jump‑start so another agent can continue a full RE/decompilation without
redoing this work. All gamekdm addresses use image base 0x10000000.
Scope is the nine Konami modules in contents/modules/ and the official
assets/configuration in contents/, as listed in
docs/companion-inventory.md.
Kinect10.dll is only an external Microsoft NUI v1 runtime dependency of
gamekdm.dll, supplied by the platform.
The addresses, layouts, constants, and disassembly observations below concern
contents/modules/gamekdm.dll and contents/modules/libafp-win32.dll.
1. How DEA consumes the Kinect
gamekdm.dllimports the external MicrosoftKinect10.dllNUI v1 API. The game runs skeleton selection/validation and a Flash menu cursor (below).- The historical live-manager address is
*(gamekdm+0x3cf1b4).
2. Skeleton rendering & the selection/validity gate (solved)
For the in‑game skeleton to render, a candidate skeleton must pass the game's
orientation/validity gate, decoded from gamekdm:
FUN_10018570builds a gravity/floor‑relative transformM. If the gravity vector atmanager+0x2cis the sentinel,Mis derived from the skeleton's TRACKED joints (weighted ratio of tracked joints must exceed0.85, weightsDAT_102a49e8; then 5 limb‑direction dot‑products must each exceed0.9). FeedingvNormalToGravity = (0,1,0)populatesmanager+0x2cand takes the simpler gravity branch instead.FUN_100e4140 → FUN_101ab6d0is the candidate‑validity filter: it computesP1 = (-px, py + m13, -pz + m14)(no perspective divide) and accepts only ifP1is within0.05of the box[A-B, A+B]whereA = DAT_103d3230 = (0,1,0),B = (1.22, 1, 0.675)→ box x∈[-1.22,1.22], y∈[0,2], z∈[-0.675, 0.675].m13is taken straight from the skeleton frame'svFloorClipPlane.w.
3. The menu hand‑cursor (Flash/afp PhIZ) (solved)
This one is not in any DLL — it lives in the game's Flash runtime:
afpis a Flash/ActionScript runtime (libafp-win32.dllexportsflash.display.InteractiveObject,flash.ui.MouseCursor,useHandCursor). Menu UI (incl. the cursor sprite) is compiled Flash packed in the.ifsarchives undercontents/data/bm2d/*.ifs.- The moving cursor is the controller's own movie clip. gamekdm global
DAT_103d2bb8is the cursor‑controller object pointer; the live 1P cursor is at(*DAT_103d2bb8)+0x108/+0x10cand 2P at+0x110/+0x114, in screen pixels (1280×720).FUN_1007fbf0reads it viaafp_mc_get_param(ctrl+8, 0x1008)and snaps to the OK buttons (_but_ok_1p/2p_usr) whendist² < 0x1fa4(~90 UI units). The_icon_1p/2p/only_usrstrings are the OK‑button icons, not the cursor. - No gamekdm code writes the cursor from the hand (no
afp_mc_set_paramwith0x1008; 53 decompiled menu AS scripts reference no hand/cursor/natal). The hand→cursor PhIZ is inside the Flash/Natal runtime — a body‑relative, reach‑normalised mapping.
4. Two‑player
- The game supports 2P: dual cursor slots (
CUR1/CUR2above),NuiSkeletonSetTrackedSkeletons([id0, id1]), and NUI's 6 skeleton slots.
6. RE / decompilation jump‑start (for a fresh agent)
Everything you need to continue without redoing the groundwork:
Ghidra (gamekdm.dll)
- Analyse once into a persistent project, then reuse it (re‑analysing per run
wasted 3–5 min each):
JDK21 at
analyzeHeadless /home/athapa/ghidra gkproj -import gamekdm.dll # once, NO -deleteProject analyzeHeadless /home/athapa/ghidra gkproj -process gamekdm.dll -noanalysis -postScript <script.py>/home/athapa/jdk; scripts in/home/athapa/ghidra/scripts/(getFunctionContaining+decompileFunction). Full objdump at/tmp/gk.asm. - Key functions/globals (base
0x10000000): cursor controller globalDAT_103d2bb8; cursor readFUN_101d84c0→afp_mc_get_param(_,0x1008); button‑hitFUN_1007fbf0; cursor state machineFUN_1007e330; icon‑readerFUN_10080360; validity transformFUN_10018570; candidate filterFUN_100e4140/FUN_101ab6d0; validity boxDAT_103d3230, matrixDAT_103d4a80; manager pointer*(gamekdm+0x3cf1b4).
afp / Flash data (the cursor PhIZ lives here)
ifstools(pip, pure‑Python) extractsdata/bm2d/*.ifs→afp/<name>(Flash)afp/bsi/<name>(bytecode) +geo/+tex/.
- bemaniutils has the AFP ActionScript decompiler, but it is not on PyPI
and needs Python 3.12 (not 3.14) — install from git and import only the afp
parser (its
mysqlclient/server deps fail but aren't needed):Decompile a clip:git clone --depth 1 https://github.com/DragonMinded/bemaniutils /tmp/bemaniutils python3.12 -m pip install --break-system-packages Pillow pycryptodome cython PYTHONPATH=/tmp/bemaniutils python3.12 -c "from bemani.format.afp import SWF, ByteCodeDecompiler"SWF("<name>", open(afp,'rb').read(), open(bsi,'rb').read()),.parse(), then walkAP2DoActionTag.bytecode.decompile()(seebemani/utils/afputils.py decompile_and_write_bytecode). The menu scripts do not contain the hand→cursor map — it's in the Flash/Natal runtime — so next step islibafp-win32.dll(Ghidra projectafpproj, already analysed) around itsflash.ui.MouseCursor/ pointer handling.
Can't run the game here
Wine is not installed and the real cabinet/original-binary runtime needs DirectX + a real camera — iterate with the build→deploy→playtest loop, not an emulator. Deep‑low RE subagents repeatedly failed on this (armed a monitor and exited, then hit a 429 at ~2.1M tokens) — do the game RE directly with the local Ghidra setup.