|
1 | 1 | #!/bin/bash -ex
|
2 | 2 |
|
3 |
| -[ -e panda ] || git clone --depth 1 https://github.com/moyix/panda |
| 3 | +[ -e panda ] || git clone --recursive https://github.com/panda-re/panda |
4 | 4 |
|
5 |
| -curl -O http://ragestorm.net/distorm/distorm3.3-package.zip |
6 |
| -rm -rf distorm3 |
7 |
| -unzip distorm3.3-package.zip |
8 |
| -make -C distorm3/make/linux -j |
9 |
| -mkdir -p lib |
10 |
| -cp distorm3/make/linux/*.so distorm3/*.a lib |
11 |
| -mkdir -p include |
12 |
| -cp distorm3/include/*.h include |
| 5 | +# git includes submodules hence recursive |
13 | 6 |
|
14 | 7 | ctf-tools-pip install -U pycparser
|
15 | 8 |
|
16 |
| -sed -i -e "s|/usr/local|$PWD|" panda/qemu/build.sh |
17 |
| -export QEMU_CFLAGS="-I $PWD/include -L $PWD/lib" |
18 |
| -export QEMU_CXXFLAGS="-I $PWD/include -L $PWD/lib" |
| 9 | +git clone git://git.code.sf.net/p/libdwarf/code libdwarf-code |
| 10 | + |
| 11 | +# move to ctftools virtual env |
| 12 | +source ctf-tools-venv-activate |
| 13 | + |
| 14 | +pushd libdwarf-code |
| 15 | +./configure --enable-shared |
| 16 | +make -j$(nproc) |
| 17 | +mkdir -p ../include |
| 18 | +mkdir -p ../lib |
| 19 | +cp libdwarf/libdwarf.h ../include |
| 20 | +cp libdwarf/dwarf.h ../include |
| 21 | +cp libdwarf/libdwarf.so ../lib |
| 22 | +popd |
| 23 | + |
| 24 | +#sed -i -e "s|/usr/local|$PWD|" panda/build.sh |
| 25 | +export QEMU_CFLAGS="-I $PWD/include" |
| 26 | +export QEMU_CXXFLAGS="-I $PWD/include" |
19 | 27 | #export LDFLAGS="-L $PWD/lib"
|
20 |
| -cd panda/qemu |
21 |
| -./build.sh |
| 28 | +mkdir -p panda/build |
| 29 | +cd panda/build |
| 30 | +../build.sh "$@" |
22 | 31 | cd ../../
|
23 | 32 |
|
24 | 33 | # link binaries
|
25 | 34 | mkdir -p bin
|
26 | 35 | cd bin
|
27 |
| -ln -s ../panda/qemu/i386-softmmu/qemu-system-i386 ./panda-qemu-system-i386 |
28 |
| -ln -s ../panda/qemu/arm-softmmu/qemu-system-arm ./panda-qemu-system-arm |
29 |
| -ln -s ../panda/qemu/x86_64-softmmu/qemu-system-x86_64 ./panda-qemu-system-x86_64 |
| 36 | +ln -s ../panda/build/i386-softmmu/qemu-system-i386 ./panda-qemu-system-i386 |
| 37 | +ln -s ../panda/build/arm-softmmu/qemu-system-arm ./panda-qemu-system-arm |
| 38 | +ln -s ../panda/build/x86_64-softmmu/qemu-system-x86_64 ./panda-qemu-system-x86_64 |
30 | 39 | for i in ../panda/scripts/*.py
|
31 | 40 | do
|
32 | 41 | ln -s $i ./panda-$(basename $i)
|
|
0 commit comments