yossizap / angrcutter

Angr integration with Cutter's debugger
GNU General Public License v3.0
33 stars 7 forks source link

No module named '_cffi_backend' #4

Open mr-m0nst3r opened 4 years ago

mr-m0nst3r commented 4 years ago

Hi there,

except the hardcoded path, I changed it, but still can't find cffi.

It's weird because I can import _cffi_backend, but plugin seems not able to import.

changed debugger.py

sys.path.append('/usr/lib/python3.7/lib-dynload')
sys.path.append('/home/michael/.local/lib/python3.7/site-packages')
sys.path.append('/usr/local/lib/python3.7/dist-packages')
sys.path.append('/usr/lib/python3.7/dist-packages')

errors:

Couldn't load module for plugin: "angrcutter"
Traceback (most recent call last):
  File "/home/michael/.local/share/RadareOrg/Cutter/plugins/python/angrcutter/__init__.py", line 1, in <module>
    from .plugin_interface import create_cutter_plugin
  File "/home/michael/.local/share/RadareOrg/Cutter/plugins/python/angrcutter/plugin_interface.py", line 3, in <module>
    from .plugin import AngrWidget, printMessage, LogLevel
  File "/home/michael/.local/share/RadareOrg/Cutter/plugins/python/angrcutter/plugin.py", line 6, in <module>
    from .debugger import cutterDebugger
  File "/home/michael/.local/share/RadareOrg/Cutter/plugins/python/angrcutter/debugger.py", line 6, in <module>
    from angrdbg import *
  File "/home/michael/.local/lib/python3.7/site-packages/angrdbg/__init__.py", line 6, in <module>
    from .core import get_logger, StateShot, StateManager, get_registers
  File "/home/michael/.local/lib/python3.7/site-packages/angrdbg/core.py", line 6, in <module>
    from .context import load_project, get_memory_type, set_memory_type, get_debugger, SIMPROCS_FROM_CLE, ONLY_GOT_FROM_CLE, GET_ALL_DISCARD_CLE
  File "/home/michael/.local/lib/python3.7/site-packages/angrdbg/context.py", line 6, in <module>
    import angr
  File "/home/michael/.local/lib/python3.7/site-packages/angr/__init__.py", line 30, in <module>
    from .sim_procedure import SimProcedure
  File "/home/michael/.local/lib/python3.7/site-packages/angr/sim_procedure.py", line 5, in <module>
    from cle import SymbolType
  File "/home/michael/.local/lib/python3.7/site-packages/cle/__init__.py", line 18, in <module>
    from .loader import *
  File "/home/michael/.local/lib/python3.7/site-packages/cle/loader.py", line 1074, in <module>
    from .backends import MetaELF, ELF, PE, Blob, ALL_BACKENDS, Backend
  File "/home/michael/.local/lib/python3.7/site-packages/cle/backends/__init__.py", line 366, in <module>
    from .elf import ELF, ELFCore, MetaELF
  File "/home/michael/.local/lib/python3.7/site-packages/cle/backends/elf/__init__.py", line 1, in <module>
    from .elf import ELF
  File "/home/michael/.local/lib/python3.7/site-packages/cle/backends/elf/elf.py", line 12, in <module>
    from .metaelf import MetaELF, maybedecode
  File "/home/michael/.local/lib/python3.7/site-packages/cle/backends/elf/metaelf.py", line 1, in <module>
    import pyvex
  File "/home/michael/.local/lib/python3.7/site-packages/pyvex/__init__.py", line 17, in <module>
    ffi = cffi.FFI()
  File "/home/michael/.local/lib/python3.7/site-packages/cffi/api.py", line 48, in __init__
    import _cffi_backend as backend
ModuleNotFoundError: No module named '_cffi_backend'

testing manul import:

Python 3.7.5 (default, Nov 20 2019, 09:21:52) 
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import _cffi_backend as backend
>>> backend.__file__
'/home/michael/.local/lib/python3.7/site-packages/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'
>>> 

by the way, your plugin need elftools and numpy, figured out from errors.

any idea what's going on?

marceloricciardi commented 1 year ago

Please, did you manage to solve this? I have the same problem.