Files
kdm-re/docs/spec/02-dll-architecture.md
T
ulw-execute a176c63736 docs: scope spec + RE to the official clean release only
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.
2026-11-28 20:37:18 -05:00

10 KiB

DLL Architecture and Module Dependency Graph

This section documents exactly 9 Konami modules shipped under contents/modules/ in the clean KDM-2016021900 release. All 9 are in reconstruction scope. External platform runtimes are import targets only. The inventory and cross-DLL dependency DAG follow the official-scope contract and the corrected companion-inventory.md.

Evidence basis: module sizes come from the clean-release listing in the contract's "Official modules" table. The shipped-module topology follows the companion inventory's "Cross-module dependency DAG" and the contract's "Official dependency graph", which describe the official modules' PE imports. This revision does not claim a new objdump run. Earlier measurements came from a possibly contaminated install; any retained export counts are UNVERIFIED (pending re-check against clean-release binary). Exact byte sizes and RVAs from that install are not used here.

Scope classification

  • IN-SCOPE — Konami-authored game/middleware code targeted for decompilation and reconstruction: all 9 modules in the table below.
  • REUSE OS — a Win32/DirectX/CRT system DLL that is only ever an import target (never shipped as a file under contents/): KERNEL32.dll, USER32.dll, GDI32.dll, ADVAPI32.dll, SHELL32.dll, ole32.dll, WS2_32.dll, WINMM.dll, IMM32.dll, DINPUT8.dll, DSOUND.dll, IPHLPAPI.DLL, PSAPI.DLL, msvcrt.dll/MSVCR80.dll, OLEAUT32.dll, dbghelp.dll, HID.DLL, SETUPAPI.dll, d3d9.dll, d3dx9_43.dll.
  • EXTERNAL RUNTIME — Kinect10.dll, the Microsoft Kinect-for-Windows NUI v1 runtime required by gamekdm.dll's import table. It is supplied by the platform, not shipped in contents/modules/ and not in the reconstruction set. See the companion inventory's external dependencies.

Per-DLL table (all 9 shipped Konami modules)

Each DLL below resides in contents/modules/. Sizes and roles follow the contract's clean-release table and the companion inventory's per-module table. Named-export counts are retained solely as historical measurements, not verified clean-release facts; each requires a new check against its official binary. No new export counts have been inferred from the listing sizes.

DLL Size (clean release listing) Scope Named exports (historical) Role
libavs-win32.dll 505.14 KB IN-SCOPE 360 — UNVERIFIED (pending re-check against clean-release binary) AVS2 core middleware: property-tree configuration, virtual filesystem and threading; base of the main middleware stack.
libavs-win32-ea3.dll 364.14 KB IN-SCOPE 139 — UNVERIFIED (pending re-check against clean-release binary) E-amusement v3 AVS2 extension for network, identity and coin economy.
libafp-win32.dll 1.19 MB IN-SCOPE 159 — UNVERIFIED (pending re-check against clean-release binary) AFP asset/font/graphics pipeline used by ARK.
libafputils-win32.dll 165.64 KB IN-SCOPE 162 — UNVERIFIED (pending re-check against clean-release binary) AFP utilities directly above libafp-win32.dll.
ess.dll 376.14 KB IN-SCOPE 209 — UNVERIFIED (pending re-check against clean-release binary) ESS e-amusement shop/server middleware; depends on AVS2 and its ea3 extension.
libacio.dll 224.64 KB IN-SCOPE 44 — UNVERIFIED (pending re-check against clean-release binary) ACIO cabinet I/O protocol library; root with only USER32/KERNEL32 imports.
arkkdm.dll 896.64 KB IN-SCOPE 255 — UNVERIFIED (pending re-check against clean-release binary) ARK/KDM cabinet game engine and AVS2 game-DLL entry; loads and calls gamekdm.dll.
arkkdmtest.dll 389.14 KB IN-SCOPE 1 — UNVERIFIED (pending re-check against clean-release binary) ARK/KDM render/input test harness; exports gameMain; imports OS D3D9/DINPUT8/DSOUND/GDI32/SHELL32/USER32 without AVS2.
gamekdm.dll 3.19 MB IN-SCOPE 1 — UNVERIFIED (pending re-check against clean-release binary) Main KDM game logic; exports gameMain; primary reconstruction target.

Cross-DLL dependency DAG

The shipped-module DAG has exactly 9 nodes and 14 edges. Each solid edge points from an importing module to a shipped dependency, following the canonical graph. OS/DirectX imports are outside this DAG. The dashed edge from gamekdm.dll to Kinect10.dll is an external Microsoft NUI runtime dependency; its endpoint is an annotation, not a tenth shipped-module node.

libavs-win32.dll        (root)
libacio.dll             (root; imports USER32/KERNEL32 only)
arkkdmtest.dll          (root; imports OS D3D9/DINPUT8/DSOUND/GDI32/SHELL32/USER32 only)
libavs-win32-ea3.dll  -> libavs-win32.dll
libafp-win32.dll      -> libavs-win32.dll
libafputils-win32.dll -> libavs-win32.dll, libafp-win32.dll
ess.dll               -> libavs-win32.dll, libavs-win32-ea3.dll
arkkdm.dll            -> libavs-win32.dll, libavs-win32-ea3.dll, ess.dll, libacio.dll, libafp-win32.dll
gamekdm.dll           -> libavs-win32.dll, libafp-win32.dll, libafputils-win32.dll
                         (+ external Kinect10.dll, d3d9/d3dx9)
graph TD
  libavs_win32_dll["libavs-win32.dll"]
  libavs_win32_ea3_dll["libavs-win32-ea3.dll"]
  libafp_win32_dll["libafp-win32.dll"]
  libafputils_win32_dll["libafputils-win32.dll"]
  ess_dll["ess.dll"]
  libacio_dll["libacio.dll"]
  arkkdm_dll["arkkdm.dll"]
  arkkdmtest_dll["arkkdmtest.dll"]
  gamekdm_dll["gamekdm.dll"]
  kinect(("Kinect10.dll (external MS NUI runtime)"))
  libavs_win32_ea3_dll --> libavs_win32_dll
  libafp_win32_dll --> libavs_win32_dll
  libafputils_win32_dll --> libavs_win32_dll
  libafputils_win32_dll --> libafp_win32_dll
  ess_dll --> libavs_win32_dll
  ess_dll --> libavs_win32_ea3_dll
  arkkdm_dll --> libavs_win32_dll
  arkkdm_dll --> libavs_win32_ea3_dll
  arkkdm_dll --> ess_dll
  arkkdm_dll --> libacio_dll
  arkkdm_dll --> libafp_win32_dll
  gamekdm_dll --> libavs_win32_dll
  gamekdm_dll --> libafp_win32_dll
  gamekdm_dll --> libafputils_win32_dll
  gamekdm_dll -.external.-> kinect

The internal graph is acyclic. A dependency-first topological order, matching the companion inventory's reconstruction order, is libavs-win32.dll, libavs-win32-ea3.dll, ess.dll, libacio.dll, libafp-win32.dll, libafputils-win32.dll, arkkdm.dll, arkkdmtest.dll, then gamekdm.dll.

Runtime loading is separate from these PE import edges: the official arkkdm.dll exports dll_entry_init / dll_entry_main for AVS2. Its dll_entry_main uses LoadLibraryA("gamekdm.dll") with an "arkkdmtest.dll" test-build fallback, resolves gameMain with GetProcAddress, and calls gameMain(hInstance) (cdecl). The argument is arkkdm.dll's own HINSTANCE, captured in DllMain and relayed through g_MainDllInfo.dllHMODULE. These facts are sourced to the official arkkdm.dll in the contract's "Official boot/entry" and the companion inventory's boot/entry section.

libavs-win32.dll as the AVS2 base

libavs-win32.dll is the base of the main middleware stack, with zero shipped-module imports. Six other modules import it directly: libavs-win32-ea3.dll, libafp-win32.dll, libafputils-win32.dll, ess.dll, arkkdm.dll, and gamekdm.dll. The remaining two modules, libacio.dll and arkkdmtest.dll, also have zero shipped-module imports. Thus AVS2 is one of three roots, not a dependency of every module, as shown by the canonical graph's explicit edges.

libafp -> libavs edge

libafp-win32.dll's only shipped-module import is libavs-win32.dll, as recorded in both authoritative dependency graphs. It is consumed by libafputils-win32.dll, arkkdm.dll, and gamekdm.dll.

gamekdm dependencies

gamekdm.dll imports three shipped modules: libavs-win32.dll, libafp-win32.dll, and libafputils-win32.dll. It does not depend on every shipped module. Its external dependencies include Kinect10.dll (Microsoft NUI v1) and OS DirectX d3d9.dll/d3dx9_43.dll, as documented in the contract and companion inventory. Those runtimes are supplied by the platform and do not enlarge the nine-module reconstruction set.

Reconciliation with companion-inventory.md

The corrected companion inventory and the official-scope contract define this chapter's evidence boundary:

  • Exactly 9 modules under contents/modules/ are shipped, Konami-authored, and IN-SCOPE; the table uses their clean-release listing sizes.
  • The internal DAG reproduces the canonical 9 nodes and 14 edges. The explicitly external gamekdm.dll to Kinect10.dll NUI runtime edge is excluded from those counts.
  • libacio.dll and arkkdmtest.dll are independent roots alongside AVS2. The explicit topology controls here; the companion inventory's prose calling AVS2 an ancestor of every module overstates that topology.
  • Historical export counts remain UNVERIFIED (pending re-check against clean-release binary). They are not new measurements of the official artifacts; clean-release binary re-checks remain necessary before relying on them.

This chapter presents the corrected official inventory at spec level.

See also