forked from wmkhoo/taintgrind
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure_capstone.sh
36 lines (29 loc) · 922 Bytes
/
configure_capstone.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
if [ $# -ne 1 ]
then
echo "Error in $0 - Invalid Argument Count"
echo "Usage: $0 <valgrind-inst-dir>"
exit
fi
# example: sh configure_capstone.sh `pwd`/../inst
VG_INST_DIR=$1
CAPSTONE_VERSION="3.0.4"
#- 1 Apply patches
#==================
# guide to patches http://www.cyberciti.biz/faq/appy-patch-file-using-patch-command/
# patches were created with
# diff -rupN ./capstone/ ./capstone.patches/ > capstone.patch
# then I removed the Makefile one and the VG_define coz it fails or complains
patch -p1 < ./capstone-$CAPSTONE_VERSION.patch
retval=$?
if [ $retval -ne 0 ]; then
echo "Return code was not zero but $retval"
exit
fi
#-2 create make_capstone.sh with the rigth args
python make_capstone_options.py --vginstdir $VG_INST_DIR --capstonedir capstone-$CAPSTONE_VERSION --outmakefile make_capstone.sh
retval=$?
if [ $retval -ne 0 ]; then
echo "Return code was not zero but $retval"
exit
fi