2020-07-21 08:19:18 +00:00
|
|
|
# The Bitdefender disassembler Python wrapper
|
|
|
|
|
|
|
|
## Build
|
|
|
|
|
|
|
|
Building and installing is easy:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
python3 setup.py build
|
|
|
|
python3 setup.py install
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2020-08-04 10:57:03 +00:00
|
|
|
Use it by importing the pybddisasm.disasm module:
|
2020-07-21 08:19:18 +00:00
|
|
|
|
|
|
|
```python
|
2020-08-04 10:57:03 +00:00
|
|
|
from pybddisasm.bddisasm import *
|
2020-07-21 08:19:18 +00:00
|
|
|
|
|
|
|
instr = nd_decode_ex2(buff, arch, arch, arch, vendor, current_rip)
|
|
|
|
```
|
|
|
|
|
2020-11-17 15:24:57 +00:00
|
|
|
## Example
|
|
|
|
|
|
|
|
```python
|
|
|
|
from pybddisasm.bddisasm import *
|
|
|
|
from sys import *
|
|
|
|
|
|
|
|
buff = b"\x55\x48\x8b\x05\xb8\x13\x00\x00"
|
|
|
|
offset = 0
|
|
|
|
|
|
|
|
while offset < getsizeof(buff):
|
|
|
|
instr = nd_decode_ex2(buff[offset:], 64, 64, 64)
|
|
|
|
|
|
|
|
if instr is None:
|
|
|
|
break
|
|
|
|
|
|
|
|
print(instr.Text)
|
|
|
|
|
|
|
|
offset += instr.Length
|
|
|
|
```
|
|
|
|
|
2020-08-04 10:57:03 +00:00
|
|
|
## Pip
|
|
|
|
|
|
|
|
Use pip to install the package:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pip install pybddisasm
|
|
|
|
```
|