/r2sql:re-sourcefrom r2sql
Recursive bottom-up annotation of a radare2 binary via r2sql — walk from strings/imports up through callers, naming and commenting each layer until the binary reads like source. Use for reverse engineering campaigns that span multiple sessions.
Ships in r2sql. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Pick this skill when the user wants to incrementally rebuild
meaning in a binary: turn sub_401000 into aes_init, write what
each function does, and persist that across sessions so the next pass
starts from a richer baseline.
For one-off analysis or open-ended triage, use the analysis skill.
For the mechanics of writing comments/flags, use annotations.
Persistence is required. Always:
r2sql -w --project NAME -s <binary> -i
so every comment/flag you add gets saved to the project on exit.
'license check failed')CryptDecrypt if it appears once)xrefs to find the first caller, then the
caller's caller, … up to a function that's identifiable from
its own surface (a public DLL export, an exception handler,
a top-level dispatcher).UPDATE flags SET name = … and UPDATE comments SET text = ….-- (1) the anchor: a unique error string
SELECT addr FROM strings WHERE text = 'license check failed';
-- → addr = 0x412ab0
-- (2) one hop back: who references the string?
SELECT from_addr, from_func FROM xrefs WHERE to_addr = 0x412ab0;
-- → from_func = sub_401a10, from_addr = 0x401b34
-- (3) annotate that function
UPDATE flags SET name = 'license_fail_log' WHERE addr = 0x401a10;
UPDATE comments SET text = 'logs license-check failure' WHERE addr = 0x401a10;
UPDATE comments SET text = 'msg = "license check failed"' WHERE addr = 0x401b34;
-- (4) two hops back: who calls license_fail_log?
SELECT from_func FROM xrefs x JOIN funcs f ON f.addr = x.to_addr
WHERE f.name = 'license_fail_log' AND x.type = 'CALL';
-- → license_check_v2
-- (5) annotate, repeat
UPDATE comments SET text = 'top-level license check; calls license_fail_log on failure'
WHERE addr = (SELECT addr FROM funcs WHERE name = 'license_check_v2');
Each pass over the binary makes the next pass cheaper:
xrefs walk lands on a meaningful name instead of sub_*.Persist with Ps (the backend does this automatically when
-w --project NAME was passed). Reopen with --project NAME to
skip re-analysis and keep building.
types and types_members surface r2's type database — useful when
the binary uses well-known struct shapes (Windows headers, Linux
kernel structs). Apply types to memory with tl <TYPENAME> @ <addr>
through the r2js skill (a raw r2 command, not a SQL write).
-w; otherwise they vanish
on exit and the next pass starts from sub_* again.xrefs table only sees what the analysis found. Run aaaa (with
-AA) for deeper static analysis before serious re-sourcing.'error' is too common to follow.
Pick unique anchors first; the rare ones give straight chains.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub 0xeb/r2sql-skills --plugin r2sql11 skills in this plugin
/analysisTriage and audit radare2 binaries via r2sql — find suspicious behavior, surface crypto/network/persistence APIs, hunt high-complexity functions, and run multi-table queries that combine code, data, and xrefs./annotationsEdit radare2 annotations — comments, flag/function names, local variables, bookmarks — via r2sql. Use when asked to add comments, rename functions/flags, rename or retype locals, or persist analysis state./connectConnect to radare2 sessions via r2sql and bootstrap analysis. Use when starting a new SQL session, routing to other skills, or setting up CLI/HTTP/MCP connections.Other plugins' skills for the same job