summaryrefslogtreecommitdiff
path: root/tools/afl/demangler.sh
blob: e82ccbf67c3cbf475d5aadada060eb45ae7b1176 (plain)
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
#ยง/bin/sh


if [ "$#" -ne 1 ]; then
    echo "Usage: $0 <type>"
    exit
fi

rm -rf testcase_dir findings_dir

mkdir testcase_dir findings_dir

n=0

for enc in $( cat ../../tests/mangling/$1.py | grep decode_routine | cut -d\' -f 2 );
do

    echo -n $enc > testcase_dir/$( printf "%03d" $n )

    n=$(( n + 1 ))

done


#echo -n '_Z4makeI7FactoryiET_IT0_Ev' > testcase_dir/00

afl-fuzz -t 100 -m 4096 -i testcase_dir -o findings_dir -- ./$1