/bnsql:annotationsfrom bnsql
Edit Binary Ninja databases: comments, renames, types, patches. Mutations require SELECT save() to persist (explicit-save model, v0.0.9+).
Ships in bnsql. 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.
BNSQL opens the database read-mostly. Mutations are applied in-memory but are
not written to disk until SELECT save(); is called.
UPDATE funcs SET name = 'main' WHERE addr = 0x401000;
SELECT save(); -- without this, the edit is lost on exit
This applies to every mutation: UPDATE/INSERT/DELETE on writable tables,
plus set_name() / set_comment() UDFs.
SELECT (precision before edit).set_* UDF).SELECT save(); to persist.| Surface | Operations | Columns |
|---|---|---|
funcs | INSERT/UPDATE/DELETE | name, prototype, comment; INSERT creates a function via BN API |
segments | INSERT/UPDATE/DELETE | start_addr, end_addr, perm (user segments; a memory region's row: DELETE/perm only; loader-defined rows: perm only) |
names | INSERT/UPDATE/DELETE | name (global rename) |
comments | INSERT/UPDATE/DELETE | comment |
bookmarks | INSERT/UPDATE/DELETE | comment (BN user data Tags; type set at INSERT, default Bookmarks; category must be NULL/empty because BN has no category sub-level) |
pseudocode | UPDATE/DELETE-clear | comment |
hlil_vars | UPDATE/DELETE-clear | name, type, comment |
types, type_members, type_enum_values | INSERT/UPDATE/DELETE | Type system edits |
patches | INSERT/UPDATE/DELETE | Byte-level patches |
Plus UDFs: set_name(addr, name), set_comment(addr, text).
SELECT name FROM funcs WHERE addr = 0x401000;
UPDATE funcs SET name = 'parse_packet' WHERE addr = 0x401000;
SELECT name FROM funcs WHERE addr = 0x401000;
SELECT save();
SELECT comment FROM comments WHERE addr = 0x401000;
INSERT INTO comments(addr, comment) VALUES (0x401000, 'Entry point dispatcher');
SELECT save();
Or via UDF:
SELECT set_comment(0x401000, 'Entry point dispatcher');
SELECT save();
UPDATE hlil_vars
SET name = 'packet_len'
WHERE func_addr = 0x401000 AND reg = 'rdi';
SELECT save();
UPDATE hlil_vars
SET type = 'PACKET_HEADER *'
WHERE func_addr = 0x401000 AND name = 'packet_len';
SELECT save();
sub_* functions matching a patternUPDATE funcs
SET name = 'handler_' || printf('%X', addr)
WHERE name LIKE 'sub_%'
AND addr IN (
SELECT to_addr FROM xrefs
WHERE from_addr = (SELECT addr FROM funcs WHERE name = 'dispatcher_table')
);
SELECT save();
patched_byte is a scalar byte (0-255), one row per address — patch a NOP sled
one byte at a time:
INSERT INTO patches(addr, patched_byte) VALUES (0x401050, 0x90);
INSERT INTO patches(addr, patched_byte) VALUES (0x401051, 0x90);
INSERT INTO patches(addr, patched_byte) VALUES (0x401052, 0x90);
INSERT INTO patches(addr, patched_byte) VALUES (0x401053, 0x90);
SELECT save();
Use SELECT * FROM patches to inventory current patches; the original_byte
column preserves the pre-patch byte for safe revert via DELETE.
A hlil_vars name/type rename/retype reflects in the same session — the
next SELECT against hlil_vars (and pseudocode) shows the new name/type with
no decompile(addr, ..., refresh=1). The write marks the function for
re-analysis and the write statement's commit flushes analysis once, so a batch
rename/retype in a single UPDATE flushes exactly once (O(1)) and reads never
wait. Var/pseudocode comment writes are immediate metadata (no re-analysis).
decompiler for HLIL variable inspection before renametypes for type creationxrefs for finding the right targets before mutatingsave(): Edits succeed but vanish on exit. Always pair mutations
with SELECT save();.SELECT * FROM capabilities; for the live feature matrix.SELECT to confirm the target row exists.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub 0xeb/bnsql-skills --plugin bnsql11 skills in this plugin
/analysisBNSQL analysis workflows: triage, security audit, crypto/network detection, multi-table queries./connectConnect to Binary Ninja databases and bootstrap sessions. Use when starting analysis, routing to other skills, or setting up CLI/HTTP/MCP connections./dataQuery Binary Ninja strings, bytes, and binary patterns. Use the byte_search table for fast byte-pattern search./decompilerDecompile Binary Ninja functions via HLIL: pseudocode text, local variables, call sites. Always filter by func_addr./disassemblyQuery Binary Ninja disassembly: functions, segments, instructions, blocks. Use for code-level analysis and instruction inspection./functionsComplete bnsql SQL function reference catalog.