types
Binary Ninja type system via SQL: structs, unions, enums, typedefs, function signatures. All writable; remember SELECT save().
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Binary Ninja type system via SQL: structs, unions, enums, typedefs, function signatures. All writable; remember SELECT save().
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Connect to Binary Ninja databases and bootstrap sessions. Use when starting analysis, routing to other skills, or setting up CLI/HTTP/MCP connections.
Query Binary Ninja strings, bytes, and binary patterns. Use search_bytes() for native fast pattern search.
Complete bnsql SQL function reference catalog.
BNSQL analysis workflows: triage, security audit, crypto/network detection, multi-table queries.
Edit Binary Ninja databases: comments, renames, types, patches. Mutations require SELECT save() to persist (explicit-save model, v0.0.9+).
Decompile Binary Ninja functions via HLIL: pseudocode text, local variables, call sites. Always filter by func_addr.
| name | types |
| description | Binary Ninja type system via SQL: structs, unions, enums, typedefs, function signatures. All writable; remember SELECT save(). |
| allowed-tools | ["Bash","Read","Glob","Grep"] |
| Table | Description |
|---|---|
types | All defined types (structs, unions, enums, typedefs, function prototypes) |
type_members | Struct/union member fields |
type_enum_values | Enum member values |
func_signatures | Per-function parameter and return type info |
types_v_structs | Convenience view: structs only |
types_v_enums | Convenience view: enums only |
All are writable (INSERT/UPDATE/DELETE) and follow the explicit-save model —
call SELECT save(); to persist.
Use PRAGMA table_xinfo(<table>) to confirm the live column shape before
authoring complex queries.
SELECT
SUM(is_struct) AS structs,
SUM(is_enum) AS enums,
SUM(is_typedef) AS typedefs,
SUM(is_func) AS func_protos
FROM types;
PRAGMA table_xinfo(type_members);
SELECT offset, name, type, size
FROM type_members
WHERE type_name = 'PACKET_HEADER'
ORDER BY offset;
SELECT name, value
FROM type_enum_values
WHERE enum_name = 'IRP_MJ'
ORDER BY value;
SELECT arg_index, name, type
FROM func_signatures
WHERE func_addr = 0x401000
ORDER BY arg_index;
Create a struct:
INSERT INTO types(name, is_struct) VALUES ('MY_HEADER', 1);
INSERT INTO type_members(type_name, offset, name, type)
VALUES
('MY_HEADER', 0, 'magic', 'uint32_t'),
('MY_HEADER', 4, 'length', 'uint32_t'),
('MY_HEADER', 8, 'data', 'char[1]');
SELECT save();
Create an enum:
INSERT INTO types(name, is_enum) VALUES ('ERROR_CODE', 1);
INSERT INTO type_enum_values(enum_name, name, value) VALUES
('ERROR_CODE', 'SUCCESS', 0),
('ERROR_CODE', 'INVALID', 1),
('ERROR_CODE', 'NOT_FOUND', 2);
SELECT save();
UPDATE hlil_vars
SET type = 'MY_HEADER *'
WHERE func_addr = 0x401000 AND name = 'packet';
SELECT save();
-- Functions whose first parameter is a specific struct
SELECT func_addr, hex(func_addr) AS addr
FROM func_signatures
WHERE arg_index = 0
AND type LIKE '%PIRP%';
annotations for applying types to variables and renamingdecompiler for inspecting variables before retyping