Skip to main content

r2pyapi

High level radare2 python API

Installation

$ pip install r2pyapi

You also need to install radare2. radare2 can be easily installed by the instruction described here.

Usage

import r2pipe
from r2pyapi import R2Surface, R2Seeker, R2Reader

r2 = r2pipe.open("test.exe")

# instruction search
with R2Seeker(r2) as seeker:
    results = seeker.seek_instructions("push ebp")
    print(next(result))
    # R2Instruction(offset=4288663, len=2, code='push ebp')

# read byte sequences
with R2Reader(r2) as reader:
    bytes_read = reader.read_bytes_at(0x0401000, 4)
    # [85, 139, 236, 131]

# get sections
r2_surf = R2Surface(r2)
print(r2_surf.sections)
# [R2Section(vaddr=4198400, paddr=1024, size=51200, vsize=53248, name='.text', perm='-r-x'), ... ]

# get import
print(r2_surf.find_import("MessageBoxA"))
# R2Import(ordinal=1, bind='NONE', type='FUNC', name='MessageBoxA', libname='USER32.dll', plt=4251916)

Metadata

Release files for r2pyapi 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 r2pyapi 0.1.2
File Size Uploaded Provenance Actions
r2pyapi-0.1.2.tar.gz 10.1 kB Without provenance Details for r2pyapi-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 25.3 kB

Release files / r2pyapi-0.1.2.tar.gz

Download URL r2pyapi-0.1.2.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bda8e04446d15f76645b550f01cc68f4308229c596de4fcd59e9c0aae11916ad
BLAKE2b-256 checksum
How to use checksums
10ff2914950279805d7c1c96bc1940e6cb78f26061d7f0e7dc7786b5ba129e56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.2 Darwin/19.6.0

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

Download URL r2pyapi-0.1.2-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1dcdfd38bf9d05b14f31d5a3dbc717ecd8f1edd05efa22b9942206d8f60771f
BLAKE2b-256 checksum
How to use checksums
e1bab577e50f4463ea00847e41a1246b51c80e01d36a1eeb32efca1fa79f44c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.2 Darwin/19.6.0

Security for r2pyapi 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