aboutsummaryrefslogtreecommitdiffstats
path: root/idatui/app.py
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-09 22:28:53 +0200
committerblasty <blasty@local>2026-07-09 22:28:53 +0200
commit6a761c222a6f08cb2fd825a15f3d3f44390a716d (patch)
tree8a0a6c3add4eab61555783dd407a7c2aa83070ec /idatui/app.py
parentdecompiler: xref jump lands the cursor on the reference token's column (diff)
downloadida-tui-6a761c222a6f08cb2fd825a15f3d3f44390a716d.tar.gz
ida-tui-6a761c222a6f08cb2fd825a15f3d3f44390a716d.tar.xz
ida-tui-6a761c222a6f08cb2fd825a15f3d3f44390a716d.zip
xrefs: informative labels — function+offset, and section instead of '?'
The xref list showed just the containing function name, so multiple sites in the same function were indistinguishable ('sub_2300' repeated), and references not in any function collapsed to a bare '?'. - In-function sites now show fn_name+offset (e.g. main+0xb08), so each site is distinct and you can see where in the function it is. - Non-function sites (GOT/reloc data slots, loose thunks) show the section they live in (.got, .data.rel.ro, .text, LOAD, ...) instead of '?'. Add Program.sections()/section_of() over survey_binary's segment map (fetched once, cached lazily). Pilot checks for both. full suite 67/67.
Diffstat (limited to 'idatui/app.py')
-rw-r--r--idatui/app.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/idatui/app.py b/idatui/app.py
index cc4cca7..c1b98a5 100644
--- a/idatui/app.py
+++ b/idatui/app.py
@@ -1501,7 +1501,18 @@ class IdaTui(App):
focus = subj_name if self._looks_like_symbol(subj_name) else None
if focus is None and fn is not None and fn.addr == subj:
focus = fn.name
- items = [(x.frm, f"{x.frm:08X} {x.fn_name or '?':<24} [{x.type}]") for x in xr]
+ items = []
+ for x in xr:
+ if x.fn_name:
+ # location = function + offset, so multiple sites in the same
+ # function are distinguishable (sub_2300+0x1c, not just sub_2300).
+ off = (x.frm - x.fn_addr) if x.fn_addr is not None else 0
+ loc = f"{x.fn_name}+{off:#x}" if off else x.fn_name
+ else:
+ # not inside a function: name the section it lives in (a GOT/reloc
+ # data slot or a loose thunk) instead of a bare '?'.
+ loc = self.program.section_of(x.frm) or "<no seg>"
+ items.append((x.frm, f"{x.frm:08X} {loc:<26} [{x.type}]"))
self.app.call_from_thread(self._present_xrefs, label, items, focus)
def _present_xrefs(self, label: str, items: list[tuple[int, str]],