Skip to main content

r2inspect

r2inspect

Advanced malware analysis tool powered by radare2 and r2pipe

PyPI Version Python Versions License CI Status Coverage

GitHub Stars GitHub Issues Buy Me a Coffee


Overview

r2inspect is a professional malware analysis framework that automates deep static inspection for PE, ELF, and Mach-O binaries using the radare2 ecosystem. It combines format parsing, detection heuristics, and rich reporting to support reverse engineers, incident responders, and threat analysts.

Key Features

Feature Description
Multi-format Support PE, ELF, Mach-O format detection and analysis
String Analysis ASCII/Unicode extraction with filtering and decoding
Packer Detection Evidence-based scoring with entropy and signature checks
Crypto Detection API and constant analysis with confidence scoring
Anti-Analysis Anti-debug/VM/sandbox indicators with evidence
Hashing Suite MD5/SHA, SSDeep, TLSH, MACHOC, RichPE, Telfhash, SimHash
Metadata Analysis Sections, imports, exports, resources, overlays
YARA Integration Built-in and custom rule scanning
Rich Output Console tables, JSON, and CSV exports

Supported Formats

Windows  PE32 / PE32+ / DLL
Linux    ELF32 / ELF64
macOS    Mach-O / Universal

Installation

From PyPI (Recommended)

pip install r2inspect

From Source

git clone https://github.com/seifreed/r2inspect.git
cd r2inspect
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -e .

Requirements

  • Python 3.13+
  • radare2 installed and in PATH
  • libmagic (for file type detection)

Quick Start

# Basic analysis with rich console output
r2inspect samples/fixtures/hello_pe.exe

# JSON output
r2inspect -j samples/fixtures/hello_pe.exe

# CSV output
r2inspect -c samples/fixtures/hello_pe.exe

Usage

Command Line Interface

# Full analysis
r2inspect malware.exe

# Save output to file
r2inspect -j malware.exe -o analysis.json

# Analyze a directory (batch mode)
r2inspect --batch ./samples -j -o ./out

# Custom YARA rules
r2inspect --yara /path/to/rules malware.exe

Available Options

Option Description
-i, --interactive Interactive analysis shell
-j, --json Output in JSON format
-c, --csv Output in CSV format
-o, --output Output file or directory
--batch Batch mode for directories
--extensions Filter batch by extensions
--yara Custom YARA rules directory
-x, --xor XOR search string
-v, --verbose Verbose output
--quiet Suppress non-critical output
--threads Parallel threads for batch mode

Python Library

from r2inspect import create_inspector
from r2inspect.config import Config

config = Config()
with create_inspector("malware.exe", config=config) as inspector:
    results = inspector.analyze()
    pe_info = inspector.get_pe_info()
    imports = inspector.get_imports()

Architecture (high level)

Use create_inspector to build a ready-to-run inspector with adapter, registry, and pipeline wiring. The core depends on interfaces; adapters provide r2pipe-backed data access, while analyzers focus on analysis and domain helpers.

CLI -> create_inspector -> R2Inspector -> AnalysisPipeline -> analyzers
                                      -> Adapter (r2pipe) -> radare2

See docs/architecture.md for a short overview of the layers and extension points.


Examples

Analyze Multiple Samples

r2inspect --batch ./samples --extensions "exe,dll" -j -o ./out

Interactive Mode

r2inspect> analyze
r2inspect> strings
r2inspect> imports
r2inspect> quit

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Support the Project

If you find r2inspect useful, consider supporting its development:

Buy Me A Coffee

License

GNU General Public License v3.0

Attribution Required:


Made with dedication for the reverse engineering and threat intelligence community

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

r2inspect-3.0.0.tar.gz (929.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

r2inspect-3.0.0-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file r2inspect-3.0.0.tar.gz.

File metadata

  • Download URL: r2inspect-3.0.0.tar.gz
  • Upload date:
  • Size: 929.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for r2inspect-3.0.0.tar.gz
Algorithm Hash digest
SHA256 c0021add7fb13e9b7c2978d46f8dde275eb227eb8deb8ca5b576656ba7f71746
MD5 5f543f28cfb9ccdda351a349be3483f7
BLAKE2b-256 6641fd46e19ae7a5ad9973d15f1ae11cc09d7fca85167abf3941a81a62859901

See more details on using hashes here.

Provenance

The following attestation bundles were made for r2inspect-3.0.0.tar.gz:

Publisher: publish.yml on seifreed/r2inspect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file r2inspect-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: r2inspect-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for r2inspect-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50f63e129ca6110a42f32349a843a3c4fc6a9c641882e415391f6a2dcce7e089
MD5 93bef69c15b37e7a10ce4ba4348e0439
BLAKE2b-256 32013e0f1e01289695dd332d9dd458585b8901224c2920f89ea0e7bcf877214b

See more details on using hashes here.

Provenance

The following attestation bundles were made for r2inspect-3.0.0-py3-none-any.whl:

Publisher: publish.yml on seifreed/r2inspect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 files

2.1.0

2 files

2.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page