#!/bin/bash
mkdir loco
cd loco
rm Judy-1.0.1.tar.gz
wget http://diablo.elis.ugent.be/sites/diablo/files/obfuscation/Judy-1.0.1.tar.gz
tar -xvzf Judy-1.0.1.tar.gz
cd Judy-1.0.1
./configure  --prefix=`pwd`/..  --enable-32-bit --disable-shared
make install
cd ..
for tarball in diablosupport-0.4.1.tar.gz diabloobject-0.4.1.tar.gz diabloflowgraph-0.4.1.tar.gz diabloanopt-0.4.1.tar.gz lancet-0.4.1.tar.gz
do
rm $tarball
wget http://diablo.elis.ugent.be/sites/diablo/files/release-0.4.1/$tarball
tar -xvzf $tarball
cd `echo $tarball | sed "s/.tar.gz//g"`
./build_local
cd ..
done
for tarball in i386assembler-0.4.0.tar.gz obf_flatten-0.0.1.tar.gz obf_opaque-0.0.1.tar.gz
do
rm $tarball
wget http://diablo.elis.ugent.be/sites/diablo/files/obfuscation/$tarball
tar -xvzf $tarball
cd `echo $tarball | sed "s/.tar.gz//g"`
./build_local
cd ..
done
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/lib/pkgconfig
wget http://diablo.elis.ugent.be/sites/diablo/files/obfuscation/Loco-0.0.1/frontend/loco_frontend.c
wget http://diablo.elis.ugent.be/sites/diablo/files/obfuscation/Loco-0.0.1/frontend/loco_gluecode.c
wget http://diablo.elis.ugent.be/sites/diablo/files/obfuscation/Loco-0.0.1/frontend/loco_gluecode.h
gcc  -c `pkg-config --cflags diabloanopt_opt32` loco_gluecode.c `pkg-config  --cflags diabloanopt_opt32` `pkg-config --cflags lancet_opt32`
gcc -g -o bin/loco `pkg-config --libs --cflags diabloanopt_opt32` loco_frontend.c loco_gluecode.o `pkg-config --libs --cflags diabloanopt_opt32`  `pkg-config --libs --cflags lancet_opt32` `pkg-config --libs --cflags obf_flatten_opt32` `pkg-config --libs --cflags obf_opaque_opt32` `pkg-config --libs --cflags i386assembler_opt32` -lJudy -lm
echo Build complete!
echo Use the bin/loco file to obfuscate x86-binaries!
echo Have Fun!
