Files
tdkpin/original/DECOMPILATION.md
T
ddidderr 9d91cc51c7 feat(reverse): ledger every initialized game object
Add a reproducible dump of all 175 initialized collision and rule records from
the unmodified traceable Wine process. Preserve geometry, bounds, activation,
all four decoded Borland Real48 response values, flags, contact state, score,
layer mask, and render rectangle in a reviewable TSV.

This extends the static function ledger with the runtime-built data table needed
to replace inferred target, lock, gate, and mechanism logic in Rust.

Test Plan:
- generated `OBJECTS.tsv` contains one header plus 175 records
- repeat dump compared byte-for-byte equal with `cmp`
- `ruff check` on all original tracing tools -- passed
- `git diff --cached --check` -- passed
2026-08-22 21:07:18 +02:00

2.9 KiB

TDKPIN.EXE decompilation

Target

  • File: TDKPIN.EXE
  • SHA-256: a9022f1894e3e6e21fc42e8f6c932f7c549ca77f63aaa0c488bb9d55d9d0174c
  • Format: Windows 3.x New Executable (NE), 16-bit protected-mode x86
  • NE entry point: segment 1, offset fd85 (Ghidra address 1000:fd85)
  • Image: five executable segments, one data segment, and 63 resource blocks
  • Companion import: MMTIMER.DLL

The executable contains a Borland runtime copyright string, but it does not retain useful original function or variable names. The FUN_... and DAT_... names in the output are therefore analysis-generated identifiers.

Outputs

  • TDKPIN_GHIDRA_RAW.c: C-like Ghidra output for every recovered in-image function.
  • FUNCTIONS.tsv: address ledger separating in-image functions from imported APIs.
  • COVERAGE.tsv: executable-block, instruction, function-body, and undefined-range audit.
  • OBJECTS.tsv: all 175 initialized collision/rule records, including geometry, Real48 response values, flags, layers, scores, and render bounds.
  • tools/ExportDecompilation.java: deterministic decompiler exporter.
  • tools/SeedMissingEntrypoints.java: seeds one missed NE export and the NE startup entry.
  • tools/AuditCoverage.java: regenerates the byte-coverage audit.
  • tools/decompile.sh: runs the import, repair, export, and audit from scratch.
  • tools/dump_original_objects.py: regenerates the initialized object ledger from a traceable Wine process without patching the executable.

Accounting

  • 301/301 NE exported entry points have corresponding in-image functions.
  • 62 additional internal/startup functions were recovered.
  • 363 in-image functions were submitted to the decompiler.
  • 363 produced C-like output; none returned a decompiler failure.
  • 292 imported Win16 APIs are recorded separately and are not represented as fake bodies.
  • 91,332/93,064 executable-segment bytes (98.14%) are instructions in recovered function bodies.
  • 1,730 executable-segment bytes remain undefined. Most are islands in the runtime-heavy fifth segment and may include embedded tables or alignment, but they have not been fully classified.

Ghidra's initial NE analysis missed export ordinal 10 at 1000:eab1 and the program entry at 1000:fd85. Both were verified as code from the image bytes, explicitly disassembled, and included in the final output.

Fidelity boundary

TDKPIN_GHIDRA_RAW.c is a decompilation artifact, not recovered original source and not yet a buildable replacement. In particular, Ghidra still emits guessed parameter lists, generic data types, unnamed globals, and several warnings around segmented pointers, stack tracking, and one indirect jump table. The source has not been executed against Windows 3.x or compared differentially with the original program. Consequently, the current result establishes broad static code coverage, not source-level semantic parity or a reproducible binary build.