summaryrefslogtreecommitdiff
path: root/tools/fuzzing/rost/minall.sh
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-11-13 01:20:17 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-11-13 01:20:17 (GMT)
commit6f1f98b46c4753bbbb5b763c64ada556170185b4 (patch)
treea50f2925dd5c1368dbf7f57c0c1a4033ae419b91 /tools/fuzzing/rost/minall.sh
parente279139b7dcae080723412ea475787123c2389d4 (diff)
Provide some helpers to run ROST with AFL++.
Diffstat (limited to 'tools/fuzzing/rost/minall.sh')
-rwxr-xr-xtools/fuzzing/rost/minall.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/fuzzing/rost/minall.sh b/tools/fuzzing/rost/minall.sh
new file mode 100755
index 0000000..e32777d
--- /dev/null
+++ b/tools/fuzzing/rost/minall.sh
@@ -0,0 +1,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