From 33e4b6c6b9d990901fb09e539f17fbcafcff5de6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 10 May 2020 17:52:24 +0200 Subject: [PATCH] :wrench: Update afl-hepler --- scripts/afl-helper.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/afl-helper.sh b/scripts/afl-helper.sh index 5cd60101..49743361 100644 --- a/scripts/afl-helper.sh +++ b/scripts/afl-helper.sh @@ -1,11 +1,24 @@ -set -e [ $# -lt 2 ] && { echo "usage: afl-helper crash_dir out_dir" exit 1 } +# check false positive +FUZZER=$PWD/gwion-fuzz +FAULT=0 +pushd $1 +for a in id* +do + cat $a | $FUZZER || FAULT=$((FAULT+1)) +done +[ $FAULT = 0 ] && { echo "only false positive"; exit 1; } +popd + +set -e + DEST=$(realpath $2) -cd $DEST +[ -d $DEST ] || mkdir $DEST +pushd $DEST NUM=$(ls *.gw | wc -l) TMP=0 for a in *.gw @@ -13,10 +26,12 @@ do mv $a ${TMP}.gw TMP=$((TMP+1)) done +popd -cd $1 +pushd $1 for a in id* do cp $a $DEST/${NUM}.gw NUM=$((NUM+1)) done +popd -- 2.43.0