disassembly
Query radare2 code and control flow via r2xsql — functions, blocks, CFGs, frames, instructions/operands, low IR, sections, segments, live IO maps, calling…
от radareorg★ 23 звезды на GitHub
Установить disassembly в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
When to use
Pick this skill any time the question is about code structure —
function lists, basic blocks, individual instructions, or how the
binary is laid out in memory. For string/import/export lookups use the
data skill; for cross-references use xrefs; for pseudocode use
decompiler.
Tables
| table / views | source | scope |
|---|---|---|
funcs, locals |
aflj, afvj (or the C API directly on the in-process build) |
functions plus writable locals/arguments |
calling_conventions |
afclj |
static per-(arch,bits) ABI reference — what a funcs.calltype name actually means |
registers |
arpj |
static per-(arch,bits) register PROFILE — names/sizes/roles, not live values |
blocks, cfg_edges, switch_tables |
afbj @ <fn> |
block layout and all successors |
function_frames |
afij @ <fn> |
stack-frame summary |
dominators, post_dominators, loops |
derived from afbj |
graph structure |
instructions, instruction_operands |
pdfj, aoj |
instructions and exact decoded operands |
esil_ops, esil_operands, ir_* |
instruction ESIL | partial canonical low-IR |
sections, segments, io_maps |
iSj, iSSj, omj |
binary layout and live editable mappings |
The function-scoped graph, instruction, and operand tables scope themselves
when you filter by func_addr — WHERE func_addr = 0x401000 issues
bounded afbj / pdfj / aoj commands instead of enumerating every
function in the binary. Always include that filter for non-trivial
binaries, otherwise the query is O(funcs).
Performance: blocks, cfg_edges, switch_tables, dominators,
post_dominators, and loops all read the same underlying block list, and
the in-process build reads it straight from radare2's analysis state instead
of running afbj and parsing its JSON — a full scan goes from one command per
function to none. switch_tables.table_addr stays NULL either way: radare2
has the jump table's own address internally, but no command exposes it, so
the column would otherwise read differently on the two build flavors.
locals gets the same treatment: the in-process build reads a function's
variables/arguments straight from radare2's analysis state instead of
running afvj per function. sections/segments also read straight from
radare2's binary-header state (RBinSection) on the in-process build instead
of running iSj/iSSj — both commands already share ONE underlying vector
(opposite filters on the same section list), and unlike the function-scoped
tables above, neither needs an analysis pass at all: they read the loaded
binary's own headers.
instructions has a second, independent way in: WHERE start_addr = X AND count = N (both required together) disassembles N instructions starting
at an arbitrary address, not a function's own entry — useful for
data-adjacent code, gaps, or a jump target that doesn't happen to be a
function boundary. It is not a substitute for func_addr: it walks
linearly and cannot reach a block that sits below its own function's entry
(non-contiguous functions are real), and it doesn't know which function (if
any) owns what it walks, so func_addr reads 0 on these rows.
instructions is also projection-gated on the in-process build, on all
three of its shapes (unfiltered scan, func_addr, start_addr/count):
disasm and mnemonic are rendered text (radare2's own disassembly
renderer — no exported C API for it), so a query selecting either always
runs the full command path; a query selecting neither reads the remaining
columns (addr, size, bytes, func_addr, esil, op_type, family)
straight from radare2's analysis state instead — measured 4-9x faster. Drop
disasm/mnemonic from the SELECT list on a wide scan that only needs the
classification columns, and add them back whenever you actually need the
rendered text.
Common queries
-- 20 largest functions by code size
SELECT addr, name, size, cc, nbbs
FROM funcs
ORDER BY size DESC
LIMIT 20;
-- function shape without reading a single instruction
SELECT name, ninstrs, stackframe, cost, end_addr - addr AS extent
FROM funcs ORDER BY ninstrs DESC LIMIT 20;
-- self-recursive, never-returning, or pure helpers
SELECT name, is_recursive, is_noreturn, is_pure
FROM funcs WHERE is_recursive = 1 OR is_noreturn = 1 OR is_pure = 1;
-- floating-point / vector / privileged code, without matching mnemonic text
SELECT family, COUNT(*) FROM instructions GROUP BY family ORDER BY 2 DESC;
SELECT addr, disasm FROM instructions WHERE family = 'priv';
-- a single function's disassembly
SELECT addr, mnemonic, disasm
FROM instructions
WHERE func_addr = 0x401000
ORDER BY addr;
-- ESIL (radare2's stack IL) per instruction, e.g. mov -> "rbx,0x8,rsp,+,=[8]"
SELECT addr, mnemonic, esil
FROM instructions
WHERE func_addr = 0x401000 AND esil <> ''
ORDER BY addr;
-- semantic op classification: radare2 op_type + cross-tool canonical op
SELECT seq, addr, op_type, ca
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Bash - 02
Read
FAQ
Что делает скилл disassembly?
Query radare2 code and control flow via r2xsql — functions, blocks, CFGs, frames, instructions/operands, low IR, sections, segments, live IO maps, calling conventions, and the register profile.
Как установить скилл disassembly?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл disassembly запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…