很明显这是没有找到库
Traceback (most recent call last):
File "/home/giant/pwndbg/gdbinit.py", line 36, in <module>
import pwndbg # isort:skip
File "/home/giant/pwndbg/pwndbg/__init__.py", line 13, in <module>
import pwndbg.arch
File "/home/giant/pwndbg/pwndbg/arch.py", line 12, in <module>
from capstone import *
File "/home/giant/.local/lib/python3.6/site-packages/capstone/__init__.py", line 230, in <module>
raise ImportError("ERROR: fail to load the dynamic library.")
ImportError: ERROR: fail to load the dynamic library.
我们可以去/home/giant/.local/lib/python3.6/site-packages/capstone/__init__.py
输出看看导入的库的路径(将下面的print输出注释掉,当然我这里已经将原来py2的输出改成py3了)
_lib_path = split(__file__)[0]
_all_libs = ['capstone.dll', 'libcapstone.so.3', 'libcapstone.so', 'libcapstone.dylib']
_found = False
for _lib in _all_libs:
try:
_lib_file = join(_lib_path, _lib)
# print("Trying to load:", _lib_file)
_cs = ctypes.cdll.LoadLibrary(_lib_file)
_found = True
break
except OSError:
pass
发现路径是/home/giant/.local/lib/python3.6/site-packages/capstone/
所以我们找一下find / -name libcapstone.so
,再复制过去就可以了
cp /usr/local/lib/python2.7/dist-packages/capstone/lib/libcapstone.so /home/giant/.local/lib/python3.6/site-packages/capstone/