aboutsummaryrefslogtreecommitdiffstats
path: root/idatui/worker.py
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-26 00:25:35 +0200
committerblasty <blasty@local>2026-07-26 00:25:35 +0200
commit1e246a1136c5b5d4d84f6a796391007fa7ad0abc (patch)
tree3861ba802c67bb96c773dd9aa0c1ed2e3dab7859 /idatui/worker.py
parentformats: verify every offered processor name against a real IDA (diff)
downloadida-tui-1e246a1136c5b5d4d84f6a796391007fa7ad0abc.tar.gz
ida-tui-1e246a1136c5b5d4d84f6a796391007fa7ad0abc.tar.xz
ida-tui-1e246a1136c5b5d4d84f6a796391007fa7ad0abc.zip
load dialog: reachable address field, project mode, and a way back from a bad answer
Three bugs, reported together, with one shared root: you couldn't get to the address field, so the address went into the processor filter, so IDA got a nonsense processor name and refused to open — and the app dead-ended with a misleading error. **Tab never reached any modal.** Binding("tab,shift+tab", "toggle_view", priority=True) is an APP binding, and priority bindings run before the focus chain. Nothing in any dialog in this app could ever be tabbed to; the load dialog is just where it finally mattered. action_toggle_view now hands the key back when a modal is up, which fixes it everywhere. **...and DOM order was the wrong tab order anyway.** focus_next() stopped at the processor list, which is arrow-driven and has nothing to type. LoadOptionsScreen overrides it to cycle the two fields you actually type into. **...and the dialog outgrew the terminal.** With the palette's default max-height the 21-row list pushed the address field and help line off the bottom of the screen. Nothing errors — the field simply isn't there, which reads as "Tab does nothing". Capped per-dialog. **Project mode never asked.** _should_ask_load_options bailed on `self._project is not None` with the comment "project mode carries per-binary options already" — true only if someone had already filled them in. A raw blob added to a project got the silent x86-at-0 treatment the dialog exists to prevent. Now asked at boot AND on switching to an undescribed binary, and the answer is written back to the project entry (Project.set_load), so it is asked once per binary, not once per run. **A rejected answer dead-ended.** Getting a processor wrong is an ordinary mistake; it left an empty app with "connect failed: worker exited (code 1)" and a message blaming a locked .i64. The worker now names the real suspect when load switches were in play, and the app re-opens the dialog instead of giving up. Verified with real keys in a tmux pane, which is the only way any of this shows up: Tab -> address field -> 0x8000000 -> Enter -> 35 functions at 0x80039AC; a bogus processor -> "those load options were rejected — try again" with the dialog back; project mode -> asks, loads at the right base, and the answer is in the project file. tests: +3 scenarios (Tab moves focus under a modal, lands on the address field, cycles back). 202/0 scenarios, 39/0 project, 32/0 formats, 30/0 project UI. docs/TEXTUAL_NOTES.md gets the priority-binding and clipped-modal traps.
Diffstat (limited to 'idatui/worker.py')
-rw-r--r--idatui/worker.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/idatui/worker.py b/idatui/worker.py
index 26f0816..a4e3509 100644
--- a/idatui/worker.py
+++ b/idatui/worker.py
@@ -111,6 +111,15 @@ def _open_and_register(binpath: str, load_args: str = ""):
args = None
if idapro.open_database(binpath, run_auto_analysis=True,
args=args): # nonzero == failure
+ if args:
+ # With load switches in play they are the likeliest culprit by far:
+ # IDA refuses an unknown -p name with no diagnostic of its own, so
+ # saying "the database is locked" here sends people hunting a
+ # problem they don't have.
+ raise RuntimeError(
+ f"failed to open {binpath} with load options {args!r}: IDA "
+ f"rejected them \u2014 an unknown processor name is the usual "
+ f"cause (see tools/verify_procs.py for the valid ones)")
raise RuntimeError(
f"failed to open {binpath}: the .i64 is likely held by a running "
f"ida-mcp worker (try: pkill -f idalib) or wedged from a crash "