You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bddisasm/bindings/pybddisasm
Andrei Vlad LUTAS 02cbe6a298
https://github.com/bitdefender/bddisasm/issues/87 - added missing `R` access for the `rIP` operand for `SYSCALL` instructions; added missing `SCS`, `rCX` and `rDX` operands for `SYSEXIT` instruction.
3 months ago
..
pybddisasm Update headers for pybddisasm. 3 months ago
tests Use SWIG to create bindings between C and Python. 11 months ago
LICENSE Update copyright. 11 months ago
MANIFEST.in Use SWIG to create bindings between C and Python. 11 months ago
README.md Use SWIG to create bindings between C and Python. 11 months ago
setup.cfg Move pybddisasm to the bindings directory 3 years ago
setup.py https://github.com/bitdefender/bddisasm/issues/87 - added missing `R` access for the `rIP` operand for `SYSCALL` instructions; added missing `SCS`, `rCX` and `rDX` operands for `SYSEXIT` instruction. 3 months ago

README.md

The Bitdefender disassembler Python wrapper

Build

Building and installing is easy:

python3 setup.py build
python3 setup.py install

Usage

Use it by importing the pybddisasm module:

import pybddisasm

ret, instr = pybddisasm.nd_decode_ex(code, def_code, def_data, def_stack)

Example

import pybddisasm

code = b"\x55\x48\x8b\x05\xb8\x13\x00\x00"
offset = 0

while offset < len(code):
    _, instr = pybddisasm.nd_decode_ex(code[offset:], len(code[offset:]), pybddisasm.ND_CODE_64, pybddisasm.ND_DATA_64)

    if instr is None:
        break

    _, text = pybddisasm.nd_to_text(instr, 0x0)
    print(text)

    offset += instr.Length

Pip

Use pip to install the package:

pip install pybddisasm