The python files in mcsema are placed in /usr/local/lib/python2.7/dist-packages/mcsema_disass-2.0-py2.7.egg/mcsema_disass/ directory, so some ida interfaces are also in / usr / local / lib / Under python2.7 / dist-packages / mcsema_disass-2.0-py2.7.egg / mcsema_disass /, the ida reference is unsuccessful in the ordinary directory
Python environment import cannot find custom module in linux environment
Problem phenomenon:
The custom module ida in the Linux environment, import ida error. The ida module is in the /usr/local/lib/python2.7/dist-packages/mcsema_disass-2.0-py2.7.egg/mcsema_disass/ directory.
Solution 1: This method took effect at the time, but it needs to be written into each file to import without errors.
import sys sys.path.append('export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages/mcsema_disass-2.0-py2.7.egg/mcsema_disass/') import ida import ida7 #成功
Solution 2: Modify the environment variable / etc / profile
vi / etc / profile is added in the last line
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages/mcsema_disass-2.0-py2.7.egg/mcsema_disass/
source / etc / profile takes effect immediately, and all files can be imported into modules under /usr/local/lib/python2.7/dist-packages/mcsema_disass-2.0-py2.7.egg/mcsema_disass/.