sashs / Ropper

Display information about files in different file formats and find gadgets to build rop chains for different architectures (x86/x86_64, ARM/ARM64, MIPS, PowerPC, SPARC64). For disassembly ropper uses the awesome Capstone Framework.
https://scoding.de/ropper
BSD 3-Clause "New" or "Revised" License
1.88k stars 206 forks source link

Semantic errors fix on python3/python3.11 #176

Open Bl4ck-C4t opened 1 year ago

Bl4ck-C4t commented 1 year ago

When using the 'semantic' feature with python3 and 3.11 there are several library issues that I had on Linux.

1)

 File "/usr/local/lib/python3.11/dist-packages/ropper-1.13.8-py3.11.egg/ropper/semantic.py", line 67, in analyse
    irsb = pyvex.IRSB(bytes(gadget.bytes), gadget.address+thumb, gadget.arch.info, bytes_offset=thumb, num_bytes=len(gadget.bytes), opt_level=0)
           ^^^^^
NameError: name 'pyvex' is not defined

this one shows up even when you have installed pyvex. I solved it by moving the import pyvex out of the try except block in ropper/semantic.py

2)

    solver = z3.Solver()
             ^^^^^^^^^
AttributeError: module 'z3' has no attribute 'Solver'

this showed even after install z3py as the README says and running python3 -m pip install z3 To solve it you need the z3-solver package: python3 -m pip install z3-solver