Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bn-headless

БесплатноЗапускает вложенные скриптыНе проверен

Headless Binary Ninja CLI for decompiling and reverse-engineering compiled binaries without the GUI. Use when you need to decompile, disassemble, read…

BrownFineSecurityот BrownFineSecurity★ 895 звёзд на GitHub

Об этом скилле

Binary Ninja Headless (bnhl)

You are helping the user reverse-engineer compiled binaries from the command line using Binary Ninja's headless API, with no GUI involved. This covers firmware executables, shared libraries, and any ELF/PE/Mach-O or raw binary across any architecture Binary Ninja lifts.

Tool Overview

bnhl is a self-contained CLI wrapper (scripts/bnhl.py) around the Binary Ninja Python API. It loads any file on disk, runs full analysis, caches the result, and prints readable output to stdout. It is the right tool when you want to:

  • Decompile functions to pseudo-C (or HLIL / MLIL / disassembly)
  • List and filter functions by name
  • Follow cross-references (callers) and callees
  • Dump strings and jump straight to the code that references them
  • Enumerate imports, exports, and sections
  • Batch-analyze many binaries in a script, headless

For reading compiled code, bnhl is far more productive than raw objdump, gdb, or radare2 because it gives you readable decompilation and a resolved call graph.

When to use CLI vs the GUI

Use bnhl (CLI) for automated analysis, scripting, batch processing, headless/server environments, and any self-directed decompilation. Use the Binary Ninja GUI (or its MCP server) only for interactive, manual exploration when the user explicitly asks for it, because the GUI only sees the one binary an operator has loaded by hand.

Prerequisites

  • A licensed Binary Ninja (Commercial, Enterprise, or Ultimate). The free/demo edition does not ship the headless Python API. Binary Ninja is commercial software licensed separately from this toolkit; the skill is inert without it.
  • A license that validates locally needs no enterprise-server checkout and runs fine alongside a running GUI instance.
  • Python 3. The script locates the Binary Ninja Python API itself and injects it onto sys.path, so no PYTHONPATH setup is needed.

Pointing the script at your Binary Ninja install

bnhl autodetects the API in these locations, in order:

  1. $BN_PYTHON (your install's python directory), if set
  2. $BN_INSTALL_DIR/python, if BN_INSTALL_DIR is set
  3. ~/binaryninja/python
  4. /opt/binaryninja/python
  5. /Applications/Binary Ninja.app/Contents/Resources/python (macOS)

If your install is elsewhere, set the env var once:

export BN_PYTHON="/path/to/binaryninja/python"

Running It

Invoke through the bnhl shim in this repo's bin/ (add bin/ to your PATH):

bnhl <command> <bin> [args]

If bnhl is not on your PATH, call the script directly:

python3 skills/bn-headless/scripts/bnhl.py <command> <bin> [args]

Commands

Command What it does
info <bin> arch, platform, entry, function/string/import counts, sections
functions <bin> [--filter REGEX] [--limit N] list functions (addr, size, name)
decompile <bin> <func|0xADDR> [more...] [--il pseudoc|hlil|mlil|disasm] decompile one or more functions (default: pseudo-C)
at <bin> <0xADDR> decompile whichever function contains an address
xrefs <bin> <func|0xADDR> callers + code references to the target
callees <bin> <func|0xADDR> functions the target calls
strings <bin> [--filter REGEX] [--min N] dump strings
grepstr <bin> <REGEX> strings matching REGEX plus the functions that reference each
imports <bin> / exports <bin> / sections <bin> symbol / section inventory

func selector: an exact symbol name, a unique substring of a name, or a hex address (0x...). Most commands also accept --raw for machine-readable JSON where supported.

Typical RE Flow

bnhl info      ./libtarget.so                       # orient: arch, counts, sections
bnhl grepstr   ./libtarget.so 'password|secret|/dev' # interesting constants + their handlers
bnhl functions ./libtarget.so --filter -i auth       # find the auth functions
bnhl decompile ./libtarget.so handle_cmd             # read the pseudo-C
bnhl xrefs     ./libtarget.so is_privileged          # trace an authz gate's callers
bnhl decompile ./libtarget.so 0x823b1                # or decompile by address

What to look for in decompiled code

  • Command injection via system() / popen() / exec*() with attacker-influenced strings
  • Hardcoded keys, credentials, and backdoor comparisons
  • Stack buffer overflows (strcpy, sprintf, memcpy with unchecked lengths)
  • Format string bugs (printf-family with a non-constant format argument)
  • Integer overflows feeding allocation or copy sizes
  • Missing or broken authentication/authorization checks
  • Debug/diagnostic interfaces left enabled

Performance & Caching

The first analysis of a binary is cached to a .bndb under ~/.cache/bnhl/ (override with $BNHL_CACHE), keyed by path + mtime + size. Repeat calls on the same binary are near-instant. A small .so analyzes in under a second cold; a few-hundred-KB daemon with ~1000 functions takes sev

Полный SKILL.md на GitHub

Установить bn-headless в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

scripts/bnhl.py

FAQ

Что делает скилл bn-headless?

Headless Binary Ninja CLI for decompiling and reverse-engineering compiled binaries without the GUI. Use when you need to decompile, disassemble, read pseudo-C/HLIL/MLIL, follow xrefs and callees, dump strings and the code that references them, enumerate imports/exports/sections, or hunt a vulnerability in any ELF/PE/Mach-O/raw binary across any architecture (x86, MIPS, ARM, aarch64, PPC, RISC-V).

Как установить скилл bn-headless?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bn-headless запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить bn-headless с