decompiler
Decompile Binary Ninja functions via HLIL: pseudocode text, local variables, call sites. Always filter by func_addr.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Decompile Binary Ninja functions via HLIL: pseudocode text, local variables, call sites. Always filter by func_addr.
用 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+).
Query Binary Ninja disassembly: functions, segments, instructions, blocks. Use for code-level analysis and instruction inspection.
| name | decompiler |
| description | Decompile Binary Ninja functions via HLIL: pseudocode text, local variables, call sites. Always filter by func_addr. |
| allowed-tools | ["Bash","Read","Glob","Grep"] |
Binary Ninja's High Level IL is the closest thing to C-like pseudocode in BN. BNSQL exposes it through one SQL function and three tables.
| Surface | Description | Required filter |
|---|---|---|
decompile(addr) UDF | Full-function decompiled text | — (single address) |
decompile(addr, limit) UDF | Limit-aware variant | — |
pseudocode table | Line-level filtering by func_addr / ea | func_addr = X |
hlil_vars table | Local variables; writable (name, type, comment) | func_addr = X |
hlil_calls table | Call sites discovered in HLIL | func_addr = X |
Always filter decompiler tables by func_addr — without it, BN
decompiles every function in the binary.
-- Full function as one text block
SELECT decompile(0x401000);
-- Limit to 40 lines (good for surveys)
SELECT decompile(0x401000, 40);
SELECT name, type, storage
FROM hlil_vars
WHERE func_addr = 0x401000;
SELECT DISTINCT callee_name
FROM hlil_calls
WHERE func_addr = 0x401000;
SELECT line_text
FROM pseudocode
WHERE func_addr = 0x401000
AND line_text LIKE '%CreateFile%';
SELECT DISTINCT func_at(func_addr) AS caller
FROM hlil_calls
WHERE callee_name = 'malloc';
hlil_vars is writable on name, type, comment. Apply edits inside
the mutation loop:
-- 1. Read current state
SELECT name, type FROM hlil_vars
WHERE func_addr = 0x401000 AND storage = 'var_8';
-- 2. Apply mutation
UPDATE hlil_vars
SET name = 'user_buffer', type = 'char *'
WHERE func_addr = 0x401000 AND storage = 'var_8';
-- 3. Re-read to verify
SELECT name, type FROM hlil_vars
WHERE func_addr = 0x401000 AND storage = 'var_8';
-- 4. Persist
SELECT save();
Writes to hlil_vars, pseudocode, or names that affect a function
invalidate the decompiler cache for that function. The next decompile re-runs
HLIL on the updated state — no manual refresh needed.
annotations for the broader mutation workflow (renames, comments, types)xrefs for the surrounding call graph contexttypes for type creation and application to variablesDecompiler tables are on-demand virtual tables — each row requires
decompiling its containing function. Unconstrained queries iterate every
function and decompile each one. On a medium binary that's minutes-to-hours.
Always pin to a specific func_addr.