Skip to main content

High level radare2 python API

Project description

r2pyapi

High level radare2 python API

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)

Project details


Download files

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

Source Distribution

r2pyapi-0.1.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

r2pyapi-0.1.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file r2pyapi-0.1.1.tar.gz.

File metadata

  • Download URL: r2pyapi-0.1.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Darwin/19.6.0

File hashes

Hashes for r2pyapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 53a504b54ed3030cb3542ff5e45d248caace85b85455f95daba8716b60160c68
MD5 3c1d690e577cd2c9c1e2ed777b4311bd
BLAKE2b-256 a0ebbe5c2ea62d3c5564aaa04679b988c836d4e6779b0a3150696ff6e1cd018f

See more details on using hashes here.

File details

Details for the file r2pyapi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: r2pyapi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Darwin/19.6.0

File hashes

Hashes for r2pyapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c398436421758c999e02a49f1b03b000223023a242c076e7cbdd86d6e13c56f4
MD5 c69fc13c10632ae5ad703f3d4efb24ab
BLAKE2b-256 70c577f1e94cf6b7b49a5ae44cd73a1c52b565dca8cdaca95186c070e81a816c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page