Reference for ghidrasql SQL functions: decompiler queries, type import, full-text search, and type analysis helpers.
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.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/ghidrasql:functionsfrom ghidrasql
npx claudepluginhub 0xeb/ghidrasql-skills --plugin ghidrasqlUse this skill when the user asks:
Route to:
decompiler for pseudocode and decompiler-table workflowstypes for parse_decls() and signature-related workannotations for full mutation loopsgrep for full-text search functions (search_*)ghidrasql registers 21 distinct names, 22 entries (search_snippet registers at arity 2 and 3). 18 are general-purpose helpers; 3 are cache-control helpers.
There is no shutdown(...) function — set the exit policy at launch via --shutdown and trigger the stop with POST /shutdown. There is deliberately no redundant decompile(...) SQL helper: an exact-address lookup on pseudocode is the pushdown operation. Use SELECT text FROM pseudocode WHERE func_addr = ... AND completed = 1 AND is_fallback = 0; use refresh_database() only when the underlying source needs an explicit reload.
SELECT text FROM pseudocode WHERE func_addr = 0x401000; -- full pseudocode text
SELECT rename_local(0x401000, '<local_id>', 'buffer'); -- == UPDATE decomp_lvars SET name
SELECT set_local_type(0x401000, '<local_id>', 'char *'); -- == UPDATE decomp_lvars SET type
SELECT parse_decls('typedef struct { int x; int y; } Point;');
-- (haystack, query) are the two text arguments; these examples use literals so
-- they run as-is — swap in a column (e.g. a `strings.value`) for real searches.
SELECT normalize_text('SomeMixed_Case'); -- canonical form
SELECT search_match('the quick brown fox', 'quick fox'); -- 0/1 — every term matches
SELECT search_score('the quick brown fox', 'quick fox'); -- relevance score
SELECT search_snippet('the quick brown fox', 'fox'); -- snippet, default radius
SELECT search_snippet('the quick brown fox', 'fox', 10); -- snippet, custom radius
SELECT search_rank('strings', 'the quick brown fox', 'fox'); -- domain-weighted rank
SELECT type_family('struct foo { int x; }'); -- aggregate|enum|alias|...
SELECT type_is_pointer('char *'); -- 0/1
SELECT type_strip_cv('const volatile int *'); -- strips const/volatile
SELECT hex(0x401000); -- '0x401000'
SELECT program_revision(); -- Ghidra native modification number
SELECT string_count(); -- live string-table size
SELECT rebuild_strings(); -- refresh string table
SELECT save_database(); -- optional explicit checkpoint
SELECT discard_changes(); -- roll back pending mutations
SELECT refresh_database(); -- explicitly reload the source
Table materialisation is query scoped and cannot survive a statement. These names remain for compatibility and diagnostics; they are not needed for freshness:
SELECT cache_stats(); -- compatibility/introspection JSON
SELECT cache_invalidate('pseudocode'); -- compatibility no-op for query-scoped tables
SELECT cache_invalidate_all(); -- compatibility no-op for query-scoped tables
rename_local() / set_local_type() when a function-shaped
call is clearer than UPDATE decomp_lvars.parse_decls() for any C declaration import — it goes through
Ghidra's CParser and avoids per-row INSERTs.save_database() when a periodic checkpoint is useful; it is callable at
any point in interactive or headless operation. Do not flush after every
mutation. Normal managed shutdown saves once by default.save_database() is operator-requested only.pseudocode, decomp_lvars, decomp_tokens) even when you went
through a helper function. Use func_addr; exact func_name is also
pushed down for pseudocode and decomp_lvars reads.12 skills in this plugin
/analysisAnalyze binaries with ghidrasql using safe, high-signal query patterns./annotationsApply persistent ghidrasql annotations such as names, comments, signatures, and local-variable edits./connectConnect to ghidrasql sources, verify live access, and route to the right analysis skill./dataQuery strings, bytes, data items, memory blocks, and relocations through ghidrasql./debuggerManage breakpoints and patch bytes through ghidrasql — the breakpoints table and bytes single-byte UPDATE./decompilerDecompile functions with ghidrasql and work with pseudocode, locals, parameters, and ctree pattern views safely.Other plugins' skills for the same job