Skip to content

feat(cli,analyzer): add disasm/jump-table/batch tooling and fix indexed dispatch & incremental hints - #8

Merged
mikolas merged 1 commit into
masterfrom
feat/analyzer-and-cli-improvements
Oct 29, 2026
Merged

mikolas merged 1 commit into
masterfrom
feat/analyzer-and-cli-improvements

Conversation

@mikolas

@mikolas mikolas commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • CLI & Inspection Tooling

    • Add hunks disasm <target> [-n <insts>] [--len <bytes>] [--try-code] (alias d) and hunks data --try-code for bounded disassembly and speculative M68000 instruction preview over DATA bytes without mutating the DB.
    • Add hunks hint jump-table <table_addr> [count] [--base <base_addr>] [--count <N>] [--entry-size 2|4] to mark 16-bit/32-bit signed relative offset tables (Target-Base) and seed all target handlers as CODE.
    • Add hunks label delete <target>... and hunks rename --delete <target>....
    • Add batch/multi-target support (--batch / -f / --file and multi-address hint code) across hint, operand, rename, comment, and abi.
    • Support seg:0xOFFSET / seg:$OFFSET target resolution without requiring +, and prevent cross-segment fallback when an explicit segment prefix is given.
    • Format negative stack-frame struct offsets cleanly in hunks struct list (e.g. -220 (-$DC) rf_NormTablePtr.l) and accept saved input registers in hunks abi --verify.
    • Fix workspace module discovery when invoked from inside work/.
  • Call Graph & Analyzer Fixes (Zero DB Schema Changes)

    • Prioritize ia >= entryAddr in callgraph.traceFunction so backward-branched blocks below entryAddr do not prematurely terminate caller instruction discovery.
    • Isolate AnalyzeIncremental (isIncremental := codeCells.Len() > 0) to seed dataReadTargets from SQLite DATA_READ/DATA_WRITE xrefs and skip whole-binary relocation/gap/prologue sweeps.
    • Walk the hinted basic block in applyCodeHintsBatch to clear overlapping cells across full instruction widths and remove non-self interior labels and stale incoming edges/xrefs.
    • Update resolveJumpTable and scanIndexedJumpTable to distinguish direct JMP/JSR d8(PC,Xn) code dispatch from dc.w offset tables and to resolve negative-offset (firstWord < 0) PC-relative jump tables.

Verification

  • go build ./..., go vet ./..., and go test -v ./... pass with 0 warnings.
  • Verified 100% load-image parity (scripts/verify_parity.py) on 13-hunk frontier and 100% byte-for-byte parity (cmp -l) on disk.1.

…ed dispatch & incremental hints

- Add 'hunks disasm' (alias 'd') and 'hunks data --try-code' for bounded and speculative instruction decoding
- Add 'hunks hint jump-table' and multi-target/batch mode ('--batch'/'-f') across hint, operand, rename, comment, and abi
- Add 'hunks label delete' and 'hunks rename --delete'
- Support 'seg:0xOFFSET' target resolution without '+' and prevent cross-segment fallback on explicit segment prefixes
- Format negative stack-frame struct offsets cleanly in 'struct list' and accept saved input registers in 'abi --verify'
- Prioritize forward addresses in callgraph traceFunction so backward branches do not truncate callers
- Isolate AnalyzeIncremental from whole-binary gap sweeps and clear interior labels/edges along hinted basic blocks
- Distinguish direct EAPCIndex/EAIndex code dispatch from relative word-offset jump tables and support negative table offsets
@mikolas
mikolas merged commit c251859 into master Oct 29, 2026
8 checks passed
@mikolas
mikolas deleted the feat/analyzer-and-cli-improvements branch October 29, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant