Skip to main content

⚡ Rikune

Cross-Platform, Verification-First Reverse-Engineering Engine (CLI · MCP · Bridges)

Analyze binaries, mobile apps, protocols, and obfuscated scripts — and prove findings deterministically.

PyPI CI Python 3.11+ License MIT 43 Primitives

English · 简体中文 · Architecture · Agent Skill · IDE & Frida Bridges · Changelog


v2 is now main. The legacy v1 TypeScript/Node platform has been archived on the deprecated branch and v1-legacy tag.

What is Rikune?

Rikune is NOT just a thin MCP wrapper around another tool. It is a self-contained, cross-platform reverse-engineering engine that ships three ways to work from one binary:

Mode Best For How You Use It
🖥️ Standalone CLI Human analysts, scripts, pipelines rikune triage, rikune decompile --lift, rikune emulate, rikune managed, rikune js-deobf, rikune protocol (--json everywhere)
🤖 MCP Server Claude Code, VS Code Copilot, Cursor Run rikune mcp --transport stdio to expose 43 real executable primitives + tool_search + Prompts + Resources
🔌 IDE & Runtime Bridges Working alongside IDA Pro, Ghidra, or Frida Pull live decompilation from IDA/Ghidra GUI, verify in Unicorn/Z3, and push [VERIFIED] symbols/types/captures straight back

Zero manual virtualenv, zero mandatory Docker, zero JDK/Node.js required for core capabilities — install via uvx / pip or grab a single-file binary from GitHub Releases.


Core Architecture

flowchart LR
    A[Read-Only Vault<br/>SHA-256 & Lineage] --> B[Static & Domain Analysis<br/>PE/ELF/Mach-O/WASM · C++ RTTI<br/>APK/DEX/.NET · JS · Protobuf/PCAP · Firmware]
    B --> C[Navigation & Lifting<br/>Fast Native · Rizin · Ghidra · IDE Bridge<br/>Call-Graph Slicing · CFG Pseudocode Lifter]
    C --> D[Deterministic Verification<br/>Unicorn x86/x64/ARM64/ARM32/MIPS32<br/>Win64 PEB · Linux Syscalls · SMC/OEP · Crypto · Z3]
    D --> E[Live Overlay & Export<br/>Verified Renames · Types · Values<br/>IDA · Ghidra · Rizin · Markdown · JSON]
    E --> C

Key Capabilities

  • 🔬 Deterministic Verification Loop: Map real PE / ELF / Mach-O segments into Unicorn (x86, x86_64, ARM64, ARM32, MIPS32 BE/LE) with Win64 Ring-3 PEB/TLS/ntdll/kernel32/bcrypt stubs, cross-arch Linux user-mode syscall hooks, non-invasive hook_returns/hook_skips, automatic SMC/OEP unpacking with IAT recovery, stack-aware batch call-site decryption, API-hash resolution, built-in FIPS/RFC cipher transforms (AES, SM4, ChaCha20, RC4, XTEA, TEA, RC5, XOR), and optional Z3 / angr.
  • 🧠 Token-Efficient Navigation & Zero-Dep Lifting: Built-in zero-subprocess FastNativeBackend (--backend fast) indexes 50 MB+ Go (.gopclntab) and PE64 (.pdata) binaries in ~1–2s with --exclude-stdlib noise filtering; anchor-based call-graph slicing (--string-anchor, --api-anchor, --crypto-anchors); zero-Ghidra CFG pseudocode lifter (decompile --lift); and C++ RTTI / vtable recovery (Itanium + MSVC).
  • 📱 Mobile, Managed, Frontend & Protocol Coverage (All Pure Python):
    • Android & .NET (rikune managed): Binary AndroidManifest.xml (AXML) decoding, Dalvik DEX method disassembly, APK lib/*.so lineage extraction for Unicorn JNI emulation, and .NET CIL/MSIL method disassembly.
    • Frontend JS (rikune js-deobf): Safe offline deobfuscator (zero Node.js, zero eval) for hex/unicode escapes, constant folding, obfuscator.io string-array tables, and business API/header/key extraction.
    • Protocols & Firmware (rikune protocol / rikune carve): Schema-less Protobuf wire decoding, TLV framing, PCAP/PCAPNG packet inspection, and embedded SquashFS / U-Boot uImage / FDT / CPIO firmware inspection & carving.
  • 🔁 Live Overlay, Lineage & Safety: Verified renames, C types, and decoded values overlay onto every subsequent read and export cleanly to IDA / Ghidra / Rizin / Markdown / JSON or live GUI bridges; non-destructive patching/carving/unpacking tracks immutable parent→child lineage; built-in prompt-injection guard protects agents reading untrusted binaries.

Quick Start

1. Install (Zero-Venv, Out-of-the-Box)

# Option A: Official PyPI (recommended — zero manual venv)
uvx rikune status                 # Run immediately without installing
uv tool install rikune            # Global CLI + MCP install via uv
pip install rikune                # Standard pip install

# Optional: include Z3 constraint solving
uv tool install --with z3-solver rikune

# Option B: Standalone single-file executable (zero Python required — download & run!)
#   Linux x86_64 : https://github.com/Last-emo-boy/rikune/releases/latest/download/rikune-linux-x86_64
#   macOS arm64  : https://github.com/Last-emo-boy/rikune/releases/latest/download/rikune-macos-arm64
#   Windows x64  : https://github.com/Last-emo-boy/rikune/releases/latest/download/rikune-windows-x86_64.exe
Option C: Docker (isolated container with Rizin 0.9.1 + UPX 5.3.1 pre-installed)
docker pull ghcr.io/last-emo-boy/rikune:latest
docker run --rm ghcr.io/last-emo-boy/rikune:latest status
Option D: 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

Optional external backends: Rikune works out of the box with its built-in fast backend and Unicorn engine. Install rizin (brew install rizin) for .rzdb-cached full call graphs, set GHIDRA_HOME for Ghidra headless C decompilation, or connect a live IDE/Frida session via bridges/.


2. Use as an MCP Server (AI Agents)

Add Rikune to VS Code Copilot, Claude Code, Claude Desktop, or Cursor:

{
  "mcpServers": {
    "rikune": {
      "command": "uvx",
      "args": ["rikune", "mcp", "--transport", "stdio"]
    }
  }
}

(If installed globally via uv tool install rikune or standalone binary, set "command": "rikune" and "args": ["mcp", "--transport", "stdio"].)

Optionally load SKILL.md into your agent's skills directory to guide the triage → slice → lift/decompile → verify → annotate → export workflow.


3. CLI Cheatsheet

Every CLI command supports --json for scripting and automation:

# Static triage & forensics (PE/ELF/Mach-O/WASM/.NET/APK/Firmware, C++ RTTI, XOR-masked crypto)
rikune triage ./target.bin --json
rikune strings ./target.bin --section .rdata --exclude-exec -q "token"
rikune mem ./target.bin 0x14001f000 64 -f u64
rikune search-bytes ./target.bin "65 48 8b ?? 25 60 00 00 00"
rikune data-xrefs ./target.bin 0x140067760 --range 0x100
rikune carve ./firmware_or_dropper.bin --derive

# Code navigation, CFG lifting & diffing (use --backend fast --exclude-stdlib for huge Go/PE binaries)
rikune functions ./target.bin --backend fast --exclude-stdlib --regex -q "Auth|Check|Sign"
rikune slice ./target.bin --api-anchor suspicious --crypto-anchors --json
rikune xrefs ./target.bin sym.imp.execl
rikune decompile ./target.bin 0x1ea48 --lift
rikune disasm ./target.bin 0x140001bb0 -n 40
rikune diff ./v1.bin ./v2.bin --json

# Verification loop: Unicorn emulation, SMC/OEP unpack, batch decrypt, API hash, ciphers, Z3
rikune emulate ./target.exe 0x1400bc000 --stop-on-smc --smc-cross-section --derive-image unpacked.exe
rikune emulate ./target.elf 0x2220 --arg buf:16 --arg 16 --read-mem key:@arg0:16 --json
rikune trace ./target.exe 0x140001f00 --bp 0x140001f80 --regs all --json
rikune batch-decrypt ./target.exe decrypt_str --json
rikune api-hash ./target.exe --scan-fn 0x140509000 --json
rikune crypto decrypt --alg aes-cbc --key <hex> --iv <hex> --data <hex> --json
rikune solve-z3 -v x -b 32 -a "(= (bvxor x #x5a5a5a5a) #x13371337)" --json

# Business, Mobile (APK/DEX/.NET), Frontend JS & Binary Wire Protocols
rikune managed ./app.apk --action manifest --json
rikune managed ./classes.dex --action disasm_method --target decrypt --json
rikune managed ./app.apk --action extract_native --derive --json
rikune js-deobf ./bundle.min.js --derive --json
rikune protocol ./capture.pcapng --mode auto --json

# Non-destructive patching, live annotations, lineage & two-way export
rikune patch ./target.exe 0x140001234 --kind invert_branch --filename patched.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

Tool Surface (43 Primitives)

All 43 MCP tools are real executable primitives (zero stubs), accompanied by 3 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).

Expand full 43-tool matrix
Group Tools
Workspace & Lineage (6) engine_status, sample_open, sample_list, sample_derive, sample_lineage, unpack_sample
Static, Win/macOS, Bundles, Mobile, WASM, JS & Protocol (16) static_triage, strings_search, memory_read, bytes_search, data_xrefs, carve_payloads, binary_patch, yara_scan, disassemble_bytes, win_inspect, macho_inspect, bundle_inspect, managed_inspect, js_deobfuscate, protocol_inspect, wasm_inspect
Code, Graph, OLLVM Deobf & Export (9) functions_list, call_graph_slice, function_decompile, function_xrefs, function_cfg, deobf_cfg, binary_diff, annotate_symbol, export_annotations
Verification, JNI, Fuzzing & Crypto (9) emulate_function, emulate_trace, emulate_batch_decrypt, emulate_jni, microfuzz_function, resolve_api_hashes, solve_symbolic, solve_z3, crypto_transform
Discovery & Async (3) tool_search, job_manage, artifact_read

Optional IDE & Runtime Bridges (IDA Pro · Ghidra · Frida)

All bridges live in bridges/ with zero mandatory dependency in Rikune core:

  • IDA Pro / Ghidra GUI: Run bridges/ida_rikune_bridge.py or bridges/ghidra_rikune_bridge.py, set RIKUNE_BRIDGE_URL="http://127.0.0.1:18765", read live decompilation via --backend bridge, and push [VERIFIED] annotations back with rikune export <sample> --push-bridge.
  • Frida Runtime Bridge: Use bridges/frida_rikune_bridge.py to capture live arguments, return values, and plaintext buffers and sync them into Rikune annotations.

Development

uv run ruff check src tests benchmarks bridges
uv run mypy src
uv run pytest -v

See docs/ARCHITECTURE.md, CHANGELOG.md, and SECURITY.md. Licensed under MIT.

Metadata

Release files for rikune 2.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rikune 2.5.0
File Size Uploaded Provenance Actions
rikune-2.5.0.tar.gz 753.6 kB With provenance Details for rikune-2.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rikune 2.5.0
File Interpreter ABI Platform Actions
rikune-2.5.0-py3-none-any.whl Python 3 none any Details for rikune-2.5.0-py3-none-any.whl

Total release size: 1.2 MB

Release files / rikune-2.5.0.tar.gz

Download URL rikune-2.5.0.tar.gz
Size 753.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8ecae23acb3a7951d2c4235c810e7ea40fc02b6314a320a7286dbf08ee0693b4
BLAKE2b-256 checksum
How to use checksums
6239adc994b57885edd181e5de896dad823cf3a544b3ff4b9ecc8302d2e4f991
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 log

Release files / rikune-2.5.0-py3-none-any.whl

Download URL rikune-2.5.0-py3-none-any.whl
Size 433.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ac6ac6231e71509dc9aa964d612607bb04aaf9c19278eec32de1b6633b0fa31
BLAKE2b-256 checksum
How to use checksums
a4511b01bf2099be1ca76b336ea39381e3c0869fd36d2612432116ad2c36bab0
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 log

Security for rikune 2.5.0

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.

Select from 2 files

Attestation for rikune-2.5.0.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page