aboutsummaryrefslogtreecommitdiffstats
path: root/idatui/drive.py
diff options
context:
space:
mode:
authoragent <agent@local>2026-08-01 18:20:13 +0200
committeragent <agent@local>2026-08-01 18:20:13 +0200
commit5f5c2ba0621e53ae380dc434e578c6f67e9b8deb (patch)
treed3510ab0b923a9f35093811280d2f535481b52b3 /idatui/drive.py
parentrpc: rename_many drops the Hex-Rays cache too (diff)
downloadida-tui-5f5c2ba0621e53ae380dc434e578c6f67e9b8deb.tar.gz
ida-tui-5f5c2ba0621e53ae380dc434e578c6f67e9b8deb.tar.xz
ida-tui-5f5c2ba0621e53ae380dc434e578c6f67e9b8deb.zip
drive: a note went to address 0, and a slow edit was reported as a failure
Two bugs found driving a 65KB ARM firmware image (one flat 42k-line listing, no ELF sections to break it up): `note` did goto + `cursor line=0` before commenting. Line 0 is the top of the function only in the DECOMPILER; in the listing it is the top of the SEGMENT, so every note landed at address 0 -- and scrolling a 42k-line listing there took so long the call timed out, which read as "comments are broken". goto already lands on the function's first line, so the cursor call just goes; note now also reports where it landed. The client's 90s timeout was too tight for the same reason: comments on that listing take 26-106s (the rebuild has no function boundary to stop at), so the CLI reported "no response ... server busy or the op is hung" for edits that had already been applied. Believing a successful edit failed is the worse error -- the driver redoes it, or "fixes" what was never broken. Default is now 300s; IDATUI_RPC_TIMEOUT still overrides.
Diffstat (limited to 'idatui/drive.py')
-rw-r--r--idatui/drive.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/idatui/drive.py b/idatui/drive.py
index 0e82b0d..531b558 100644
--- a/idatui/drive.py
+++ b/idatui/drive.py
@@ -219,10 +219,15 @@ def cmd_mv(c, args):
def cmd_note(c, args):
if len(args) < 2:
raise SystemExit("usage: note <fn> <text...>")
- c.call("goto", target=args[0], delay_ms=0)
- c.call("cursor", line=0, col=0)
+ st = c.call("goto", target=args[0], delay_ms=0)
+ # goto already lands on the function's first line. The old `cursor line=0`
+ # meant "the top of the function" only in the decompiler; in the listing
+ # line 0 is the top of the whole SEGMENT, so the note landed at address 0 --
+ # and on a 42k-line firmware listing the scroll to get there timed the
+ # caller out, which read as "comments are broken".
c.call("comment", text=" ".join(args[1:]), delay_ms=0)
- return f" noted {args[0]}"
+ cur = (st.get("function") or {}).get("name") or args[0]
+ return f" noted {cur} @ {(st.get('cursor') or {}).get('ea', 0):#x}"
def cmd_retype(c, args):