From 0bc1c411f358c72eb235c3968ff73d1fab6a532b Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 23 Jul 2026 02:12:24 +0200 Subject: listing: expand struct-typed globals into member rows (M4 item 3) A struct-typed data item rendered as one dense 'MyS <...>' line. Now the heads walker emits indented member rows after the summary (from get_udt_details): +off name type, each a head of kind member at ea+offset. ListingView renders them indented/dimmed; _line_plain matches for cursor/search. Verified: a struct global expands to +0 a int / +4 b char[4] / +8 c __int16, member rows carry field addresses. New listing_struct_expand scenario; listing suite 22/0 (in-process). --- idatui/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'idatui/app.py') diff --git a/idatui/app.py b/idatui/app.py index 27dc33e..234b720 100644 --- a/idatui/app.py +++ b/idatui/app.py @@ -53,6 +53,7 @@ _S_MNEM = Style(color="cyan") _S_OPBYTES = Style(color="grey50") # raw opcode bytes column _S_DATA = Style(color="#c8a15a") # data items in the flat listing (db/dw/strings) _S_UNK = Style(color="grey54", italic=True) # undefined bytes in the flat listing +_S_MEMBER = Style(color="#9a8a6a") # struct field rows (expanded, indented) _S_CURSOR = Style(bgcolor="grey30") _S_DIM = Style(color="grey42", italic=True) _S_MATCH = Style(bgcolor="#7a5c00") # all search matches @@ -941,7 +942,8 @@ class ListingView(SearchMixin, NavMixin, ColumnCursor, ScrollView, can_focus=Tru h = self._head(idx) if h is None: return None - return f"{h.ea:08X} " + self._name_prefix(h) + h.text + indent = " " if h.kind == "member" else "" + return f"{h.ea:08X} " + indent + self._name_prefix(h) + h.text # -- public API -------------------------------------------------------- # def load(self, model: ListingModel, name: str, cursor: int = 0, @@ -1057,6 +1059,8 @@ class ListingView(SearchMixin, NavMixin, ColumnCursor, ScrollView, can_focus=Tru segs.append(Segment(" " + rest, _S_INSN)) elif h.kind == "data": segs.append(Segment(h.text, _S_DATA)) + elif h.kind == "member": + segs.append(Segment(" " + h.text, _S_MEMBER)) else: segs.append(Segment(h.text, _S_UNK)) strip = Strip(segs) -- cgit v1.3.1-sl0p