From e494ae722dc70b4fe8a0507144b84b62f211b5ac Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 23 Jul 2026 01:53:36 +0200 Subject: app: 'a' — make string literal in the listing (M4 richness) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IDA's 'A' key. New make_string server tool (ida_bytes.create_strlit, auto-length to the terminator, undefines items in the way first, returns size + decoded contents). Program.make_string wraps it; 'a' on a listing head routes through the existing edit plumbing (EditItemRequested kind=string -> _do_edit_item -> make_string -> bump_items -> reopen). Verified: make_string at a .rodata addr creates the literal and IDA auto-names it (aUsage for 'usage'). New listing_make_string scenario drives it through the UI; listing suite 15/0. Needs a supervisor restart. --- idatui/app.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'idatui/app.py') diff --git a/idatui/app.py b/idatui/app.py index 570ed0a..cc9ab03 100644 --- a/idatui/app.py +++ b/idatui/app.py @@ -900,6 +900,7 @@ class ListingView(SearchMixin, NavMixin, ColumnCursor, ScrollView, can_focus=Tru Binding("G,end", "goto_bottom", "Bottom", show=False), Binding("c", "define_code", "Code", show=False), Binding("d", "make_data", "Data", show=False), + Binding("a", "make_string", "Str", show=False), Binding("p", "define_func", "Func", show=False), Binding("u", "undefine", "Undef", show=False), *SearchMixin.SEARCH_BINDINGS, @@ -1071,6 +1072,9 @@ class ListingView(SearchMixin, NavMixin, ColumnCursor, ScrollView, can_focus=Tru def action_make_data(self) -> None: self.post_message(MakeDataRequested(self)) + def action_make_string(self) -> None: + self.post_message(EditItemRequested(self, "string")) + def cur_head(self) -> Head | None: return self._head(self.cursor) @@ -3079,12 +3083,15 @@ class IdaTui(App): def _do_edit_item(self, kind: str, ea: int) -> None: # worker context assert self.program is not None verb = {"code": "defined code", "func": "created function", - "undef": "undefined"}[kind] + "undef": "undefined", "string": "made string"}[kind] try: if kind == "code": self.program.define_code(ea) elif kind == "func": self.program.define_func(ea) + elif kind == "string": + s = self.program.make_string(ea) + verb = f"made string ({s[:24]!r})" if s else verb else: self.program.undefine(ea) except Exception as e: # noqa: BLE001 -- surface soft/hard tool errors -- cgit v1.3.1-sl0p