summaryrefslogtreecommitdiff
path: root/tools/fuzzing/rost/minall.sh
blob: e32777d5144f3807392f4b8166cfccceffae8cac (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
#!/bin/bash

if [ -z "$FUZ_OUT" ]; then
    echo "$0 needs a \$FUZ_OUT environment variable!"
    exit 1
fi


SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

MIN_DIR="$SCRIPT_DIR/min"


mkdir -p "$MIN_DIR"

find "$FUZ_OUT/default/crashes/" -name 'id*' | while read f;
do

    id=$( echo $f | cut -d: -f2 | cut -d, -f1 )

    h=$( sha256sum $f | cut -d " " -f1 )

    afl-tmin -i "$f"  -o "$MIN_DIR/$id-$h.rost" -- /dev/shm/fuzzing-sys/bin/fast-rost /bin/ls

done