Terminal
Terminal/Skill
Lets an agent run the idac CLI against IDA to decompile, inspect and edit binaries during reverse engineering.
By Trail of Bits
Works with
npx skills add trailofbits/idac --skill idacUse idac for IDA-backed reverse engineering through a live IDA GUI, an existing .i64 / .idb, or a binary that IDA can open.
Prefer first-class idac commands, then idac py exec, then external or ad hoc tooling only when idac cannot cover the task.
idac command at a time for each target. Use batch, decompilemany, and --out artifacts for broad work instead of background parallel commands.decompile --f5 or decompilemany --f5 during type or prototype recovery. --f5 is an alias for --no-cache.preview requires -o/--out.function prototype set, run function prototype show; use function prototype check for high-risk declarations; declare missing support types before dependent prototypes.type check --decl-file .... Use type deps <name> when an existing local type needs IDA-printed dependencies.misc reanalyze, then reread pseudocode or locals before rename-heavy cleanup.function locals list --json --out <path> and prefer --local-id or --index after prototypes or reanalysis may have shifted locals.function locals apply --json-file ... over a long name-only rename sequence.batch --lint -o <lint.json> <batch.idac> and fix reported parse, path, selector, or logging issues.-c for one live GUI session, use -c pid:<pid> for multiple GUI sessions, and use -c "db:/path" for headless work.struct declarations first, then grow them from observed offsets and access patterns. Use blob padding for unknown regions instead of guessed scalar fields.__attribute__((packed)); do not use packed as a shortcut for unknown gaps.When this guide is installed as a skill, the reference files sit alongside it; otherwise use idac docs TOPIC for the same material. For CLI syntax, prefer targeted help such as idac type class --help; use idac --full-help only when the command surface itself is unclear.
idac command already covers the task; do not start with raw IDAPython.What is the task?
│
├─ Read-only inspection (decompile, list, xrefs, strings, ctree, microcode)
│ └─ Run `idac docs cli`
│
├─ Mutation (rename, retype, prototype, type declare)
│ └─ Run `idac docs workflows`
│
├─ C++ class or vtable recovery
│ └─ Run `idac docs class-recovery` and `idac docs ida-cpp-type-details`
│
├─ Context/target selection, backend state, or bridge trouble
│ └─ Run `idac docs targets` or `idac docs troubleshooting`
│
└─ No first-class command covers the task
└─ Use `idac py exec` with a small explicit script
Use only the commands that match the current target state:
# always: discover live GUI and headless targets
idac targets list --json
# headless binary import
idac database open "/path/to/binary" --json
# headless database or imported binary context
idac database show -c "db:/path/to/binary" --json
# single live GUI session: omit -c
idac function list "init|open|close" --demangle --regex -i --json --out /tmp/functions.json
# one of several live GUI sessions: select the pid from targets list
idac decompile "sub_08041337" -c "pid:1234" -o /tmp/sub_08041337.c
# single live GUI session: omit -c
idac decompile "sub_08041337" -o /tmp/sub_08041337.c
# current context
idac xrefs "sub_08041337" --json
idac disasm --start "0x100000460" --end "0x1000004a0"
Use idac docs workflows (workflows.md) for exact syntax.
preview -o <path> <command...>.batch --lint -o <lint.json> <batch.idac> before the real run.misc reanalyze after type or prototype changes.audit/<target>-recovery.md) if one exists.For headless db: work, checkpoint with database save; database close saves by default, and database close --discard abandons pending changes. Live GUI edits remain in the IDA session.
Use idac docs class-recovery (class-recovery.md) for the full workflow and idac docs ida-cpp-type-details (ida-cpp-type-details.md) before importing C++ class or vtable declarations.
type list; opaque structs can exist before they qualify as classes.type class candidates for opaque targets, but skip exploratory RTTI scripting when symbols and RTTI already identify the family.--f5, refine, and re-import until readback stops revealing new structural facts.Use py exec only when no first-class command covers the task cleanly:
idac py exec --code "print(hex(idaapi.get_imagebase())); result = {'entry': hex(idc.get_inf_attr(idc.INF_START_EA))}"
Supported modes: --code, --stdin, --script. --script preserves IDAPython script semantics such as __file__, script-directory imports, and sys.argv when IDA exposes that helper. Add --persist only when later py exec calls in the same session must reuse Python globals.
The execution scope includes the core ida* modules that idac imports itself, plus idautils, idc, and result.
| File | idac docs topic | When to read |
|---|---|---|
references/cli.md | cli | Command grammar, common reads, preview, batch, output notes |
references/targets-and-backends.md | targets | Context selection, GUI vs idalib, opening binaries, target discovery |
references/workflows.md | workflows | Safe mutation loop, batch, selector calibration, post-mutation readback |
references/class-recovery.md | class-recovery | C++ class recovery workflow, naming rules, vtable guidance, verification |
references/ida-cpp-type-details.md | ida-cpp-type-details | IDA C++ parser expectations, __vftable, *_vtbl, multiple inheritance |
references/ida-set-types.md | ida-set-types | IDA SetType behavior and type application details |
references/ida-advanced-type-annotations.md | ida-advanced-type-annotations | IDA-specific advanced declaration annotations |
references/troubleshooting.md | troubleshooting | Bridge, backend, mutation, stale-result, or sandbox problems |
references/templates/README.md | templates | Reusable prototype, rename, checkpoint, and locals-JSON templates |