Files
tdkpin/original/CALLBACK_RECONSTRUCTION.tsv
T
ddidderr 8b99e9607c feat(reconstruction): complete binary-backed C recovery
Replace the partial mechanics transcriptions with a separate, readable C11
reconstruction of the complete Win16 image while preserving the original raw
Ghidra export as immutable evidence. Cover all ordinary and overlapping entry
points, Borland runtime behavior, Win16 imports, segmented data, callbacks,
resources, indirect control flow, physics, rendering, persistence, and
startup/shutdown lifecycles.

Add deterministic extraction and audit tooling plus address-linked ledgers for
functions, imports, DGROUP ranges and objects, relocations, resources, and
callbacks. The final gate records zero raw, partial, restored, unknown,
blocked, or unclassified required units. Keep the semantic-fidelity boundary
explicit: the portable C is not claimed to reproduce a byte-identical Borland
NE build.

Add strict focused harnesses for every reconstructed C unit, exact resource
round-trip checks, and a 16-bit Borland Real48 reference probe. No Rust source
or Cargo metadata is changed in this phase.

Test Plan:
- `bash original/tools/test_reconstructed_c.sh` -- passed
- `bash original/tools/probe_real48_reference.sh` -- passed bit-for-bit
- `python3 original/tools/audit_reconstruction.py --require-complete` -- passed
- `git diff --cached --check` -- passed
- `git diff HEAD -- '*.rs' Cargo.toml Cargo.lock` -- empty
2026-08-23 16:41:17 +02:00

3.4 KiB

1registration_siteregistering_functionapistatusstagecallback_addresscallback_namelifetimeevidencenotes
21008:2593FUN_1008_2554REGISTERCLASSverifiedstatic-wndclass1008:2219tpwincrt_window_procRegistered once for the process-wide TPWinCrt class when DGROUP 06fc is zero.DGROUP relocation 0564 -> TFLIPPK export ordinal 119 (1008:2219); WNDCLASS16 begins at 1028:0562; class name pointer 1028:0578 -> TPWinCrt.The 10-byte far callback has the exact WNDPROC16 stack shape and dispatches known window messages before DefWindowProc16.
31008:297bFUN_1008_295cSYSTEMTIMERMAKEverifiedcompanion-timer-callbackMMTIMER.DLL 1000:0002mmtimer_post_message_callbackInstalled by each SystemTimerMake call and removed through timeKillEvent16 using the returned timer id.MMTIMER.DLL export 1 at 1000:0039 and callback disassembly at 1000:0002; TDK wrapper 1008:295c.SystemTimerMake receives HWND, delay, resolution, and one-shot flag; its internal timeSetEvent16 callback posts message 0x0580 to that HWND.
41008:2ab1FUN_1008_2a45CREATEDIALOGPARAMverifieddynamic-object-thunkdynamic thunk -> 1018:0133object_dispatch_window_or_dialog_procA 7-byte bound-object thunk is allocated from the verified 256-byte pool by 1018:01dc and returned by 1018:02fa during 1018:03ff destruction.CreateDialogParam16 push sequence at 1008:2a8f-2ab1; object callback fields +12/+14; verified dispatcher 1018:0133; reconstructed/tests/test_bound_thunks.c and test_message_dispatch.c.The callback argument is the bound thunk, not template fields +1d/+1f. Exact HWND/message/WPARAM/LPARAM record construction, dynamic VMT dispatch, and returned LRESULT are verified.
51008:2b64FUN_1008_2ae3DIALOGBOXPARAMverifieddynamic-object-thunkdynamic thunk -> 1018:0133object_dispatch_window_or_dialog_procA 7-byte bound-object thunk is allocated from the verified 256-byte pool by 1018:01dc and returned by 1018:02fa during 1018:03ff destruction.DialogBoxParam16 push sequence at 1008:2b42-2b64; object callback fields +12/+14; verified dispatcher 1018:0133; reconstructed/tests/test_bound_thunks.c and test_message_dispatch.c.The modal and modeless dialog paths use the same object-bound dispatcher with exact message-record and LRESULT semantics; owner preservation remains accounted in the enclosing function ledger.
61018:0e86FUN_1018_0e46REGISTERCLASSverifiedclass-bootstrap-wndproc1018:018bobject_window_bootstrap_procVerified class-registration function 1018:0e46 first checks GetClassInfo, builds exact WNDCLASS16 only when absent, and registers bootstrap 1018:018b.Four VMT occurrences place 1018:0e46 at slot +0x1c; relocations 1018:12e1/12e4 select NE entry 211; class-registration and bootstrap-transition tests cover both sides.All concrete paths transition from verified bootstrap WNDPROC16 1018:018b to verified object-bound dispatcher 1018:0133; the abstract variant terminates through verified Runtime Error 211.
71018:1ac7FUN_1018_1a61MAKEPROCINSTANCEverifiedshared-dispatch-proc-instance1018:0133object_dispatch_window_or_dialog_procCreated once into verified DGROUP 0672:0674 by 1018:1a61 and released by FreeProcInstance16 in verified 1018:1b08.MAKEPROCINSTANCE relocation resolves FFFF:FFFF to NE entry 210 (1018:0133); verified application lifecycle, thunk pool, and message-dispatch tests.This process-wide proc instance is copied into each generated bound-object thunk; its complete stack record, hook, dynamic-handler, and LRESULT behavior are now address-linked readable C.