4.5 KiB
JP Semantic-Gap Investigation Handoff
Date: 2026-10-12
Resume Context
- Workspace:
Crusader_Decomp - Live Ghidra target:
/ja/CRUSADER.EXE, image base00400000 - Main ledger and active backlog: JP decompilation progress, under
Semantic-Gap Analysis CheckpointandNext Work - Coverage script:
tools/jp_executable_documentation_report.py
The user asked to investigate five semantic-gap areas and add follow-up tasks to the JP ledger. That static pass is recorded in the progress document. The current investigation made no Ghidra database edits, saved no Ghidra state, and changed no executable bytes. Any pre-existing pending Ghidra changes were left untouched.
Verified Baseline
The latest read-only coverage report for the active JP program reports:
- Function entries tracked:
1,493 / 1,493(100%); untracked:0; generated names:0 - Function-body coverage:
336,693 / 499,712bytes (67.4%) - Defined-instruction coverage:
399,698 / 499,712bytes (80.0%) - Executable bytes outside defined instructions:
100,014; these may be data, padding, or unanalyzed code - Five ledger table addresses are not function entries:
004811f3,004811f9,00481200,00481208,0048120d
Do not treat the remaining byte percentage or those five table addresses as proof of missing functions.
Findings So Far
- Action dispatch: selectors
0,4,0x21,0x39, and0x3ball construct a type-0xf0process throughprocess_0x0f0_construct_for_item, then install distinct callback tables. The selector callbacks still need semantic names. - Attack process: type
0x259is constructed byAttackProcess_0040af20. Theprocess_choose_direction_to_coords0xffpath checks a nonzero+0x64value, shape overlap, and a packed-position query before dispatching selector0; the meanings ofDAT_0047b1d6,+0x64, and process byte+0x7dremain open. - Cache and records: the keyed cache has ten rotating key slots and 256 entry pointers per slot. The 16-bit key is looked up at file offset
key * 4; descriptor low byte+4controls count and bit0x40at+7selects0x40/0x80bytes per entry. The pair reader copies two dwords. The separate 16-byte item snapshot layout is mapped in the progress ledger; the main item table has stride0x79. - Animation and spatial search: AnimationProcess uses type
0x230and vtable0047e7a8; its constructor clears+0x52, and a helper sets it to one. Its sole caller,00411fcd, is code with no owning Ghidra function. The spatial grid uses 64 two-byte cells per0x80-byte row; selector coordinates step by0x200and use>> 9for grid indexing. - Input and presentation: joystick actions
4-8emitu/g/s/m/e; action9maps directions toq/w/i/o; process byte+0x62selects distinct handling. Startup dialog resource0x71opens only for positive direction flags; a zero dialog result aborts startup. The DirectDraw lock helper has no restore branch. The debug timeline helper's sole caller is unowned code at00455bb6. - Boundaries/debug:
00411fcdand00455bb6are confirmed call sites but have no containing function. The timeline consumer/fields and writer forDAT_004955e8remain unresolved.
No runtime test of the joystick dialog or presentation paths was performed, and no JP/Western semantic comparison was made.
First Steps Tomorrow
- Open or confirm the live
/ja/CRUSADER.EXEtarget before using Ghidra MCP. Use MCP-only analysis; do not use the offline PyGhidra CLI. - Read the
Semantic-Gap Analysis CheckpointandNext Worksections in the JP decompilation progress ledger. - Start with boundary triage around
00411fcdand00455bb6: inspect surrounding disassembly, control flow, and references to determine whether each belongs to a larger routine. Do not create or name a function until bounds are supported. - Continue with the prioritized backlog in the ledger: action callback/type-
0x259contracts, cache and field semantics, animation/spatial details, then joystick/dialog/DirectDraw/debug-timeline paths. - Re-run the read-only coverage script when useful to confirm the exact-entry baseline. Leave Ghidra project saving to the user and never patch bytes in the reference executable.
Worktree Note
docs/jp-remorse-decompilation-progress.md was already locally modified before this investigation. Those existing edits were preserved; this work updated the bottom checkpoint/backlog and corrected its heading structure. The current changes have not been committed.