Binary Ninja Analysis Skill
When to Use
Use this skill when working with Binary Ninja via the BinjaMCP server to analyze binaries. This includes:
- Loading and analyzing binary files (ELF, PE, Mach-O, etc.)
- Decompiling functions and understanding decompiler output
- Reading or interpreting Binary Ninja Intermediate Language (BNIL) output at any level (LLIL, MLIL, HLIL)
- Reverse engineering functions, understanding control flow, or tracing data flow
- Annotating binaries (renaming functions/variables, setting comments, applying types)
- Searching for strings, imports, exports, or cross-references
- Understanding the structure of a binary (sections, segments, symbols)
When NOT to Use
Do not use this skill when the task does not involve binary analysis or reverse engineering with Binary Ninja. If you are writing Binary Ninja plugins in Python (not using the MCP server), this skill's MCP tool reference may not apply but the BNIL documentation is still relevant.
You must never use this skill unless the MCP server is available and the task involves interacting with Binary Ninja's analysis capabilities. If the task is purely theoretical or does not involve Binary Ninja, this skill is not appropriate.
Runtime Requirements
Codex should be configured directly with a mcp_servers.binary_ninja_mcp entry for fosdickio/binary_ninja_mcp. Use command = "npx" and args = ["-y", "binary-ninja-mcp", "--host", "localhost", "--port", "9009"] unless the Binary Ninja plugin is listening elsewhere. This plugin does not install, start, or wrap the Binary Ninja MCP server. Verify the Binary Ninja MCP tools are visible under /mcp before using live analysis workflows.
Terminology
- BNIL - Binary Ninja Intermediate Language. The family of ILs used by Binary Ninja.
- LLIL - Low Level IL. Closest to assembly; operates on registers, flags, and memory addresses.
- MLIL - Medium Level IL. Translates registers to variables, associates types, propagates constants.
- HLIL - High Level IL. Decompiler output with recovered control flow (if/while/for/switch).
- SSA - Static Single Assignment. IL form where each variable is written exactly once; versions track modifications.
- BinaryView (bv) - Top-level analysis object representing a loaded binary.
- Function - A function identified by Binary Ninja, accessed by its start address.
- BasicBlock - A straight-line sequence of instructions with one entry and one exit.
- Cross-reference (xref) - A reference from one address to another (code or data).
MCP Server Overview
The BinjaMCP server exposes tools for interacting with Binary Ninja. Tools are grouped as:
| Category |
Tools |
Purpose |
| Lifecycle |
load_binary, list_loaded_binaries, close_binary |
Load/manage binaries |
| Functions |
list_functions, search_functions, get_function_info, get_function_type |
Discover and inspect functions |
| IL / Decompilation |
decompile_function, get_hlil, get_mlil, get_llil, get_disassembly |
View code at different abstraction levels |
| Strings |
list_strings, search_strings |
Find string data |
| Cross-refs |
get_xrefs_to, get_xrefs_from, get_function_callers, get_function_callees |
Trace references and call graphs |
| Imports/Exports |
list_imports, search_imports, list_exports |
Inspect symbol tables |
| Structure |
list_sections, list_segments |
Understand binary layout |
| Annotation |
rename_function, rename_variable, set_comment, set_function_comment, set_function_type |
Annotate the binary |
| Variables/Data |
list_variables, list_data_variables, get_data_var_at, get_basic_blocks |
Inspect variables, globals, CFG |
| Raw Data |
read_bytes |
Read raw memory |
Choosing an IL Level
- HLIL (
decompile_function / get_hlil): Best for initial understanding. Recovers if/while/for/switch. Use for vulnerability analysis, logic review, and getting a high-level picture. Note: tree-based, so nested expressions can hide instructions.
- MLIL (
get_mlil): Best for precise analysis. Variables have types, constants are propagated, call parameters are resolved. Less folding than HLIL so easier to iterate linearly. Preferred for data flow tracing.
- LLIL (
get_llil): Best for low-level analysis. Shows register/flag operations, stack manipulation. Use when you need to understand exact instruction semantics or flag behavior.
- Disassembly (
get_disassembly): Raw native instructions. Use when IL abstractions lose important detail (e.g., specific instruction encodings, alignment).
Recommended Analysis Workflow
- Load:
load_binary to open the target
- Survey:
list_functions + list_imports + list_strings to understand scope
- Target:
search_functions or search_strings to find areas of interest
- Analyze:
decompile_function for initial understanding, then get_mlil or get_llil for precision
- Trace:
get_xrefs_to / get_function_callers to understand how a function is reached
- Annotate:
rename_function, rename_variable, set_comment to document findings
- Iterate: Use cross-references and call graphs to follow the analysis deeper
Context Efficiency Tips
- Use
search_functions / search_strings / search_imports instead of listing everything
- Start with
decompile_function (HLIL pseudo-C) before falling back to lower ILs
- Use
get_function_info to get metadata (size, callers, callees) before reading full IL
- Use pagination (
offset/limit) on list_functions and list_strings for large binaries
- Prefer
get_function_callers/get_function_callees over raw xref queries for call graph analysis
References
For detailed information on specific areas, consult the Reference Index.
Key references:
- Reference Index - Master index of all documentation
- BNIL Overview - IL family overview, notation, and reading guide
- LLIL Reference - Low Level IL instruction set
- MLIL Reference - Medium Level IL instruction set, variables, and types
- HLIL Reference - High Level IL instruction set with control flow recovery
- Important Concepts - BinaryView, IL walking, SSA, mapping between ILs
- Cookbook - Common analysis recipes and patterns
- Annotations - Symbols, types, tags, and type application
- MCP Tools Reference - Complete reference for all BinjaMCP server tools
1---2name: binary-ninja-mcp-analysis3description: Provides Binary Ninja IL documentation and MCP server usage guidance for binary analysis and reverse engineering4license: MIT5---67# Binary Ninja Analysis Skill89## When to Use1011Use this skill when working with Binary Ninja via the BinjaMCP server to analyze binaries. This includes:1213- Loading and analyzing binary files (ELF, PE, Mach-O, etc.)14- Decompiling functions and understanding decompiler output15- Reading or interpreting Binary Ninja Intermediate Language (BNIL) output at any level (LLIL, MLIL, HLIL)16- Reverse engineering functions, understanding control flow, or tracing data flow17- Annotating binaries (renaming functions/variables, setting comments, applying types)18- Searching for strings, imports, exports, or cross-references19- Understanding the structure of a binary (sections, segments, symbols)2021## When NOT to Use2223Do not use this skill when the task does not involve binary analysis or reverse engineering with Binary Ninja. If you are writing Binary Ninja plugins in Python (not using the MCP server), this skill's MCP tool reference may not apply but the BNIL documentation is still relevant.2425You must never use this skill unless the MCP server is available and the task involves interacting with Binary Ninja's analysis capabilities. If the task is purely theoretical or does not involve Binary Ninja, this skill is not appropriate.2627## Runtime Requirements2829Codex should be configured directly with a `mcp_servers.binary_ninja_mcp` entry for `fosdickio/binary_ninja_mcp`. Use `command = "npx"` and `args = ["-y", "binary-ninja-mcp", "--host", "localhost", "--port", "9009"]` unless the Binary Ninja plugin is listening elsewhere. This plugin does not install, start, or wrap the Binary Ninja MCP server. Verify the Binary Ninja MCP tools are visible under `/mcp` before using live analysis workflows.3031## Terminology3233- **BNIL** - Binary Ninja Intermediate Language. The family of ILs used by Binary Ninja.34- **LLIL** - Low Level IL. Closest to assembly; operates on registers, flags, and memory addresses.35- **MLIL** - Medium Level IL. Translates registers to variables, associates types, propagates constants.36- **HLIL** - High Level IL. Decompiler output with recovered control flow (if/while/for/switch).37- **SSA** - Static Single Assignment. IL form where each variable is written exactly once; versions track modifications.38- **BinaryView (bv)** - Top-level analysis object representing a loaded binary.39- **Function** - A function identified by Binary Ninja, accessed by its start address.40- **BasicBlock** - A straight-line sequence of instructions with one entry and one exit.41- **Cross-reference (xref)** - A reference from one address to another (code or data).4243## MCP Server Overview4445The BinjaMCP server exposes tools for interacting with Binary Ninja. Tools are grouped as:4647| Category | Tools | Purpose |48|----------|-------|---------|49| Lifecycle | `load_binary`, `list_loaded_binaries`, `close_binary` | Load/manage binaries |50| Functions | `list_functions`, `search_functions`, `get_function_info`, `get_function_type` | Discover and inspect functions |51| IL / Decompilation | `decompile_function`, `get_hlil`, `get_mlil`, `get_llil`, `get_disassembly` | View code at different abstraction levels |52| Strings | `list_strings`, `search_strings` | Find string data |53| Cross-refs | `get_xrefs_to`, `get_xrefs_from`, `get_function_callers`, `get_function_callees` | Trace references and call graphs |54| Imports/Exports | `list_imports`, `search_imports`, `list_exports` | Inspect symbol tables |55| Structure | `list_sections`, `list_segments` | Understand binary layout |56| Annotation | `rename_function`, `rename_variable`, `set_comment`, `set_function_comment`, `set_function_type` | Annotate the binary |57| Variables/Data | `list_variables`, `list_data_variables`, `get_data_var_at`, `get_basic_blocks` | Inspect variables, globals, CFG |58| Raw Data | `read_bytes` | Read raw memory |5960## Choosing an IL Level6162- **HLIL** (`decompile_function` / `get_hlil`): Best for initial understanding. Recovers if/while/for/switch. Use for vulnerability analysis, logic review, and getting a high-level picture. Note: tree-based, so nested expressions can hide instructions.63- **MLIL** (`get_mlil`): Best for precise analysis. Variables have types, constants are propagated, call parameters are resolved. Less folding than HLIL so easier to iterate linearly. Preferred for data flow tracing.64- **LLIL** (`get_llil`): Best for low-level analysis. Shows register/flag operations, stack manipulation. Use when you need to understand exact instruction semantics or flag behavior.65- **Disassembly** (`get_disassembly`): Raw native instructions. Use when IL abstractions lose important detail (e.g., specific instruction encodings, alignment).6667## Recommended Analysis Workflow68691. **Load**: `load_binary` to open the target702. **Survey**: `list_functions` + `list_imports` + `list_strings` to understand scope713. **Target**: `search_functions` or `search_strings` to find areas of interest724. **Analyze**: `decompile_function` for initial understanding, then `get_mlil` or `get_llil` for precision735. **Trace**: `get_xrefs_to` / `get_function_callers` to understand how a function is reached746. **Annotate**: `rename_function`, `rename_variable`, `set_comment` to document findings757. **Iterate**: Use cross-references and call graphs to follow the analysis deeper7677## Context Efficiency Tips7879- Use `search_functions` / `search_strings` / `search_imports` instead of listing everything80- Start with `decompile_function` (HLIL pseudo-C) before falling back to lower ILs81- Use `get_function_info` to get metadata (size, callers, callees) before reading full IL82- Use pagination (`offset`/`limit`) on `list_functions` and `list_strings` for large binaries83- Prefer `get_function_callers`/`get_function_callees` over raw xref queries for call graph analysis8485## References8687For detailed information on specific areas, consult the [Reference Index](./references/INDEX.md).8889Key references:9091* [Reference Index](./references/INDEX.md) - Master index of all documentation92* [BNIL Overview](./references/bnil-overview.md) - IL family overview, notation, and reading guide93* [LLIL Reference](./references/bnil-llil.md) - Low Level IL instruction set94* [MLIL Reference](./references/bnil-mlil.md) - Medium Level IL instruction set, variables, and types95* [HLIL Reference](./references/bnil-hlil.md) - High Level IL instruction set with control flow recovery96* [Important Concepts](./references/concepts.md) - BinaryView, IL walking, SSA, mapping between ILs97* [Cookbook](./references/cookbook.md) - Common analysis recipes and patterns98* [Annotations](./references/annotations.md) - Symbols, types, tags, and type application99* [MCP Tools Reference](./references/mcp-tools.md) - Complete reference for all BinjaMCP server tools