From ad22cf5beb0588c8f454bebfa0cc7c7897e4e7a3 Mon Sep 17 00:00:00 2001 From: blasty Date: Wed, 22 Jul 2026 23:21:16 +0200 Subject: app: non-function regions — open a flat listing + c/p/u edit verbs (M0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Navigating to an address not inside a function no longer refuses ("no function contains X"): _do_navigate now opens a region view (flat listing anchored at the EA, forced to disasm since there's no pseudocode). The server's no-function disasm already walks heads to the segment end, so DisasmModel is reused as-is; NavEntry gains is_region. Adds the IDA c/p/u structure-edit verbs on the disasm view: c = define_code (undefine-first, since create_insn won't carve a live item) p = define_func u = undefine wired via EditItemRequested -> _do_edit_item worker -> Program.define_code/ define_func/undefine. define_func upgrades the region to a real function view in place. New Program.bump_items() invalidates the item/function structure caches (disasm blocks, decomp, function indices + name gen) — broader than bump_names(), which only covers renames. Pilot: new `region_define` scenario undefines a small function, navigates to the bare region via the 'g' prompt (asserts it opens, not refused), then 'p' recreates the function and upgrades the view; restores the IDB in a finally. 107 passed / 1 pre-existing flaky (filter, fails on baseline). --- TODO | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'TODO') diff --git a/TODO b/TODO index d9245e1..a1ff814 100644 --- a/TODO +++ b/TODO @@ -15,8 +15,13 @@ doable: hard: [ ] deal with PLT stubs and such (oh god here we go) -[ ] how to deal with non-function-body regions? - -> we want to be able to do data/type definitions in .data etc. +[~] how to deal with non-function-body regions? + -> we want to be able to do data/type definitions in .data etc. + -> M0 done: navigating to a non-function EA opens a flat listing (region) + instead of refusing; c/p/u edit verbs on the disasm view (define code / + function / undefine) with bump_items() cache invalidation + region->func + upgrade. next: M1 server `heads` walker + ListingModel (address paging), + M2 ListingView (code+data render), M3 data typing in .data. crazy: [ ] multi/split view ala ghidra? -- cgit v1.3.1-sl0p