Skip to main content

Yet anohter radare2 python bindings.

Project description

pyr2

Yet another radare2 python bindings.

Install

pip3 install pyr2

No need to install radare2 since all dynamic libraries are bundled with the Python wheels.

Example

from r2 import libr

r2c = libr.r_core_new()
libr.r_core_init(r2c)
fh = libr.r_core_file_open(r2c, ctypes.create_string_buffer(b"/bin/ls"), 0b101, 0)
libr.r_core_bin_load(r2c, ctypes.create_string_buffer(b"/bin/ls"), (1<<64) - 1)
libr.r_core_cmd_str(r2c, ctypes.create_string_buffer(b"ieq"))
libr.r_core_cmd_str(r2c, ctypes.create_string_buffer(b"aaa"))
print(ctypes.string_at(libr.r_core_cmd_str(r2c, ctypes.create_string_buffer(b"pdj"))))
libr.r_core_file_close(r2c, fh)

libr is the core library of radare2 which implements all low-level APIs. Note that it's exported as a bare ctypes library, be cautious with c-style strings.

Build Instructions

Clone the repository and submodules.

git clone https://github.com/wtdcode/pyr2
cd pyr2
git submodule update --init --recursive

Since radare2 chooses meson as their alternative building system, the first step is install meson.

pip3 install meson

Build the package.

python3 setup.py build

Install and use.

# Or pip3 install -e .
pip3 install .

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyr2-1.1.1-py3-none-win_amd64.whl (6.4 MB view hashes)

Uploaded Python 3 Windows x86-64

pyr2-1.1.1-py3-none-manylinux1_x86_64.whl (7.6 MB view hashes)

Uploaded Python 3

pyr2-1.1.1-py3-none-macosx_10_14_x86_64.whl (5.9 MB view hashes)

Uploaded Python 3 macOS 10.14+ x86-64

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