Repository navigation
feat(cli,analyzer): add disasm/jump-table/batch tooling and fix indexed dispatch & incremental hints - #8
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLI & Inspection Tooling
hunks disasm <target> [-n <insts>] [--len <bytes>] [--try-code](aliasd) andhunks data --try-codefor bounded disassembly and speculative M68000 instruction preview overDATAbytes without mutating the DB.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 asCODE.hunks label delete <target>...andhunks rename --delete <target>....--batch/-f/--fileand multi-addresshint code) acrosshint,operand,rename,comment, andabi.seg:0xOFFSET/seg:$OFFSETtarget resolution without requiring+, and prevent cross-segment fallback when an explicit segment prefix is given.hunks struct list(e.g.-220 (-$DC) rf_NormTablePtr.l) and accept saved input registers inhunks abi --verify.work/.Call Graph & Analyzer Fixes (Zero DB Schema Changes)
ia >= entryAddrincallgraph.traceFunctionso backward-branched blocks belowentryAddrdo not prematurely terminate caller instruction discovery.AnalyzeIncremental(isIncremental := codeCells.Len() > 0) to seeddataReadTargetsfrom SQLiteDATA_READ/DATA_WRITExrefs and skip whole-binary relocation/gap/prologue sweeps.applyCodeHintsBatchto clear overlapping cells across full instruction widths and remove non-self interior labels and stale incoming edges/xrefs.resolveJumpTableandscanIndexedJumpTableto distinguish directJMP/JSR d8(PC,Xn)code dispatch fromdc.woffset tables and to resolve negative-offset (firstWord < 0) PC-relative jump tables.Verification
go build ./...,go vet ./..., andgo test -v ./...pass with 0 warnings.scripts/verify_parity.py) on 13-hunkfrontierand 100% byte-for-byte parity (cmp -l) ondisk.1.