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.
5.3 KiB
Companion DLL calling conventions
Regenerated by tools/gen_importlibs.sh into re/importlibs/. Convention and
binding mode for each companion, derived by disassembling gamekdm.dll's own
call sites against its Import Address Table (IAT): a call DWORD PTR ds:0x<iat>
followed by the caller popping the arguments itself (add esp,N, or the
callee returning with a plain ret while the caller already stacked a
compensating pop) is cdecl; a callee that returns with ret N and the caller
performs no stack fixup is stdcall. Full objdump excerpts and the gendef/dlltool
transcript are in .omo/evidence/gamekdm-decomp-linux/task-3.log.
The official release contains exactly nine Konami modules under
contents/modules/: libavs-win32.dll, libavs-win32-ea3.dll,
libafp-win32.dll, libafputils-win32.dll, ess.dll, libacio.dll,
arkkdm.dll, arkkdmtest.dll, and gamekdm.dll. Kinect10.dll is an
external Microsoft NUI runtime dependency of gamekdm.dll, not a shipped
companion. Addresses, ordinals, export counts, and file offsets below are
UNVERIFIED (pending re-check against clean-release binary) unless stated as
clean-release evidence.
| DLL | Convention | Evidence | Binding | --kill-at |
|---|---|---|---|---|
| libavs-win32.dll | cdecl | IAT 0x102183cc etc.: callers emit add esp,N after the call |
by name (vendor exports via synthetic hashed names, e.g. XCd229cc0000fb, not ordinal-only — confirmed in the DLL's own export name table, not just gendef's fallback) |
no |
| libavs-win32-ea3.dll | cdecl | same vendor build as libavs-win32.dll, same export-naming scheme (XE592acd...) |
by name | no |
| libafp-win32.dll | cdecl | IAT 0x10218304 (afp_display_layer) etc.: caller pops its own argument after the call |
by name | no |
| libafputils-win32.dll | cdecl (logger entry points are cdecl-varargs) | IAT 0x10218394/0x10218398/0x1021839c: caller issues one push per call and never relies on a callee ret N |
by name | no |
| ess.dll | cdecl | not called directly through gamekdm's IAT (no ess.dll import block in gamekdm.dll); follows the plain, undecorated C export convention shared by every other Konami companion in this build and never emits @N-decorated symbols |
by name | no |
| arkkdm.dll | stdcall | export ordinal 2, arkAFPBoot, RVA 0x52790: objdump -d on that RVA shows ret 0x4 at file offset 0x100527ca -- the callee pops its own stack frame, which only a stdcall (or fastcall) function does; gendef's arkAFPBoot@4 guess in the .def matches this disassembly exactly |
by name (the DLL's own export name table, objdump -p, stores arkAFPBoot undecorated, no @N; dlltool's decorated .def guess must have the @N stripped back off to bind to it) |
yes |
| libacio.dll | cdecl | not called directly through gamekdm's IAT; undecorated plain-C export names, same convention family as ess.dll |
by name | no |
arkkdmtest.dll and gamekdm.dll both export gameMain; the official
arkkdm.dll entry path resolves that cdecl entry by name. They are not import
libraries consumed by the reconstructed gamekdm.dll.
The external Microsoft Kinect10.dll uses stdcall. Its import-library binding
details remain external-platform integration, not part of the shipped
nine-module companion set.
--kill-at scope
Per i686-w64-mingw32-dlltool --help, -k/--kill-at "Kill @ from
exported names": it strips (removes) the @N stdcall decoration dlltool
would otherwise carry into the generated import name -- it does not add an
@N suffix, and it has no effect on calling convention at the ABI level (it
never retags a cdecl import as stdcall or vice versa). It is passed for
arkkdm.dll, the one shipped module in this set that is stdcall, because its
export table holds the plain, undecorated name arkAFPBoot rather than a
Name@N form -- gendef annotates every stdcall export it detects in the
.def with a guessed @N (correctly, in arkAFPBoot's case: @4), and
without --kill-at dlltool would emit an import-by-name entry like
arkAFPBoot@4 that does not exist in the DLL's real, undecorated export
table, so the import would fail to bind at load time. (The external
Kinect10.dll NUI runtime dependency gets the same --kill-at treatment for
the same reason, but it is not one of the nine shipped modules.) It is not
passed for the six cdecl companions (AVS, AVS-EA3, AFP,
AFPUtils, ESS, ACIO): their .def files carry no @N decoration for
dlltool to strip in the first place (gendef only annotates stdcall exports),
so --kill-at would be a no-op for them -- passing it was never the risk;
the reason to omit it is that cdecl imports have nothing for it to act on,
and AVS's logger entry points being cdecl-varargs rules out a fixed @N
byte count for them regardless.
Link proof
tests/importlibs/companion_link_test.c references one function from each
generated import library with its correct calling convention, cross-compiled
and linked into companion_link_test.dll. objdump -p on that DLL confirms
every import resolves to its real companion name (or Kinect10 ordinal), with
no unresolved symbols. A negative control removed one entry from
libafp-win32.def before rebuilding its import lib and relinking: the link
failed with an undefined reference to the removed symbol, proving the test
actually exercises the generated libraries rather than passing vacuously.
Transcript: .omo/evidence/gamekdm-decomp-linux/task-3.log.