about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDominik Maier <domenukk@gmail.com>2020-05-11 15:11:11 +0200
committerDominik Maier <domenukk@gmail.com>2020-05-11 15:11:11 +0200
commit4ee93331dc39e7abdc27ce437fc7ac594a9099bd (patch)
tree9185d75f3dd641df8b5a54e2127c2d674bd64e88
parent30a675ab875d2f9ef971324a154fb4f46cebc122 (diff)
downloadafl++-4ee93331dc39e7abdc27ce437fc7ac594a9099bd.tar.gz
updated unicornafl
-rw-r--r--unicorn_mode/UNICORNAFL_VERSION2
-rwxr-xr-xunicorn_mode/update_uc_ref.sh24
2 files changed, 23 insertions, 3 deletions
diff --git a/unicorn_mode/UNICORNAFL_VERSION b/unicorn_mode/UNICORNAFL_VERSION
index 18428f3e..336c171b 100644
--- a/unicorn_mode/UNICORNAFL_VERSION
+++ b/unicorn_mode/UNICORNAFL_VERSION
@@ -1 +1 @@
-a5b79002ca18219c83f9aec4e71007917c6be2e0
+a5b7900
diff --git a/unicorn_mode/update_uc_ref.sh b/unicorn_mode/update_uc_ref.sh
index d198fa2a..486f37d6 100755
--- a/unicorn_mode/update_uc_ref.sh
+++ b/unicorn_mode/update_uc_ref.sh
@@ -1,20 +1,40 @@
 #/bin/sh
 
+##################################################
+# AFL++ internal tool to update unicornafl ref.
+# Usage: ./update_uc_ref.sh <new commit hash>
+# If no commit hash was provided, it'll take HEAD.
+##################################################
+
 UC_VERSION_FILE='./UNICORNAFL_VERSION'
 
 NEW_VERSION="$1"
-if [ -z "$NEW_VERSION" ]; then
+
+if [ "$NEW_VERSION" = "-h" ]; then
   echo "Internal script to update bound unicornafl version."
   echo
   echo "Usage: ./update_uc_ref.sh <new commit hash>"
+  echo "If no commit hash is provided, will use HEAD."
+  echo "-h to show this help screen."
   exit 1
 fi
 
 git submodule init && git submodule update || exit 1
-cd ./unicornafl
+cd ./unicornafl || exit 1
 git fetch origin master 1>/dev/null || exit 1
 git stash 1>/dev/null 2>/dev/null
 git stash drop 1>/dev/null 2>/dev/null
+
+if [ -z "$NEW_VERSION" ]; then
+  # No version provided, take HEAD.
+  NEW_VERSION=$(git rev-parse --short HEAD)
+fi
+
+if [ -z "$NEW_VERSION" ]; then
+  echo "Error getting version."
+  exit 1
+fi
+
 git checkout "$NEW_VERSION" || exit 1
 
 cd ..