-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hikari RNG seeded to ensure test replicability
- Loading branch information
Showing
21 changed files
with
104 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
clang main.c -o example | ||
clang main.c -o example_obf -mllvm --enable-bcfobf -mllvm --bcf_prob=100 -mllvm --enable-indibran -mllvm --enable-subobf -mllvm --sub_prob=100 -mllvm --sub_loop=1 -mllvm --aesSeed=1337 |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <time.h> | ||
|
||
void function() { | ||
srand(time(NULL)); | ||
|
||
for (int i = 0; i < 10; i++) { | ||
int n = rand() % 100; | ||
if (n == 0) { | ||
puts("Number is zero!"); | ||
} | ||
|
||
if (n % 2 == 0) { | ||
if (n % 10 == 0) { | ||
puts("Number is divisible by 10!"); | ||
} else { | ||
puts("Number is even!"); | ||
} | ||
} | ||
|
||
puts("Number is odd!"); | ||
} | ||
} | ||
|
||
int main(int argc, char** argv) { | ||
function(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
clang gmp-chudnovsky.c -o test_orig -lgmp -lm | ||
clang gmp-chudnovsky.c -o test_sub_1 -lgmp -lm -mllvm --enable-subobf -mllvm --sub_prob=100 -mllvm --sub_loop=1 | ||
clang gmp-chudnovsky.c -o test_sub_2 -lgmp -lm -mllvm --enable-subobf -mllvm --sub_prob=100 -mllvm --sub_loop=2 | ||
clang gmp-chudnovsky.c -o test_cff -lgmp -lm -mllvm --enable-cffobf | ||
clang gmp-chudnovsky.c -o test_indir -lgmp -lm -mllvm --enable-indibran | ||
clang gmp-chudnovsky.c -o test_bcf -lgmp -lm -mllvm --enable-bcfobf -mllvm --bcf_prob=100 | ||
clang gmp-chudnovsky.c -o test_sub_1 -lgmp -lm -mllvm --enable-subobf -mllvm --sub_prob=100 -mllvm --sub_loop=1 -mllvm --aesSeed=1337 | ||
clang gmp-chudnovsky.c -o test_sub_2 -lgmp -lm -mllvm --enable-subobf -mllvm --sub_prob=100 -mllvm --sub_loop=2 -mllvm --aesSeed=1337 | ||
clang gmp-chudnovsky.c -o test_cff -lgmp -lm -mllvm --enable-cffobf -mllvm --aesSeed=1337 | ||
clang gmp-chudnovsky.c -o test_indir -lgmp -lm -mllvm --enable-indibran -mllvm --aesSeed=1337 | ||
clang gmp-chudnovsky.c -o test_bcf -lgmp -lm -mllvm --enable-bcfobf -mllvm --bcf_prob=100 -mllvm --aesSeed=1337 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
test_bcf,0.946 | ||
test_cff,0.702 | ||
test_indir,1.464 | ||
test_bcf,0.984 | ||
test_cff,0.728 | ||
test_indir,1.400 | ||
test_orig,0.596 | ||
test_sub_1,0.591 | ||
test_sub_2,0.646 | ||
test_sub_1,0.611 | ||
test_sub_2,0.686 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
rm -f results_percentage.csv | ||
|
||
chudnovsky_orig=0 | ||
quicksort_orig=0 | ||
|
||
while read line | ||
do | ||
if [[ $line == 'Original'* ]]; then | ||
while IFS="," read -r c1 c2 c3 | ||
do | ||
chudnovsky_orig=$c2 | ||
quicksort_orig=$c3 | ||
echo "Chudnovsky Original: $chudnovsky_orig" | ||
echo "Quicksort Original: $quicksort_orig" | ||
done < <(echo $line) | ||
break | ||
fi | ||
done < results.csv | ||
|
||
while read line | ||
do | ||
if [[ $line == 'Method'* ]]; then | ||
echo $line >> results_percentage.csv | ||
continue | ||
fi | ||
|
||
while IFS="," read -r c1 c2 c3 | ||
do | ||
chudnovsky=$(printf "%.1f" $(echo "scale=4; ($c2/$chudnovsky_orig)*100" | bc)) | ||
quicksort=$(printf "%.1f" $(echo "scale=4; ($c3/$quicksort_orig)*100" | bc)) | ||
echo "Chudnovsky: $chudnovsky" | ||
echo "Quicksort: $quicksort" | ||
echo "$c1,$chudnovsky,$quicksort" >> results_percentage.csv | ||
done < <(echo $line) | ||
done < results.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
clang src-quicksort.c -o test_orig -lgmp -lm | ||
clang src-quicksort.c -o test_sub_1 -lgmp -lm -mllvm --enable-subobf -mllvm --sub_prob=100 -mllvm --sub_loop=1 | ||
clang src-quicksort.c -o test_sub_2 -lgmp -lm -mllvm --enable-subobf -mllvm --sub_prob=100 -mllvm --sub_loop=2 | ||
clang src-quicksort.c -o test_cff -lgmp -lm -mllvm --enable-cffobf | ||
clang src-quicksort.c -o test_indir -lgmp -lm -mllvm --enable-indibran | ||
clang src-quicksort.c -o test_bcf -lgmp -lm -mllvm --enable-bcfobf -mllvm --bcf_prob=100 | ||
clang src-quicksort.c -o test_sub_1 -lgmp -lm -mllvm --enable-subobf -mllvm --sub_prob=100 -mllvm --sub_loop=1 -mllvm --aesSeed=1337 | ||
clang src-quicksort.c -o test_sub_2 -lgmp -lm -mllvm --enable-subobf -mllvm --sub_prob=100 -mllvm --sub_loop=2 -mllvm --aesSeed=1337 | ||
clang src-quicksort.c -o test_cff -lgmp -lm -mllvm --enable-cffobf -mllvm --aesSeed=1337 | ||
clang src-quicksort.c -o test_indir -lgmp -lm -mllvm --enable-indibran -mllvm --aesSeed=1337 | ||
clang src-quicksort.c -o test_bcf -lgmp -lm -mllvm --enable-bcfobf -mllvm --bcf_prob=100 -mllvm --aesSeed=1337 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
test_bcf,10.229 | ||
test_cff,21.746 | ||
test_indir,15.041 | ||
test_orig,4.664 | ||
test_sub_1,4.761 | ||
test_sub_2,5.208 | ||
test_bcf,8.442 | ||
test_cff,27.886 | ||
test_indir,13.257 | ||
test_orig,4.669 | ||
test_sub_1,4.784 | ||
test_sub_2,5.358 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Method,Chudnovsky,Quicksort | ||
Original,0.596,4.664, | ||
Control Flow Flattening,0.702,21.746, | ||
Indirect Branching,1.464,15.041, | ||
Bogus Control Flow,0.946,10.229, | ||
Instruction Substitution (1 pass),0.591,4.761, | ||
Instruction Substitution (2 passes),0.646,5.208, | ||
Original,0.596,4.669 | ||
Control Flow Flattening,0.728,27.886 | ||
Indirect Branching,1.400,13.257 | ||
Bogus Control Flow,0.984,8.442 | ||
Instruction Substitution (1 pass),0.611,4.784 | ||
Instruction Substitution (2 passes),0.686,5.358 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Method,Chudnovsky,Quicksort | ||
Original,100.0,100.0 | ||
Control Flow Flattening,122.1,597.2 | ||
Indirect Branching,234.9,283.9 | ||
Bogus Control Flow,165.1,180.8 | ||
Instruction Substitution (1 pass),102.5,102.5 | ||
Instruction Substitution (2 passes),115.1,114.8 |