Yet anohter radare2 python bindings.
Project description
pyr2
Yet another radare2 python bindings.
Install
pip3 install --upgrade pyr2
No need to install radare2 since all dynamic libraries are bundled with the Python wheels.
Example
import ctypes
from r2 import *
r2c = r_core_new()
r_core_init(r2c)
fh = r_core_file_open(r2c, ctypes.create_string_buffer(b"/bin/ls"), 0b101, 0)
r_core_bin_load(r2c, ctypes.create_string_buffer(b"/bin/ls"), (1<<64) - 1)
r_core_cmd_str(r2c, ctypes.create_string_buffer(b"ieq"))
r_core_cmd_str(r2c, ctypes.create_string_buffer(b"aaa"))
print(ctypes.string_at(r_core_cmd_str(r2c, ctypes.create_string_buffer(b"pdj"))))
r_core_file_close(r2c, fh)
Note that all radare2 APIs are exported as bare ctypes function prototype. Be catious 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. Note that on Windows, x64 Native Tools Command Prompt
is required to build.
python3 setup.py build
Install and use.
# Or pip3 install -e .
pip3 install .
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for pyr2-1.2.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9debdae0b7d7d159b786441adb0aef99be729ff9ff8f5b28b582fb1d5fa5386 |
|
MD5 | 5a0cd141ddfb5ab3fcac75d1efbd4378 |
|
BLAKE2b-256 | 0424dd752dea1a679f53315c0041c72bfec65376d050642d03aa491219594338 |
Close
Hashes for pyr2-1.2.0-py3-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74623dcb1e42849a3153628e13beca00788d873904256cf183c249c9d2e5c285 |
|
MD5 | 417f7db64cf008eccaf2c8fde94e0063 |
|
BLAKE2b-256 | 2d3c954df439144b294bb6527ef97a44493e8263802e8eeab27367812c7e6070 |
Close
Hashes for pyr2-1.2.0-py3-none-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 632bb6887e5391e95bd9deef7967f9026d47ff8453d0a8f37901b048e8187772 |
|
MD5 | 9d703d4615ebc1320a7580133f161d76 |
|
BLAKE2b-256 | d5ac93060eb8cc7b6ca42b3a443019f13fbfabb152aea0fc6b4bfb9a763d666c |