Mac 10.15 下 python3 安装 cemu

喜欢而已 提交于 2020-03-04 14:19:49

记录一下 arm 汇编神器 cemu 在 mac 上的安装,踩了很多坑

 

mac 上官网的安装方式

$ brew install capstone
$ pip3 install -U cemu

由于 pip 上的的依赖没有更新,在安装时会遇到各种问题,主要就是库找不到,所以需要自己编译需要的库

先看看都需要什么依赖

❯ pip3 install cemu
Requirement already satisfied: cemu in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (0.5)
Requirement already satisfied: capstone>=3.0.4 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from cemu) (4.0.1)
Requirement already satisfied: unicorn>=1.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/unicorn-1.0.1-py3.7.egg (from cemu) (1.0.1)
Requirement already satisfied: PyQt5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from cemu) (5.14.1)
Requirement already satisfied: Pygments>=2.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Pygments-2.5.2-py3.7.egg (from cemu) (2.5.2)
Requirement already satisfied: lief in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/lief-0.10.1-py3.7-macosx-10.9-x86_64.egg (from cemu) (0.10.1)
Requirement already satisfied: keystone-engine>=0.9 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from cemu) (0.9.1.post3)
Requirement already satisfied: PyQt5-sip<13,>=12.7 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from PyQt5->cemu) (12.7.1)

下载的库有 cemu、capstone-3.0.4、unicorn-1.0.1、PtQt5、Pygments-2.0、lief、keystone-engine-9.1.3、PyQt5

这里面有问题的是 capstone、unicorn和keystone

编译需要 cmake 工具, 地址:https://cmake.org

1.编译 capstone 

git clone https://github.com/aquynh/capstone
cd capstone
mkdir build
cd build
cmake ..
make -j4
sudo make install
cd ../bindings/python
sudo make install3

2.编译 unicorn

git clone https://github.com/unicorn-engine/unicorn
cd unicorn
mkdir build
cd build
cmake ..
make -j4
sudo make install
cd ../bindings/python
sudo make install3

编译的时候会报错 config-host.h 找不到,在文件了搜一下就找到了,复制到对应文件夹下就好了

3.编译 keystone

git clone https://github.com/keystone-engine/keystone
cd keystone
mkdir build
cd build
../make-lib.sh
sudo make install
cd ./bindings/python
sudo make install
cd ./bindings/python
sudo make install

最后 

git clone https://github.com/yformaggio/cemu
cd cemu
python3 main.py

 

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!