빨간색 글자는 반드시 따라 안 하셔도 되며, 자신의 홈 디렉터리 위치에 맞도록 하시길 바랍니다.

 

환경

Ubuntu 14.04 LTS (다른 버전에서 원활하게 빌드가 되지 않을 수 있습니다)

 

설치

$ git clone https://github.com/ucsb-seclab/difuze.git

$ sudo apt-get update

$ sudo apt-get install libxml2-dev; sudo apt-get install clang; sudo apt-get install sparse; sudo apt-get install bear; sudo apt-get install cmake; sudo apt-get install llvm;

$ pip2 install lxml

$ cd difuze

$ cd helper_scripts

$ python setup_difuze.py -o difuze_deps

$ vim ~/.bashrc

export LLVM_ROOT=/home/netkingj/difuze/helper_scripts/difuze_deps/llvm/build 
export PATH=$LLVM_ROOT/bin:difuze_deps/sparse:$PATH

$ source ~/.bashrc

$ cd ../InterfaceHandlers

$ ./build.sh

 

예제

파일 : 33.2.A.3.123.tar.bz2

$ mv 33.2.A.3.123 mediatek_kernel

$ cd ~/mediatek_kernel

$ source ./env.sh

$ cd kernel-3.18

$ mkdir out

$ make O=out ARCH=arm64 tubads_defconfig

$ bear make O=out ARCH=arm64

$ cd ~/difuze/helper_scripts

$ python run_all.py -l ~/mediatek_kernel/llvm_bitcode_out -a 1 -c ~/mediatek_kernel/kernel-3.18/compile_commands.json -n 2 -o ~/mediatek_kernel/kernel-3.18/out -k ~/mediatek_kernel/kernel-3.18 -f ~/mediatek_kernel/ioctl_finder_out