Skip to main content

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

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 been tested on macOS, linux, and windows running cpython. Since pydis uses ctypes to interface with zydis it may or may not work on other interpreters.

Installing

pip install py-dis

or you can build from source as described below.

Building

MacOS and linux machines will need cmake and a C compiler in order to build Zydis. Windows machines will need Visual Studios. Pydis does not use any python modules beyond ones provided by a default python installation.

With the tooling installed running: python setup.py build 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


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

py_dis-0.3-cp36-none-win_amd64.whl (139.7 kB view details)

Uploaded CPython 3.6 Windows x86-64

py_dis-0.3-cp36-none-win32.whl (139.8 kB view details)

Uploaded CPython 3.6 Windows x86

py_dis-0.3-cp36-none-manylinux1_x86_64.whl (160.7 kB view details)

Uploaded CPython 3.6

py_dis-0.3-cp36-none-manylinux1_i686.whl (160.9 kB view details)

Uploaded CPython 3.6

py_dis-0.3-cp36-none-macosx_10_12_x86_64.whl (149.6 kB view details)

Uploaded CPython 3.6 macOS 10.12+ x86-64

File details

Details for the file py_dis-0.3-cp36-none-win_amd64.whl.

File metadata

  • Download URL: py_dis-0.3-cp36-none-win_amd64.whl
  • Upload date:
  • Size: 139.7 kB
  • Tags: CPython 3.6, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

File hashes

Hashes for py_dis-0.3-cp36-none-win_amd64.whl
Algorithm Hash digest
SHA256 1949a4284976156691f0f6a6b76a740e695ee12d979b00864573c1bac654586c
MD5 51c4da8146f59b989489eba3a6e62231
BLAKE2b-256 083bb79759368244a3364c429b58427210da9676794f2f49cd0a04c859ade3fa

See more details on using hashes here.

File details

Details for the file py_dis-0.3-cp36-none-win32.whl.

File metadata

  • Download URL: py_dis-0.3-cp36-none-win32.whl
  • Upload date:
  • Size: 139.8 kB
  • Tags: CPython 3.6, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

File hashes

Hashes for py_dis-0.3-cp36-none-win32.whl
Algorithm Hash digest
SHA256 5fdd326f45288a52a16397dbb13dcd1e21fa1621bf685f602e547ffb7bd7823e
MD5 0181af3200657da54101e6df279867cb
BLAKE2b-256 9f632725af721c8b20a2d3696a186b19500c509d78959e4c39eea64a66e6131c

See more details on using hashes here.

File details

Details for the file py_dis-0.3-cp36-none-manylinux1_x86_64.whl.

File metadata

  • Download URL: py_dis-0.3-cp36-none-manylinux1_x86_64.whl
  • Upload date:
  • Size: 160.7 kB
  • Tags: CPython 3.6
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

File hashes

Hashes for py_dis-0.3-cp36-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e41677ed1ee13c8c220a4e66c40fd0c464858fc7c9364f321708a7abfd911ff5
MD5 fb6bcd9a3599ad261abbb69ced186619
BLAKE2b-256 50034112e1acbb84b847f8023d07c5449229535290c770c5bada41ed6292be39

See more details on using hashes here.

File details

Details for the file py_dis-0.3-cp36-none-manylinux1_i686.whl.

File metadata

  • Download URL: py_dis-0.3-cp36-none-manylinux1_i686.whl
  • Upload date:
  • Size: 160.9 kB
  • Tags: CPython 3.6
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

File hashes

Hashes for py_dis-0.3-cp36-none-manylinux1_i686.whl
Algorithm Hash digest
SHA256 a50b03f4187a7b3640c8b856ca2beb056b1a8d09b9a6e576cae922e2c40f0f53
MD5 193cca58effb49cb2ced5b4d2b9d290b
BLAKE2b-256 ea10fb5461df42d6210265bfedc6b7efe1c82b98e5b6104bf4df2ac593b1fb8e

See more details on using hashes here.

File details

Details for the file py_dis-0.3-cp36-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: py_dis-0.3-cp36-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 149.6 kB
  • Tags: CPython 3.6, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

File hashes

Hashes for py_dis-0.3-cp36-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b931810c77aff5b049b0d31c183b0b6b6f33be5f1689bbf1a9a139afdeb18210
MD5 cacce8ea5ace73f6c1ac0c45a37ac3c2
BLAKE2b-256 223a400a3ac5b002aadec195b4c89cfad8f8e2ef63b6d928704676ee9b9ed629

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