From cf8b4645e2744fff455fc09167f91d011a3e620a Mon Sep 17 00:00:00 2001 From: blasty Date: Sun, 26 Jul 2026 00:04:38 +0200 Subject: formats: verify every offered processor name against a real IDA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The curated list was written from the procs/ directory listing. Two of the twenty names were wrong, and wrong here is not a soft failure: IDA REFUSES to open the database (rc=4) with nothing useful said. The load dialog would have handed people a dead end from inside the UI that exists to rescue them — the same silent-failure class the dialog was built to kill. h8 -> h8300 (h8.so is the module FILENAME, not a processor name) sparc -> sparcb / sparcl (and SPARC has endianness variants, like MIPS/PPC) Also probed the aliases people reach for first: arm64, aarch64, mips, m68k are all invalid. 'arm' covers AArch64 (verified: an AArch64 blob analyses to 35 functions under -parm), so those names now live in the human labels, where the filter still finds them — typing "arm64" finds ARM, "m68k" finds 68k, "mips" finds both endiannesses. tools/verify_procs.py does the check: open a scratch blob with -p, read back inf_get_procname(), compare. Fresh temp dir per name, because once a database exists IDA ignores the load switches and every name after the first would "pass". 21/21 verified. tests: +11 formats, including the verified-set guard (adding a processor without re-running the script fails on purpose) and checks that the rejected aliases are NOT offered but ARE still findable by typing them. 32/0 formats, 199/0 scenarios. --- idatui/formats.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'idatui') diff --git a/idatui/formats.py b/idatui/formats.py index 744276d..b2f784d 100644 --- a/idatui/formats.py +++ b/idatui/formats.py @@ -82,8 +82,19 @@ def needs_load_options(path: str) -> bool: #: long is a worse answer than a short one plus free text. These are the targets #: that actually turn up in firmware work, endianness spelled out because #: getting it wrong is the most common way to end up with zero functions. +#: +#: EVERY NAME HERE IS VERIFIED against a real IDA by opening a scratch blob with +#: ``-p`` and reading back ``inf_get_procname()`` — see +#: ``tools/verify_procs.py``. That is not ceremony: a wrong name is REJECTED by +#: IDA (rc=4) with no useful message, which is the same silent-failure class this +#: dialog exists to prevent. Two of the first twenty were wrong ("h8" and +#: "sparc" are module filenames, not processor names), and the aliases people +#: reach for first — arm64, aarch64, mips, m68k — are all invalid. Re-run the +#: script before adding to this list. PROCESSORS: tuple[tuple[str, str], ...] = ( - ("arm", "ARM / AArch64 — little-endian"), + # 'arm' covers AArch64 too; arm64/aarch64 are NOT valid -p names, so they + # live in the label where the filter can still find them. + ("arm", "ARM / AArch64 / arm64 — little-endian"), ("armb", "ARM — big-endian"), ("metapc", "x86 / x86-64"), ("mipsl", "MIPS — little-endian"), @@ -91,7 +102,7 @@ PROCESSORS: tuple[tuple[str, str], ...] = ( ("ppc", "PowerPC — big-endian"), ("ppcl", "PowerPC — little-endian"), ("sh4", "SuperH SH-4"), - ("68k", "Motorola 68000"), + ("68k", "Motorola 68000 / m68k"), ("riscv", "RISC-V"), ("tricore", "Infineon TriCore"), ("xtensa", "Tensilica Xtensa (ESP32 etc.)"), @@ -100,8 +111,9 @@ PROCESSORS: tuple[tuple[str, str], ...] = ( ("tms320c6", "TI TMS320C6x DSP"), ("m32r", "Renesas M32R"), ("arc", "Synopsys ARC"), - ("h8", "Renesas H8"), - ("sparc", "SPARC"), + ("h8300", "Renesas H8/300"), + ("sparcb", "SPARC — big-endian"), + ("sparcl", "SPARC — little-endian"), ("s390", "IBM S/390"), ) -- cgit v1.3.1-sl0p