标签:set plot mina div smi image ati sim linu
1、angr环境
yum install -y python-dev libffi-dev build-essential virtualenvwrapper
mkvirtualenv angr
问题:mkvirtualenv command not found
解决:
sudo pip install virtualenv
sudo pip install virtualenvwrapper
问题:You are using pip version 8.1.2, however version 10.0.1 is available.You should consider upgrading via the ‘pip install --upgrade pip‘ command.
解决:
pip install --upgrade pip
再重新上面两步操作,然后
vi ~/.bashrc
在最后面加下面两句话
export WORKON_HOME=~/.environments
source /usr/local/bin/virtualenvwrapper.sh
报错:-bash: /usr/local/bin/virtualenvwrapper.sh: 没有那个文件或目录
通过:
find / -name virtualenvwrapper.sh
找到后,修改~/.bashrc为找到的那个路径
重新加载.bashrc文件:
source ~/.bashrc
以上完成后即可再次:mkvirtualenv angr进入angr环境
2、cfg需要的包
以下就安装angr和输出cfg需要的包(用plot_cfg需要from angrutils import *,这个会出现很多依赖包没安装问题)
首先用workon angr命令进入angr环境,进入angr环境然后进入Python环境,然后输入import angr会出现问题:ImportError: No module named angr
输入from angrutils import *会依次出现以下4个问题:
1、ImportError: No module named angrutils
2、ImportError: No module named bingraphvis
3、ImportError: No module named pydot
4、ImportError: No module named simuvex
退出python环境(还在angr环境),运行以下依次解决上述5个问题:
git clone https://github.com/angr/angr-dev cd angr-dev #mkvirtualenv angr ./setup.sh
git clone https://github.com/axt/angr-utils
cd angr-utils
python setup.py build python setup.py install
git clone https://github.com/axt/bingraphvis cd bingraphvis python setup.py build python setup.py install
pip install graphviz pip install pydot
git clone https://github.com/angr/simuvex cd simuvex python setup.sh build python setup.sh install
然后进入python环境,可以成功运行下面:
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import angr
>>> from angrutils import *
>>>
但是在运行plot_cfg(cfg,"pid_cfg",asminst=True,remove_imports=True,remove_path_terminator=True)会出现以下问题:
OSError: [Errno 2] "dot" not found in path.
因为:后安装graphviz会出现类似:"dot" not found in path的问题。安装graphviz不要用pip install安装,否则还是会找不到可执行程序
所以先graphviz然后pydot:
yum insall graphviz
pip install pydot
3、angr容器
angr有一个docker容器可以使用:
# install docker
curl -sSL https://get.docker.com/ | sudo sh
# pull the docker image
sudo docker pull angr/angr
# run it
sudo docker run -it angr
但是在里面运行from angrutils import *还是会出现上述问题,就按照上述解决即可
感觉描述有点不严谨呀....但是以上运行下来,我的机器上是可以正确使用angr和plot_cfg等
标签:set plot mina div smi image ati sim linu
原文地址:https://www.cnblogs.com/beixiaobei/p/9168912.html