meltedinhex/analyst-ai-pack / skills/reverse-engineering-binaries-with-binary-ninja
reverse-engineering-binaries-with-binary-ninja
VerifiedReverse engineers binaries with Binary Ninja using its analysis stack and Python API to enumerate functions, navigate IL levels (LLIL/MLIL/HLIL), and automate annotation and extraction. Activates for requests to reverse a binary with Binary Ninja, script the Binary Ninja API, or work with its intermediate languages.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 2.9 KB |
| references/api-reference.md | markdown | 1.2 KB |
| scripts/analyst.py | script | 2.6 KB |
SKILL.md
View on GitHub---
name: reverse-engineering-binaries-with-binary-ninja
description: 'Reverse engineers binaries with Binary Ninja using its analysis stack and Python API
to enumerate functions, navigate IL levels (LLIL/MLIL/HLIL), and automate annotation and
extraction. Activates for requests to reverse a binary with Binary Ninja, script the Binary Ninja
API, or work with its intermediate languages.'
domain: cybersecurity
subdomain: reverse-engineering
tags:
- reverse-engineering
- binary-ninja
- il
- automation
- static-analysis
version: 1.0.0
author: analyst-ai-pack
license: Apache-2.0
mitre_attack:
- T1027
- T1059
- T1587.001
d3fend:
- D3-DA
- D3-SDA
references:
- 'Binary Ninja Python API documentation — https://api.binary.ninja/'
- 'Binary Ninja IL (LLIL/MLIL/HLIL) guide — https://docs.binary.ninja/dev/bnil-llil.html'
---
# Reverse Engineering Binaries With Binary Ninja
## When to Use
- You want to reverse a binary with Binary Ninja and automate analysis via its Python API
(function enumeration, IL traversal, annotation, extraction).
- You need to leverage MLIL/HLIL for cleaner analysis of obfuscated code.
**Do not use** the headless API to execute the sample — Binary Ninja performs static analysis. Run
in an isolated environment and treat inputs as malicious.
## Prerequisites
- Binary Ninja with the `binaryninja` Python API available (the script degrades gracefully and
generates a script skeleton if the API is not importable).
## Safety & Handling
- Static analysis does not execute the sample; keep inputs isolated.
## Workflow
### Step 1: Generate an analysis script skeleton
```bash
python scripts/analyst.py skeleton --emit functions,strings --out bn_extract.py
```
Emits a Binary Ninja Python script that opens a view, iterates functions, and exports
functions/strings to JSON using the real API (`open_view`, `bv.functions`, `bv.get_strings`).
### Step 2: Choose the IL level
Use LLIL for close-to-assembly, MLIL for variable/SSA reasoning, and HLIL for readable
pseudo-code; traverse instructions and operands programmatically.
### Step 3: Automate annotation
Rename symbols (`func.name`), add comments (`bv.set_comment_at`), and create tags for findings.
### Step 4: Run and aggregate
Execute the script (headless or in the UI console) and aggregate the JSON output.
## Validation
- The skeleton uses real API calls (`binaryninja.open_view`, `bv.functions`).
- The chosen IL level matches the analysis goal.
- Exported JSON contains plausible functions/strings.
## Pitfalls
- Headless licensing differences (Commercial vs Personal) affecting `open_view` availability.
- Confusing IL levels and operand structures across LLIL/MLIL/HLIL.
- Long analysis times on large binaries — scope function ranges.
## References
- See [`references/api-reference.md`](references/api-reference.md) for the skeleton generator.
- Binary Ninja API and IL docs (linked in frontmatter).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |