diff options
| author | blasty <blasty@local> | 2026-07-22 23:55:51 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-07-22 23:55:51 +0200 |
| commit | 4d98bf31a5fc99350c47a7ec84d00da618a15ca6 (patch) | |
| tree | 6b1bf39e7351593b7307feb2800eb4606cfc07b0 /idatui/domain.py | |
| parent | server: coalesce undefined byte runs in the heads walker (diff) | |
| download | ida-tui-4d98bf31a5fc99350c47a7ec84d00da618a15ca6.tar.gz ida-tui-4d98bf31a5fc99350c47a7ec84d00da618a15ca6.tar.xz ida-tui-4d98bf31a5fc99350c47a7ec84d00da618a15ca6.zip | |
app: 'd' — define typed data in the listing (make_data, M3)
Press 'd' on a listing head to define typed data at that address via a prompt
(the ".data type definitions" backlog item). Mirrors the retype prompt flow:
MakeDataRequested -> #makedata Input (prefilled with a size-appropriate default
type: unsigned __int8/16/32/64 or char[N]) -> _do_make_data worker ->
Program.make_data -> bump_items -> reopen the listing in place. Accepts any C
type IDA's SetType understands: int, char[16], my_struct, T *arr[4], ...
Pilot: listing_view gains a deterministic sub-test — undefine a data head to
synthesize an unknown run, assert it renders as `unknown`, then 'd' char[4]
over it and assert it becomes a `data` head. 118 pass / 1 pre-existing flaky
(filter); rpc_smoke 29/0.
Diffstat (limited to 'idatui/domain.py')
| -rw-r--r-- | idatui/domain.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/idatui/domain.py b/idatui/domain.py index fd673ca..4f33211 100644 --- a/idatui/domain.py +++ b/idatui/domain.py @@ -1071,6 +1071,17 @@ class Program: if res.get("error"): raise IDAToolError(f"undefine @ {ea:#x}: {res['error']}") + def make_data(self, ea: int, type_decl: str, name: str | None = None) -> None: + """Create a typed data item at ``ea`` (IDA's 'd', but typed). ``type_decl`` + is a C type, e.g. 'int', 'unsigned __int32', 'char[5]', 'my_struct'.""" + item: dict = {"addr": hex(ea), "type": type_decl} + if name: + item["name"] = name + res = self._first_result(self.client.call("make_data", items=[item])) + if res.get("ok") is False or res.get("error"): + raise IDAToolError( + f"make data @ {ea:#x}: {res.get('error') or 'rejected'}") + def region_label(self, ea: int) -> str: """Display name for a non-function address (segment-qualified).""" try: |
