From 346a7aa576d2744000beba56a2120783db1091dd Mon Sep 17 00:00:00 2001
From: Anh <zenpoems@gmail.com>
Date: Thu, 2 Aug 2018 18:04:26 +0000
Subject: [PATCH] Build stock afl and qemu afl

---
 build-all.sh           | 23 +++++++++++------------
 set_env_vars           |  1 +
 test/gzip/test_gzip.sh |  2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/build-all.sh b/build-all.sh
index ecfedce..a370201 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -1,30 +1,29 @@
 #!/bin/bash
 
 echo
-echo "Building Fuzzing Plugins"
+echo "Building Fuzzing Support"
 echo
 
-
 SCONSDEBUG=""
 if [[ "$*" =~ "--debug" ]]; then
 	SCONSDEBUG=" debug=1 "
 fi
 
-cd $AFL_TRANSFORMS
-scons $SCONSDEBUG -j 3 || exit
-
-cd $ZFUZZ_HOME/libzafl/src
-scons
-
 cd $ZFUZZ_HOME
 if [ ! -e afl ]; then
 	echo
 	echo Setup AFL
 	echo 
 	wget http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz
-	tar -xzvf afl-latest.tgz
-	rm afl-latest.tgz
+	tar -xzvf afl-latest.tgz && rm afl-latest.tgz
 	mv afl-* afl
-	cd afl
-	make
+	cd afl && make
+	cd qemu_mode && ./build_qemu_support.sh
 fi
+
+cd $AFL_TRANSFORMS
+scons $SCONSDEBUG -j 3 || exit
+
+cd $ZFUZZ_HOME/libzafl/src
+scons
+
diff --git a/set_env_vars b/set_env_vars
index 7c90af4..f5bb677 100644
--- a/set_env_vars
+++ b/set_env_vars
@@ -1,3 +1,4 @@
 export ZFUZZ_HOME=`pwd`
 export AFL_TRANSFORMS=$ZFUZZ_HOME/afl_transforms
 export AFL_PATH=$ZFUZZ_HOME/afl
+export PATH=$PATH:$AFL_PATH
diff --git a/test/gzip/test_gzip.sh b/test/gzip/test_gzip.sh
index ac5fbcc..cfff7ec 100755
--- a/test/gzip/test_gzip.sh
+++ b/test/gzip/test_gzip.sh
@@ -35,7 +35,7 @@ build_zafl()
 {
 	gzip_zafl=$1
 	shift
-	$PSZ `which gzip` $gzip_zafl -c move_globals=on -c zafl=on -o move_globals:--elftables $*
+	$PSZ `which gzip` $gzip_zafl -c move_globals=on -c zafl=on -o move_globals:--elftables -o zipr:--traceplacement:on -o zipr:true $*
 	if [ ! $? -eq 0 ]; then
 		log_error "$gzip_zafl: unable to generate Zafl version"	
 	else
-- 
GitLab