diff options
| author | blasty <blasty@local> | 2026-07-23 01:53:36 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-07-23 01:53:36 +0200 |
| commit | 0aba8653f4b585165d06714be32a0560ec5d5341 (patch) | |
| tree | 6f66c42fb8f0067dd1d94880ade26932293aa342 /idatui/domain.py | |
| parent | perf: derive segment map from file_regions, not survey_binary (hex open ~3400x) (diff) | |
| download | ida-tui-0aba8653f4b585165d06714be32a0560ec5d5341.tar.gz ida-tui-0aba8653f4b585165d06714be32a0560ec5d5341.tar.xz ida-tui-0aba8653f4b585165d06714be32a0560ec5d5341.zip | |
app: 'a' — make string literal in the listing (M4 richness)
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.
Diffstat (limited to 'idatui/domain.py')
| -rw-r--r-- | idatui/domain.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/idatui/domain.py b/idatui/domain.py index 58e4be9..f26354c 100644 --- a/idatui/domain.py +++ b/idatui/domain.py @@ -1127,6 +1127,16 @@ class Program: raise IDAToolError( f"make data @ {ea:#x}: {res.get('error') or 'rejected'}") + def make_string(self, ea: int, length: int = 0, kind: str = "c") -> str: + """Create a string literal at ``ea`` (IDA's 'A'); auto-length when 0. + Returns the decoded contents.""" + r = self.client.call("make_string", addr=hex(ea), length=int(length), kind=kind) + res = r if isinstance(r, dict) else {} + if not res.get("ok"): + raise IDAToolError( + f"make string @ {ea:#x}: {res.get('error') or 'rejected'}") + return res.get("text", "") + def region_label(self, ea: int) -> str: """Display name for a non-function address (segment-qualified).""" try: |
