Analyzes binaries with ghidrasql using safe, high-signal query patterns for structural snapshots, hot functions, imports, strings, and Ghidra analyzer tuning.
Ships in ghidrasql. 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.
Read when SKILL.md points to them.
Use this skill when the user asks:
Route to:
xrefs for deeper caller/callee tracingdecompiler for concrete function interpretationannotations once a function is understood well enough to clean updebugger when triage uncovers patches or breakpoints worth inspectingre-source for a structured bottom-up campaign over the binaryGet a quick structural snapshot:
SELECT * FROM binary;
SELECT COUNT(*) AS funcs, SUM(size) AS total_bytes
FROM funcs;
Then use bounded, high-signal summaries:
SELECT name, printf('0x%X', addr) AS addr, size
FROM funcs
ORDER BY size DESC
LIMIT 20;
SELECT func_name, printf('0x%X', func_addr) AS addr, hotness_score
FROM function_metrics_scored
ORDER BY hotness_score DESC
LIMIT 20;
-- Or the ranked projection (hot_rank = DENSE_RANK over hotness_score):
SELECT func_name, printf('0x%X', func_addr) AS addr, hot_rank, hotness_score
FROM function_metrics_ranked
ORDER BY hot_rank
LIMIT 20;
Most called functions:
SELECT dst_func_name, printf('0x%X', dst_func_addr) AS addr, COUNT(*) AS caller_count
FROM callgraph_edges
GROUP BY dst_func_addr, dst_func_name
ORDER BY caller_count DESC
LIMIT 20;
String-heavy functions:
SELECT func_name, printf('0x%X', func_addr) AS addr, COUNT(*) AS string_count
FROM string_refs
GROUP BY func_addr, func_name
ORDER BY string_count DESC
LIMIT 20;
Functions calling a suspicious import:
SELECT DISTINCT src_func_name, printf('0x%X', src_func_addr) AS addr
FROM callgraph_edges
WHERE dst_func_name LIKE '%Crypt%'
ORDER BY src_func_name;
Ghidra's analyzer set is program data, exposed as three tables:
| Table | Columns | Writes |
|---|---|---|
program_options | option_key, option_value, value_type, option_scope, description, default_value, settable, allowed_values | UPDATE option_value on settable = 1 rows |
analysis_passes | pass_id, mode, state, started_unix_ms, ended_unix_ms, elapsed_ms, message | INSERT (mode) starts a job; DELETE of the running row cancels it |
transactions | tx_position, tx_name, tx_kind, open_subtransactions | read-only |
option_scope is the Ghidra option category. Analyzer settings are the
'Analyzers' rows: an analyzer's on/off toggle is the boolean row whose key
has no .; dotted keys (Decompiler Parameter ID.Analysis Decompiler Timeout (sec)) are its sub-options. Other categories (Program Information, ...) are
read-only.value_type is boolean, int, long, double, float, string, enum,
file, ... An enum takes one of the constants in allowed_values (a JSON
array — json_each(allowed_values) expands it). A value the type rejects fails
the statement; nothing is silently ignored.mode is 'all' (re-run every enabled analyzer over the whole program) or
'changed' (the default: only the work queued by edits made since the program
was opened — usually nothing right after opening).See what can be tuned:
SELECT option_key, option_value, value_type, description
FROM program_options
WHERE option_scope = 'Analyzers' AND settable = 1
AND value_type = 'boolean' AND option_key NOT LIKE '%.%'
ORDER BY option_key;
Switch off analyzers that do not apply to the target and re-analyze:
UPDATE program_options SET option_value = 'false'
WHERE option_scope = 'Analyzers' AND option_key LIKE 'Objective-C%';
INSERT INTO analysis_passes(mode) VALUES ('all');
SELECT pass_id, state, elapsed_ms, message
FROM analysis_passes ORDER BY pass_id DESC LIMIT 1; -- repeat until not 'running'
SELECT save_database(); -- keep the new options
Set a typed sub-option or an enum:
UPDATE program_options SET option_value = '120'
WHERE option_key = 'Decompiler Parameter ID.Analysis Decompiler Timeout (sec)';
SELECT allowed_values FROM program_options
WHERE option_key = 'ASCII Strings.Minimum String Length';
Audit what changed in this session:
SELECT tx_position, tx_name FROM transactions
WHERE tx_kind = 'undo' ORDER BY tx_position LIMIT 10;
For a fresh import, pass the same choice up front instead:
--binary target --analyzers-off 'Objective-C,Shared Return' (see connect).
Performance. A job holds the program exclusively: until it finishes, every
query except analysis_passes fails fast with analysis_running. A full pass on
a large binary can take many minutes, so start it deliberately and poll. Cancel
with DELETE FROM analysis_passes WHERE state = 'running'; — the work already
done is kept.
Do not strip analyzers blindly. Turning off parameter/type recovery (for
example Decompiler Parameter ID) makes functions decompile with undefined8
and unaff_* noise. Disable what demonstrably does not apply to the target.
callgraph_edges, callers, callees, and string_refs over rebuilding those joins yourself.decompiler or annotations.--binary-imported PE resolve by name by default, but external
system libraries are not loaded (fast imports). If an import shows as an ordinal
or a callee to a library function is unresolved, re-import with --load-libraries.LIMITdecompileranalysis_running:
analysis_passes until it is done,
or cancel it with DELETE FROM analysis_passes WHERE state = 'running'UPDATE program_options fails:
settable and value_type for that row; an enum needs one of its
allowed_values, and only Analyzers options are writableWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
binary-analysis, ghidrasql, reverse-engineering, sql-queries
/ghidrasql:analysisfrom ghidrasql
npx claudepluginhub 0xeb/ghidrasql-skills --plugin ghidrasql12 skills in this plugin
/debuggerManage breakpoints and patch bytes through ghidrasql — the breakpoints table and bytes single-byte UPDATE.Other plugins' skills for the same job