From 5f6014514edf65dcf249a8ff457bb42409336eef Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 9 Jul 2026 14:44:31 +0200 Subject: rename symbol under cursor ('n') + save ('Ctrl+S') - 'n' on the token under the cursor opens a rename prompt prefilled with the current name. The symbol is classified and routed to the right rename batch: * resolves to a function start -> func * decompiler ref (global/string) -> data * pseudocode token, not a ref -> local (Hex-Rays lvar) * disasm var_/arg_ -> stack tool errors (e.g. name collisions) are surfaced in the status line. - after a rename: force_recompile + cache invalidation, reload the current views (preserving cursor), update the renamed function's row in place (avoids racing the initial stream), and update nav history names. - 'Ctrl+S' persists the IDB (idb_save); edits mark the session dirty. - 'n'/'N' search-repeat dropped for 'n'=rename (repeat stays on '/'+Enter / '?'). - verified live: func rename (list + disasm update), local var rename (pseudocode update), save. pilot suite 44/44; domain 17/17. --- idatui/domain.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'idatui/domain.py') diff --git a/idatui/domain.py b/idatui/domain.py index 6578932..b219bbe 100644 --- a/idatui/domain.py +++ b/idatui/domain.py @@ -199,6 +199,19 @@ class FunctionIndex: with self._lock: return list(self._funcs) + def update_name(self, addr: int, new_name: str) -> None: + """Reflect a rename in the cached index (Func is frozen -> replace).""" + with self._lock: + old = self._by_addr.get(addr) + if old is None: + return + nf = Func(addr=old.addr, name=new_name, size=old.size) + self._by_addr[addr] = nf + try: + self._funcs[self._funcs.index(old)] = nf + except ValueError: + pass + # --------------------------------------------------------------------------- # # Disassembly model: block-cached windowed listing for ONE function -- cgit v1.3.1-sl0p