-
Notifications
You must be signed in to change notification settings - Fork 16
/
test.sh
executable file
·35 lines (34 loc) · 836 Bytes
/
test.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
cd test
echo "====> Generating LLVM IR..."
clang -S -emit-llvm test.c -o test.ll
if [ $? != 0 ]; then
printf "\033[0;31mFAILED!\n"
exit 1
else
printf "\033[0;32mPASS\033[0m\n"
fi
echo "====> Obfuscating LLVM IR..."
clang -fpass-plugin=../build/obfuscator-llvm/ObfuscatorLLVM.so ./test.ll -S -emit-llvm -o test_obfuscated.ll
if [ $? != 0 ]; then
printf "\033[0;31mFAILED!\n"
exit 1
else
printf "\033[0;32mPASS\033[0m\n"
fi
echo "====> Compiling LLVM IR..."
clang -flto=full -march=native -O3 -Wl,-strip-all -o test test_obfuscated.ll
if [ $? != 0 ]; then
printf "\033[0;31mFAILED!\n"
exit 1
else
printf "\033[0;32mPASS\033[0m\n"
fi
echo "====> Running final executable..."
./test
if [ $? != 0 ]; then
printf "\033[0;31mFAILED!\n"
exit 1
else
printf "\033[0;32mPASS\033[0m\n"
fi