⚡ Rikune
Verified Reverse-Engineering Core Engine for AI Agents & Analysts
Stop guessing what binaries do — slice, decompile, micro-emulate, solve, and prove it.
English · 简体中文 · Architecture · Agent Skill · IDA / Ghidra Bridges · Changelog
v2.0+ is now
main! The legacy v1 TypeScript/Node monolith has been retired to thedeprecatedbranch (and frozen on tagv1-legacy).
Why Rikune v2?
Single-tool MCP bridges (ida-mcp, Binary Ninja MCP, GhidraMCP, r2mcp) are remote controls for static GUI databases — leaving AI agents to mentally guess crypto, obfuscation, packers, and branch logic.
Rikune v2 is a ground-up, native Python reverse-engineering engine built around a deterministic verification loop:
flowchart LR
A[Binary / Script Intake<br/>SHA-256 Read-Only Vault] --> B[Static Triage & Forensics<br/>PE/ELF/Mach-O/WASM/.NET/APK<br/>Crypto · Go/Rust · Data Xrefs]
B --> C[Token-Aware Graph Slice<br/>Entry ↔ API/String/Crypto Anchors<br/>Cached Rizin · Ghidra · IDE Bridge]
C --> D[Verification Loop<br/>Unicorn Ring-3 PEB/BCrypt/Stubs<br/>SMC/OEP Unpack · Batch Decrypt<br/>API-Hash · Z3 / angr]
D --> E[Live Overlay & Lineage<br/>Verified Renames · Types · Values<br/>Derived Child Payloads]
E --> C
E --> F[Two-Way Export<br/>IDA · Ghidra · Rizin<br/>Markdown · JSON · Live GUI Sync]
What Makes It Different
| Pillar | What Rikune v2 Delivers |
|---|---|
| 🔬 Verification-First | Map real PE/ELF/Mach-O segments into Unicorn with Win64 Ring-3 GDT (CS=0x33/SS=0x2B), TLS, KUSER_SHARED_DATA, synthetic ntdll/kernel32/bcrypt PE export tables (real SHA-256/HMAC + Win10 syscall prologues), non-invasive hook_returns/hook_skips, and automatic SMC/OEP unpacking with auto-persisted IAT annotations. |
| 🧠 Token Economics | Never dump 5,000 functions into an LLM context. Rank high-signal code, slice shortest Entry → Sink paths from string, direct-IAT API, or detected crypto-constant anchors (AES/RC5/ChaCha20/SHA256/CRC32/SM4/TEA), and auto-spill oversized outputs to paginated artifacts. |
| 🔁 Live Overlay & Two-Way IDE Interop | Verified renames, C prototypes/structs (type), and decoded strings automatically overlay onto every subsequent read — and can be exported safely to IDA Python / Ghidra / Rizin / Markdown / JSON or pushed directly back into live IDA Pro / Ghidra GUI sessions. |
| 🌳 Non-Destructive Lineage | Unpack UPX, dump dirty Unicorn sections (--derive-image), carve embedded PE/ELF/ZIP/Base85+Gzip payloads, or apply nop/invert_branch patches into immutable parent→child lineage trees. |
| 🛡️ Native, Lean & Safe | Runs natively on macOS (Apple Silicon & Intel), Linux, and Windows via Python + uv. Built-in untrusted-binary prompt-injection guard in ResponseGuard. Optional Docker container for untrusted malware isolation. |
v1 (deprecated) vs. v2 (main)
| Dimension | v1 (deprecated / v1-legacy) |
v2 (main) |
|---|---|---|
| Codebase & Architecture | ~435k LOC TypeScript + 7.7k-line Python worker + 117 plugins | Clean, modular native Python (uv), zero IPC glue |
| Tool Surface | ~355 tools (many plan-only stubs) + 4 meta-discovery proxies |
32 real executable primitives + lightweight tool_search + 3 Prompts + 3 Resources |
| Persistence | 24 SQLite tables + heartbeat lease locks | 5 clean SQLite tables (incl. persistent backend_cache) + .rzdb cache |
| Platform Support | Linux-kernel / linux/amd64 Docker only |
Native macOS (arm64/x64), Linux, Windows + optional Docker |
| Packaging | Heavy multi-stage Node + Python + 21 Dockerfiles | 216 KB pure-Python wheel + single ghcr.io core image |
Quick Start
1. Install (Zero-Venv, Out-of-the-Box)
# Option A: Official PyPI via uvx / uv tool / pip (recommended, zero manual venv!)
uvx rikune status # Run immediately without installing
uv tool install rikune # Install globally via uv
pip install rikune # Or standard pip
# Optional: include Z3 symbolic constraint solving
uv tool install --with z3-solver rikune
# Option B: Standalone single-file binary (zero Python / zero venv — download & run!)
# Linux x86_64 : https://github.com/Last-emo-boy/rikune/releases/download/v2.3.3/rikune-linux-x86_64
# macOS arm64 : https://github.com/Last-emo-boy/rikune/releases/download/v2.3.3/rikune-macos-arm64
# Windows x64 : https://github.com/Last-emo-boy/rikune/releases/download/v2.3.3/rikune-windows-x86_64.exe
# Verify detected backends (fast built-in, rizin, ghidra, bridge), unpackers, and verification engines
rikune status
Option B: Docker (isolated analysis with Rizin 0.9.1 + UPX 5.3.1 pre-installed)
docker pull ghcr.io/last-emo-boy/rikune:2.3.3
docker run --rm ghcr.io/last-emo-boy/rikune:2.3.3 status
Option C: From source (development)
git clone https://github.com/Last-emo-boy/rikune.git
cd rikune
uv sync --python 3.12 --extra dev
uv run rikune status
Recommended backend: Install
rizin(brew install rizinon macOS) for fast.rzdb-cached function indexing and disassembly. For full decompilation, setGHIDRA_HOMEor connect a live IDE session viabridges/.
2. Connect to Your AI Agent (MCP)
Add Rikune to VS Code Copilot, Claude Code, Claude Desktop, or Cursor:
{
"mcpServers": {
"rikune": {
"command": "rikune",
"args": ["mcp", "--transport", "stdio"]
}
}
}
For best results, copy SKILL.md into your agent's skills directory so it automatically drives the triage → anchor-slice → decompile → emulate/solve → annotate → export loop.
3. CLI Essentials
Every CLI command supports --json for scripting and agent workflows:
# Intake & compact static triage (PE/ELF/Mach-O/WASM/.NET/APK, crypto constants, Go/Rust)
rikune open ./target.exe
rikune triage ./target.exe --json
# High-signal forensics: section-filtered strings, VA memory reader, wildcard search, data-xrefs, carving
rikune strings ./target.exe --section .rdata --exclude-exec -q "flag"
rikune mem ./target.exe 0x14001f000 --length 64 --format u64 # hexdump|hex|u32|u64|i8|i16|i32|f32|f64|ascii|utf16
rikune search-bytes ./target.exe "65 48 8b ?? 25 60 00 00 00"
rikune data-xrefs ./target.exe 0x140067760 --range 0x100
rikune carve ./dropper.py --derive
# Code navigation: ranked functions (.pdata + WASM + Go/Rust), anchor slicing, smart RIP disasm, diff
rikune functions ./target.exe
rikune slice ./target.exe --api-anchor suspicious --crypto-anchors --json
rikune decompile ./target.exe main
rikune disasm ./target.exe 0x140001bb0 --count 40
rikune diff ./v1.bin ./v2.bin --json
# Verification loop: auto-unpack to OEP + auto-persist IAT, batch decrypt, API hash, VM trace, Z3
rikune emulate ./target.exe 0x1400bc000 --stop-on-smc --smc-cross-section --derive-image unpacked.exe --max-insns 20000000
rikune emulate ./target.exe 0x140001f00 --pre-call 0x140002290 --hook-ret 0x140001bb0=0 --read-mem out:@rdx:64 --json
rikune trace ./target.exe 0x140001f00 --bp 0x140001f80 --regs all --json
rikune batch-decrypt ./target.exe emit_encoded --json
rikune api-hash ./target.exe --scan-fn 0x140509000 --json
rikune solve-z3 -v x -b 32 -a "(= (bvxor x #x5a5a5a5a) #x13371337)" --json
# Non-destructive patching, live annotations, lineage & two-way export
rikune patch ./target.exe 0x140001234 --kind invert_branch --filename patched.exe
rikune lineage ./target.exe
rikune annotate ./target.exe 0x140002290 --kind rename --value init_vm_table --verified
rikune export ./target.exe --format ida -o apply_symbols.py # ida | ghidra | rizin | markdown | json
MCP Tool Surface (36 Real Primitives)
All 36 tools are real executable primitives (zero plan-only stubs, zero hidden proxy layers), accompanied by 3 native MCP Prompts (triage-binary, decrypt-and-verify, diff-security-patch) and 3 read-only MCP Resources (rikune://status, rikune://samples, rikune://sample/{sha256}/report.md).
Click to expand the full 36-tool matrix
| Group | Tools |
|---|---|
| Workspace & Lineage (6) | engine_status, sample_open, sample_list, sample_derive, sample_lineage, unpack_sample |
| Static, Business, Mobile, JS & Protocol (12) | static_triage, strings_search, memory_read, bytes_search, data_xrefs, carve_payloads, binary_patch, yara_scan, disassemble_bytes, managed_inspect, js_deobfuscate, protocol_inspect |
| Code, Graph & Export (8) | functions_list, call_graph_slice, function_decompile, function_xrefs, function_cfg, binary_diff, annotate_symbol, export_annotations |
| Verification & Crypto (7) | emulate_function, emulate_trace, emulate_batch_decrypt, resolve_api_hashes, solve_symbolic, solve_z3, crypto_transform |
| Discovery & Async (3) | tool_search, job_manage, artifact_read |
Live IDE Bridges (IDA Pro & Ghidra GUI)
Combine commercial decompilers with Rikune's Unicorn/Z3 verification engine:
- Run
bridges/ida_rikune_bridge.pyinside IDA Pro orbridges/ghidra_rikune_bridge.pyinside Ghidra. - Point Rikune at the live session:
export RIKUNE_BRIDGE_URL="http://127.0.0.1:18765"
- Decompile via
--backend bridge, verify decryption/hashes in Unicorn, and push[VERIFIED]renames, types, and decoded values straight back into your GUI withrikune export <sample> --push-bridge. Seebridges/README.md.
Battle-Tested on Real CrackMes & Public 2026 RE Benchmarks
Rikune v2 has been hardened end-to-end against 8 real-world crackmes.one challenges and 4 public 2026 RE benchmarks:
- Public Benchmarks (
AgentRE-Bench,CREBench,BinaryAudit,BIOPSY-Bench):- CREBench (
constxor+ PRNG/fragmented keys): Auto-detects XOR-masked AES/SM4 S-boxes & inline ChaCha20 constants statically, extracts keys via Unicorn@arg0reads, and recovers byte-exact verified flags (AES-128-CBC&SM4-CBC). - BinaryAudit (400 KB stripped
dnsmasq):rikune xrefs/slice --api-anchor execlpinpoints the exact obfuscated backdoor function (0x2e0d0,dhcp_reply) in <1s with 0 false positives on the clean negative control. - AgentRE-Bench (V3.1 stripped PE32+): 100% encryption-key recovery across stripped Levels 15/16/18/19/22 (RC4, XOR, custom AES S-box, PEB/Hell's Gate/Reflective DLL/Code Cave).
- BIOPSY-Bench (Router Firmware): Carves embedded
SquashFS, CRC-verifiedU-Boot uImage,FDT,CPIO, andXZpartitions directly from 7–14 MB router images.
- CREBench (
- Hard
crackmes.oneCorpus (8/8 Analyzed):- Nested Encrypted VMs & Crypto: 159 KB MSVC PE64 double-nested VM + anomalous-curve Schnorr (
ouroboros.exe), and 4.8 MB Aegis v1.44 (97 virtualized functions, 11 encrypted sections unpacked in 13s, verified across 97.6M Unicorn instructions). - Custom PEB Crypters & Quantized Neural Nets: 774 KB custom anti-debug PEB packer + 4,096-neuron QNN (
NNcrackme-t.exe) — 1-command--stop-on-smc --derive-imageauto-unpacked to OEP and auto-persisted 134 dynamicimp_*IAT annotations. - 5.25 MB Multi-Engine XYVM: Sub-second
.rzdb-cached workflow, 13/13.xyvm1ROR13 + UTF-16LE DLL hashes resolved in0.58s, Ring-3 PEB/TLS/bcrypt.dllSHA-256 & HMAC verified natively from CLI. - Hybrid WebAssembly, JS & Python Droppers: Pure-Python WASM 1.0 export parsing + Z3 MBA solving (
syferit-defender,syfer-drift), and 1-commandcarve --deriveunpacking a 5.33 MB Base85+Gzip obfuscated Python VM.
- Nested Encrypted VMs & Crypto: 159 KB MSVC PE64 double-nested VM + anomalous-curve Schnorr (
Verified Benchmark Suite (10/10 Passing)
Measured locally on Apple Silicon (macOS ARM64, Python 3.12, Rizin 0.9, Unicorn 2.1.4 — 352 unit/E2E tests + 10/10 benchmarks in ~2.0s):
| Case | Result | Time | Est. Tokens | Verified Outcome |
|---|---|---|---|---|
crackme_full_loop |
PASS | ~300 ms | ~2,906 | 3/3 hidden messages batch-decrypted + validate_candidate proven 1/0 + report |
xor_batch_string_decrypt |
PASS | ~105 ms | ~310 | 3/3 encrypted IOCs recovered from call-sites + IDAPython export |
stage2_emulate_to_derive_lineage |
PASS | ~115 ms | ~231 | 26-byte stage-2 ELF decrypted in Unicorn & registered in sample lineage |
patch_binary_diff |
PASS | ~170 ms | ~205 | Byte-aware diff pinpointing added validate_bounds & modified functions |
api_hash_static_and_unicorn |
PASS | ~100 ms | ~213 | Static ROR13 (VirtualAlloc/LoadLibraryA) + Unicorn dynamic custom hash (GetProcAddress) |
crypto_anchor_aes_slice |
PASS | ~800 ms | ~1,744 | AES S-Box anchor slice entry0 -> encrypt_block -> aes_sub_byte (0 decoys) |
win64_peb_dynamic_api_chain |
PASS | ~2 ms | ~349 | gs:[0x60] PEB + LoadLibraryA -> GetProcAddress -> VirtualAlloc → "IREV" |
smc_self_decrypt_oep |
PASS | ~2 ms | ~180 | Self-decrypting x86_64 stub paused at OEP; stage-2 re-emulated to 0x1337 |
indirect_trace_and_branch_patch |
PASS | ~6 ms | ~225 | Indirect function-table trace (3 targets) + branch-flip patch verified 0 -> 1 |
pattern_data_xref_and_carve |
PASS | ~4 ms | ~145 | Wildcard byte search + static data-xref + embedded gzip carved into lineage |
Development & Contributing
uv run ruff check src tests benchmarks bridges
uv run mypy src
uv run pytest -v
uv run python benchmarks/runner.py
uv run python benchmarks/agent_eval.py --self-test
See docs/ARCHITECTURE.md, CHANGELOG.md, and SECURITY.md. Licensed under MIT.
Metadata
Release files for rikune 2.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rikune-2.3.3.tar.gz | 599.9 kB | With provenance | Details for rikune-2.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rikune-2.3.3-py3-none-any.whl | Python 3 | none | any | Details for rikune-2.3.3-py3-none-any.whl |
Total release size: 913.3 kB
Release files / rikune-2.3.3.tar.gz
| Download URL | rikune-2.3.3.tar.gz |
|---|---|
| Size | 599.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f8b07612f0ff6be740b01d968ba2dbd472f1aff4b86c973e1fcc01169af6cee
|
|
BLAKE2b-256 checksum How to use checksums |
bf7b760df9f6db1928c2eec4fda2e1e1ddc87c96b453b86e99cdbb6b6722d942
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / rikune-2.3.3-py3-none-any.whl
| Download URL | rikune-2.3.3-py3-none-any.whl |
|---|---|
| Size | 313.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97dfe9d18c37ec4528c6ddf1a3ccf0dc47e93dbbed3fb99484342ac280cfb6b7
|
|
BLAKE2b-256 checksum How to use checksums |
39854a3608281100c84b9b9abf35ef0f7debcbeb786c339b50e437ef69a5907b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for rikune 2.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for rikune-2.3.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.