Skip to main content

r2bagpipe

A wrapper interface for r2pipe with data caching and loading capabilities.

Development

  • Radare2 analysis and caching
    • Use data cached with Bin2ML fork
    • Replicate bin2ml extract functionality with internal module.
  • Track cached files
    • Data files from known binary name and output directory
      • trackers.py for tracking data paths
    • Extraction logs (errors/warnings)
  • Data loading, validation and streaming
    • r2types.py for type checking
    • parsers.py for data parsing and streaming
    • loader.py main module for loading data files
      • Implement data loading and function grouping
      • Refactor BinaryDataLoader

This project stems from BinRankBench. It aims to modularise the data loading/caching and avoid dependency on Bin2ML. Below is the implementation plan for the future release of v1.0.0.


Features

  • Analyse binary files with radare2 and store outputs in a structured manner
  • Track cached data files and error logs
  • Load, validate, and stream cached data
    • Supported commands are:
      • ij: General file information
      • afij: General function information
      • cgj: Global function callgraph
      • agij: CFG-structured opcodes and references
      • zg; zj: Zignatures

Usage

WARNING: Below is a general idea of how the project is going to work. This is yet to be implemented and is subject to change.

# For data extraction
from r2bagpipe import Bagpipe

r2p = Bagpipe(input="path/to/input_file", 
              output="path/to/output_dir",
              config="path/to/config.yaml")

r2p.setup()   # start r2pipe and set environment variables
r2p.analyze() # submit analysis commands (e.g. aaa; zg)
r2p.stash()   # extract and save analysis data

# For data loading
from r2bagpipe import Bagpipe
from r2bagpipe.typing import R2FunctionInfo # Just for type hinting

r2b = Bagpipe(data="path/to/data_dir")

# If a single binary data directory
print(r2b.length)  # Output: 1
bin_bag = r2b.get()
functions: list[R2FunctionInfo] = bin_bag.functions_info
# ... or if you have limited RAM ...
for function in bin_bag.stream_functions_info():
  func_size = function.get("size")

# If Bag is provided with a root directory with many binary data items 
print(r2b.length)  # Output: 500
for bin_bag in r2b.stream():
  print(bin_bag.bininfo)  # Loaded from ij cache

Metadata

Release files for r2bagpipe 0.1.2

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

Source distribution (sdist)

Source distribution for r2bagpipe 0.1.2
File Size Uploaded Provenance Actions
r2bagpipe-0.1.2.tar.gz 39.4 kB Without provenance Details for r2bagpipe-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 79.5 kB

Release files / r2bagpipe-0.1.2.tar.gz

Download URL r2bagpipe-0.1.2.tar.gz
Size 39.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b0e15e07ce7a4fdceb7ebd7d872a89181678b5b1f874bf5f023c50404b873a58
BLAKE2b-256 checksum
How to use checksums
a149104fc7aedc0d99ab7c9a5e507f8d0ac4c283bf07f0260bef21c0df1ff4ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / r2bagpipe-0.1.2-py3-none-any.whl

Download URL r2bagpipe-0.1.2-py3-none-any.whl
Size 40.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20646f67f91f0b12399f9ecc3fee3398d868d65f9dc8d9361063905ced8d10c7
BLAKE2b-256 checksum
How to use checksums
d88b3edd9bfa5fc2ebeea1ebca06172f6583c0f1967dbe8bd4c8baf756f68c6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for r2bagpipe 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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