1
0
mirror of https://github.com/bitdefender/bddisasm.git synced 2024-12-27 16:38:08 +00:00
bddisasm/bindings/pybddisasm
vlutas c282f06215
Add support for SIMD Exceptions reporting and new x86 ISAs (#108)
* Add support for SIMD exceptions reporting in INSTRUX.
* Add support for new ISAs: MOVRS, MSR_IMM, AMX-FP8, AMX-TRANSPOSE, AMX-TF32, AMX-AVX512, AMX-MOVRS, EVEX-encoded SM4.

Co-authored-by: ianichitei (Rust bindings)
2024-11-07 12:15:29 +02:00
..
pybddisasm Update headers for pybddisasm. 2024-02-20 14:35:21 +02:00
tests Use SWIG to create bindings between C and Python. 2023-06-22 14:54:41 +03:00
LICENSE Update copyright. 2023-06-26 10:40:30 +03:00
MANIFEST.in Use SWIG to create bindings between C and Python. 2023-06-22 14:54:41 +03:00
README.md Use SWIG to create bindings between C and Python. 2023-06-22 14:54:41 +03:00
setup.cfg Move pybddisasm to the bindings directory 2021-10-20 09:32:50 +03:00
setup.py Add support for SIMD Exceptions reporting and new x86 ISAs (#108) 2024-11-07 12:15:29 +02:00

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