README.md的内容

安装

Step 1: Install dependencies

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install \
     git \
     curl \
     cmake \
     python2.7 python-pip python-virtualenv \
     wget \
     build-essential \
     gcc-multilib g++-multilib \
     libtinfo-dev \
     lsb-release \
     realpath \ # 已经有了,且说找不到这个包,所以没装这个
     zlib1g-dev \
     ccache

If you are going to be using IDA Pro for CFG recovery also do the following:

sudo dpkg --add-architecture i386
sudo apt-get install zip zlib1g-dev:i386

Step 1.5 (Optional): Create a virtualenv for your McSema installation

mkdir mcsema-ve
virtualenv mcsema-ve
cd mcsema-ve
# 实验了一下,只是当前shell有效
# 执行source activate以前which python打印的是我系统里的python路径;执行后打印的是virtualenv创建目录里的python
source bin/activate 

Step 2: Clone the repository

# 将remill设置到mcsea在.remill_commit_id文件里指定的commit上去
# 将mcsema文件夹复制到移动到remill根目录里更名为tools文件夹 # 是否是复制为tools还是复制到tools里,存疑。

Step 3: Build McSema

# 全局安装
./scripts/build.sh
# 用virtualenv安装
./scripts/build.sh --prefix $(realpath ../)

Step 4: Install McSema

cd remill-build
# 全局安装
sudo make install
# 建议用checkinstall,安装好的包叫remill
sudo checkinstall -D make install # 生成deb包

# 用virtualenv安装
make install

装到了../lib/../bin/里。../~/Codes/

测试

参考mcseca/README.md提到的mcseca/tests/MakingTests.md

# 进入remill/tools/mcsema/tests/test_suite_generator
mkdir build
cd build
export TRAILOFBITS_LIBRARIES=<path to remill libraries>
# 这里遇到了问题,用于构建控制流图的软件ida是一个付费的商业软件!
export IDAT64_PATH=<path to idat64>
#example: 
#export TRAILOFBITS_LIBRARIES=/store/artem/git/remill/remill-build/libraries/
#export IDAT64_PATH=/home/artem/ida-7.1/idat64
#export CMAKE_PROGRAM_PATH=$(dirname ${IDAT64_PATH})

cmake ..
make
make install #install to ../test_suite

# 突然发现免费版的IDA里没有IDAT这个软件!!!

然后在mcsema/README.md的FAQ里看到了用于构建控制流图的其他俩软件的介绍,

  • Binary Ninja也是商业软件
  • DynInst,说明位于mcsema/tools/mcsema_disass/dyninst/README.md,内容总结如下

DynInst

github主页官网主页

一片关于关于DynInst作为McSema前端的本科生学位论文(diploma thesis),其中很多关于McSema的内容。

McSema的资助方

看McSema二进制翻译项目的演示文稿,每一页的底部都有这样三句话

“This research was developed with funding from the Defense Advanced Research Projects Agency (DARPA).” “The views expressed are those of the author(s) and do not reflect the official policy or position of the Department of Defens e or the U.S. Government.” Distribution Statement “A” (Approved for Public Release, Distribution Unlimited)

看来是美国国防部先进研究项目局(DARPA)资助了McSema项目。在知乎上查DARPA,找到了DARPA(美国国防部先进研究项目局)是个什么样的机构?

这么说吧,我国工科院校的教授们申请纵向项目(尤其是军口)时,往往先查一下DARPA有没有做相关的,做到什么程度了。