Python bindings for Zydis library
Project description
pydis
Pydis is a python binding for the Zydis disassembler library.
import pydis
instructions = b'\x51\x8d\x45\xff\x50\xff\x75\x0c\xff\x75\x08\xff\x15\xa0\xa5\x48\x76\x85\xc0\x0f\x88\xfc\xda\x02\x00'
instruction_pointer = 0x007FFFFFFF400000
lines = []
for instruction in pydis.decode(instructions, instruction_pointer):
print(instruction)
Output:
push rcx
lea eax, [rbp-0x01]
push rax
push [rbp+0x0C]
push [rbp+0x08]
call [0x008000007588A5B1]
test eax, eax
js 0x007FFFFFFF42DB15
The module uses the same field names as Zydis with the exception that snake_case is used instead of camelCase.
Requirements
Pydis requires a python version >=3.6. The package has only been tested on macOS and linux running cpython. Since pydis
uses ctypes
to interface with zydis it may or may not work on other interpretters.
Installing
Pydis is currently not on PyPi.
A wheel file is provided for macOS and linux distros with manylinux1 support. You can install by running:
pip install <wheel file>
or you can build from source as described below.
Building
Your machine will need cmake
and a C compiler in order to build Zydis. Pydis does not use any python modules beyond
ones provided by a default python installation. Once the minimum tooling is installed running python setup.py install
will build Zydis and install the package.
Usage
Documentation is currently being worked on. For now the example script pydisinfo is the best place to look for example usage.
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 Distribution
Built Distributions
Hashes for py_dis-0.1-cp36-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54daaeb8a01802f35e1c165bc2c8cc7bc9ebac37d0b856e2169d57c501a09e0b |
|
MD5 | 66afb197956e1bf3d97d805421489ee9 |
|
BLAKE2b-256 | b7ba1632d9d7bc8c24afa287deb48e621da1265849dcba05c0b124f2cceda939 |
Hashes for py_dis-0.1-cp36-none-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36423ece2213e1df74bf411f482f948007260105bd3bc760d8f1f1103ab0eaed |
|
MD5 | a03ad723271bd00054f980d7ac234b23 |
|
BLAKE2b-256 | cd466023fd3046548c0920391ac20635165e9a7d40c17b44631127820ca0205f |