SKILL.md — ida-rpc
How to use ida-rpc as a reverse-engineering skill inside an agent workflow.
What This Skill Provides
Direct, structured access to IDA Pro's analysis engine without GUI interaction. Commands print human-readable text by default; pass --json (before the subcommand) or set IDA_RPC_JSON=1 for JSON. No screen scraping, no MCP protocol overhead. Works in both interactive (GUI) and automation (headless) modes.
When to Use This Skill
- You need to decompile, disassemble, or analyze a binary.
- You need cross-references, function lists, imports, exports, or strings.
- You need to rename functions, set comments, or create data types programmatically.
- You need segment editing, processor context switching (ARM/Thumb), or assembly patching.
- You are working in an automation pipeline or multi-agent system.
What this skill requires
- Run Unix-socket RPC queries outside the sandbox.
ida-rpc-codex starts a
loopback TCP session whose RPC commands can run inside the sandbox.
Quick Start Workflow
1. Discover capabilities and project path
bash
ida-rpc capabilities
ida-rpc find-project /path/to/binary-or-existing.i64
ida-rpc list-loaders /path/to/binary
Use capabilities as the stable automation probe. It describes the supported command groups and the recommended agent workflow. Add --json for machine-readable output.
2. Start the Daemon
bash
# Open a binary and start the daemon
ida-rpc open /path/to/binary --arch <arch> --headless --detach
# Open an existing database (.i64 or .idb)
ida-rpc open --project /path/to/existing.i64 --arch <arch> --headless --detach
# For raw binaries, specify architecture and base address
ida-rpc open /path/to/raw.bin --arch arm --base 0x8000 --loader raw --headless --detach
# For custom loaders, first list candidates, then force the loader if needed
ida-rpc list-loaders /path/to/loader.bin
ida-rpc open /path/to/loader.bin --arch arm --loader miniloader --headless --detach
# When opening a system binary (e.g. /usr/bin/ls), specify a writable project path
ida-rpc open /usr/bin/ls --project /tmp/ls_analysis.i64 --arch x86 --headless --detach
3. Set the default project
bash
export IDA_RPC_PROJECT=/path/to/binary.i64
4. Check status and list loaded binaries
bash
# Check if a daemon is running for a project
ida-rpc status --project /tmp/ls_analysis.i64
# List all currently loaded binaries in a project
ida-rpc list-binaries --project /tmp/ls_analysis.i64
# List all active ida-rpc daemons on this machine
ida-rpc list
5. Run analysis commands
Commands print human-readable text by default. Add --json (before the subcommand) or set IDA_RPC_JSON=1 when you need structured output for jq or other tools.
bash
# List functions (paginated)
ida-rpc functions --limit 20
# Decompile a function
ida-rpc decompile main
# Search for strings containing "password"
ida-rpc strings "password" --limit 20
# Find byte pattern
ida-rpc find-bytes "55 8b ec 83 ec"
# Get cross-references to a function
ida-rpc xrefs-to target_function
# Read raw bytes at an address
ida-rpc read-bytes 0x401000 64
6. Make annotations
bash
# Rename a function
ida-rpc rename-function sub_401000 my_awesome_function
# Set a comment
ida-rpc set-comment 0x401020 "This is the entry point"
# Create a struct
ida-rpc create-struct my_struct "int" field1 "char" field2
# Set a bookmark
ida-rpc set-bookmark 0x401000 --type Analysis --comment "Suspicious loop"
7. Save and stop
bash
ida-rpc save
ida-rpc stop
Command Reference for Agents
Lifecycle
| Command | Args | Description | |
|---|
capabilities | | Print agent-discoverable command capabilities | |
find-project <binary-or-idb> | | Resolve IDB path, socket path, session state, and recommended start command | |
list-loaders [binary] [--ida-install-dir DIR] | | List loader aliases, installed IDA loaders, and file-specific candidates | |
open <binary-or-idb> --arch <arch> [--project <idb>] [--loader <name>] [--headless] [--detach] | | Agent-friendly alias for start | |
start <binary> --arch <arch> [--project <idb>] [--base <addr>] [--loader <name>] [--headless] [--detach] [--clean] | | Open binary and start daemon | |
start --project <idb> --arch <arch> [--headless] [--detach] [--clean] | | Open an existing database | |
stop --project <idb> | | Stop daemon | |
status --project <idb> | | Check health, launch arch, loaded processor/settings, and loaded binary | |
restart --project <idb> [--headless] [--clean] | | Restart daemon | |
list | | List all active projects/daemons | |
list-binaries --project <idb> | | List loaded binaries with arch, bits, endian, format, and base address | |
Loader aliases accepted by --loader include:
| Alias | IDA loader string | |
|---|
raw, binary, bin, dump | Binary file | |
miniloader, rk-miniloader, rockchip-miniloader | Rockchip MiniLoaderAll / LDR | |
uboot-fit, rk-uboot | Rockchip U-Boot FIT image | |
rkns | Rockchip RKNS IDB/SPL image | |
Analysis & Listing
| Command | Args | Description | |
|---|
functions [--limit N] [--offset N] [--with-body] | | List functions with optional pagination | |
imports | | List imported symbols | |
exports | | List exported symbols | |
metadata | | Binary metadata (arch, bits, format, base addr) | |
relocations [--limit N] | | List relocation/fixup entries | |
calling-conventions | | List valid calling conventions for current processor | |
strings [query] [--limit N] | | Search strings (empty query = all) | |
symbols <query> [--limit N] | | Search named symbols | |
find-bytes <pattern> [--limit N] | | Byte pattern search (supports ?? wildcards) | |
memory-map | | List memory segments with RWX permissions | |
segments | | Alias for memory-map (explicit segment listing) | |
basefind <path> [--max-results N] [--min-abs-refs N] [--str-len N] [--diff-len N] [--samplerate N] [--no-filename-hints] | | Scan a flat 32-bit binary to determine its load base (runs locally, no daemon needed) | |
Decompilation & Disassembly
| Command | Args | Description | |
|---|
decompile <func> [--timeout N] | | Decompile function to pseudo-C | |
decompile-all [--limit N] [--function <filter>] | | Bulk decompile all functions | |
basic-blocks <func> [--limit N] | | CFG basic blocks with successors/predecessors | |
disassemble <address> [--count N] | | Disassemble instructions (default 20, max 1000) | |
assemble <address> <instruction> | | Assemble instruction text (requires Keystone Engine) | |
read-bytes <address> <length> | | Hex dump with ASCII | |
write-bytes <address> <hex> | | Patch bytes (max 4096) | |
Cross-References
| Command | Args | Description | |
|---|
xrefs-to <target> [--limit N] | | References to target (function name or address) | |
xrefs-from <target> [--limit N] [--no-stack] | | References from target | |
Annotations & Modifications
| Command | Args | Description | |
|---|
rename-function <target> <new_name> | | Rename function | |
rename-symbol <address> <new_name> [--create] | | Rename symbol at address | |
create-label <address> <name> | | Create a named label | |
| `set-comment <address> <comment> [--type plate\ | pre\ | post\ | eol\ | repeatable]` | | Set comment | |
set-signature <target> <signature> | | Set function prototype (C syntax) | |
set-data-type <address> <type> | | Set data type (byte, word, dword, qword, string, or C decl) | |
create-function <address> [--name N] | | Create function at address | |
delete-function <target> | | Delete a function definition | |
create-instruction <address> | | Mark bytes at address as an instruction | |
undefine <address> [length] | | Undefine instruction or data at address | |
set-thunk <target> [--thunk-target <addr>] [--clear] | | Mark/unmark function as thunk | |
set-calling-convention <target> <convention> | | Change function calling convention | |
batch-rename --from-file <json> | | Bulk rename functions/symbols | |
batch-set-comment --from-file <json> | | Bulk set comments | |
batch --from-file <json> | | Execute multiple RPC commands in one batch | |
Lumina
Lumina commands use the primary or secondary Lumina server configured in IDA (Options > General > Lumina) or overridden for the IDA session with -Olumina:... / -Osecondary_lumina:.... Credentials are not returned.
| Command | Args | Description | |
|---|
lumina-config [--secondary] | | Report Lumina configuration source and whether a configured client is available | |
lumina-pull-signatures [target] [--all] [--apply/--no-apply] [--force] [--seen-file] [--secondary] | | Pull function signatures/metadata from Lumina | |
| `lumina-push-signatures [target] [--all] [--mode better\ | override\ | no-override\ | merge] [--min-func-size N] [--secondary]` | | Push function signatures/metadata to Lumina | |
Data Types
| Command | Args | Description | |
|---|
create-struct <name> <fields...> [--if-not-exists] [--or-replace] | | Fields as TYPE NAME TYPE NAME ... pairs | |
create-union <name> <fields...> [--if-not-exists] [--or-replace] | | Same pair format as struct | |
| `create-enum <name> [values...] [--size 1\ | 2\ | 4\ | 8]` | | Values as NAME VALUE NAME VALUE ... pairs | |
modify-struct <name> --action {rename,retype,delete,set_comment} --field <name> | | Modify an existing struct field | |
modify-enum <name> --action {add,remove} --member <name> [--value N] | | Add/remove enum members | |
| `list-data-types [--category all\ | struct\ | enum\ | union] [--query Q] [--limit N]` | | List defined types | |
list-labels <address> [--end <addr>] [--limit N] | | List symbols at or near an address | |
set-equate <address> <operand> <enum> [--clear] | | Attach enum to instruction operand | |
list-equates [--address <addr>] [--end <addr>] [--limit N] | | List all enum operands | |
| `clear-data-range <start> [--end <addr> \ | --length N]` | | Undefine data in a range | |
| `apply-data-type-range <start> <type> [--end <addr> \ | --length N]` | | Stamp a type across a range | |
Segments
| Command | Args | Description | |
|---|
add-segment <start> <end> [--name N] [--class C] | | Create a new segment | |
| `edit-segment <start> [--name N] [--class C] [--perm-read/--no-perm-read ...] [--bitness 0\ | 1\ | 2]` | | Modify segment name, class, permissions, or bitness | |
delete-segment <start> | | Delete a segment | |
Processor Context
| Command | Args | Description | |
|---|
get-processor-context [--address <addr>] [--register <name>] | | Read processor context registers (e.g., ARM T-bit) | |
set-processor-context <address> <register> <value> [--end <addr>] | | Set processor context register over a range | |
Namespaces
| Command | Args | Description | |
|---|
create-namespace <namespace> [--parent <ns>] | | Validate/create namespace | |
list-namespaces [--limit N] | | List all namespaces with symbol counts | |
Bookmarks
| Command | Args | Description | |
|---|
| `set-bookmark <address> [--type Note\ | Warning\ | Error\ | Info\ | Analysis] [--category C] [--comment M]` | | Set bookmark | |
list-bookmarks [--type T] [--address A] [--limit N] | | List bookmarks | |
remove-bookmark <address> [--type T] | | Remove bookmark | |
Tags
| Command | Args | Description | |
|---|
tag-function <target> <tag> | | Tag a function | |
untag-function <target> <tag> | | Remove tag from function | |
list-tags | | List all tags with counts | |
functions-by-tag <tag> [--limit N] | | Find functions by tag | |
Agent Workflow Patterns