about summary refs log tree commit diff
path: root/unicorn_mode
diff options
context:
space:
mode:
Diffstat (limited to 'unicorn_mode')
-rwxr-xr-xunicorn_mode/build_unicorn_support.sh33
m---------unicorn_mode/unicornafl0
2 files changed, 22 insertions, 11 deletions
diff --git a/unicorn_mode/build_unicorn_support.sh b/unicorn_mode/build_unicorn_support.sh
index 8297e13f..0c84c07b 100755
--- a/unicorn_mode/build_unicorn_support.sh
+++ b/unicorn_mode/build_unicorn_support.sh
@@ -33,7 +33,7 @@
 # You must make sure that Unicorn Engine is not already installed before
 # running this script. If it is, please uninstall it first.
 
-UNICORNAFL_VERSION='afl++2.64c'
+UNICORNAFL_VERSION="$(cat ./UNICORNAFL_VERSION)"
 
 echo "================================================="
 echo "UnicornAFL build script"
@@ -146,21 +146,32 @@ fi
 echo "[+] All checks passed!"
 
 echo "[*] Making sure unicornafl is checked out"
-rm -rf unicornafl # workaround for travis ... sadly ...
-#test -d unicorn && { cd unicorn && { git stash ; git pull ; cd .. ; } }
-test -d unicornafl || {
-   CNT=1
-   while [ '!' -d unicornafl -a "$CNT" -lt 4 ]; do
-     echo "Trying to clone unicornafl (attempt $CNT/3)"
-     git clone https://github.com/AFLplusplus/unicornafl
-     CNT=`expr "$CNT" + 1`
-   done
-}
+
+git status 1>/dev/null 2>/dev/null
+if [ $? -eq 0 ]; then
+  echo "[*] initializing unicornafl submodule"
+  git submodule init || exit 1
+  git submodule update 2>/dev/null # ignore errors
+else
+  echo "[*] cloning unicornafl"
+  rm -rf unicornafl # workaround for travis ... sadly ...
+  #test -d unicorn && { cd unicorn && { git stash ; git pull ; cd .. ; } }
+  test -d unicornafl || {
+    CNT=1
+    while [ '!' -d unicornafl -a "$CNT" -lt 4 ]; do
+      echo "Trying to clone unicornafl (attempt $CNT/3)"
+      git clone https://github.com/AFLplusplus/unicornafl
+      CNT=`expr "$CNT" + 1`
+    done
+  }
+fi
+
 test -d unicornafl || { echo "[-] not checked out, please install git or check your internet connection." ; exit 1 ; }
 echo "[+] Got unicornafl."
 
 cd "unicornafl" || exit 1
 echo "[*] Checking out $UNICORNAFL_VERSION"
+sh -c 'git stash && git stash drop' 1>/dev/null 2>/dev/null
 git checkout "$UNICORNAFL_VERSION" || exit 1
 
 echo "[*] making sure config.h matches"
diff --git a/unicorn_mode/unicornafl b/unicorn_mode/unicornafl
new file mode 160000
+Subproject 89fd1f66912c8e0918ba0658b16bda204607e44