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

8 lines
3.4 KiB
Plaintext

registration_site registering_function api status stage callback_address callback_name lifetime evidence notes
1008:2593 FUN_1008_2554 REGISTERCLASS verified static-wndclass 1008:2219 tpwincrt_window_proc Registered 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.
1008:297b FUN_1008_295c SYSTEMTIMERMAKE verified companion-timer-callback MMTIMER.DLL 1000:0002 mmtimer_post_message_callback Installed 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.
1008:2ab1 FUN_1008_2a45 CREATEDIALOGPARAM verified dynamic-object-thunk dynamic thunk -> 1018:0133 object_dispatch_window_or_dialog_proc A 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.
1008:2b64 FUN_1008_2ae3 DIALOGBOXPARAM verified dynamic-object-thunk dynamic thunk -> 1018:0133 object_dispatch_window_or_dialog_proc A 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.
1018:0e86 FUN_1018_0e46 REGISTERCLASS verified class-bootstrap-wndproc 1018:018b object_window_bootstrap_proc Verified 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.
1018:1ac7 FUN_1018_1a61 MAKEPROCINSTANCE verified shared-dispatch-proc-instance 1018:0133 object_dispatch_window_or_dialog_proc Created 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.