From 8e9f507bbc594e187bbb06825c5e4a4ddfb87837 Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Sat, 9 May 2020 18:49:32 +0200 Subject: unicorn_mode/samples/persistent/Makefile: fix non-Linux support --- unicorn_mode/samples/persistent/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'unicorn_mode') diff --git a/unicorn_mode/samples/persistent/Makefile b/unicorn_mode/samples/persistent/Makefile index 9c7ed7aa..9596facc 100644 --- a/unicorn_mode/samples/persistent/Makefile +++ b/unicorn_mode/samples/persistent/Makefile @@ -17,9 +17,9 @@ CFLAGS += -Wall -Werror -I../../unicornafl/include LDFLAGS += -L$(LIBDIR) -lpthread -lm -_LRT = $(_UNIQ)$(UNAME_S:Linux=) -__LRT = $(_LRT:$(_UNIQ)=-lrt) -LRT = $(__LRT:$(_UNIQ)=) +_LRT = $(_UNIQ)$(UNAME_S) +__LRT = $(_LRT:$(_UNIQ)Linux=-lrt) +LRT = $(__LRT:$(_UNIQ)$(UNAME_S)=) LDFLAGS += $(LRT) @@ -48,3 +48,6 @@ debug: harness-debug.o fuzz: harness ../../../afl-fuzz -m none -i sample_inputs -o out -- ./harness @@ + +debugmake: + @echo UNAME_S=$(UNAME_S), _LRT=$(_LRT), __LRT=$(__LRT), LRT=$(LRT) -- cgit 1.4.1 From 041f19494ea183ed1abc24eb782a34fb7c3116fe Mon Sep 17 00:00:00 2001 From: hexcoder Date: Sat, 9 May 2020 18:51:33 +0200 Subject: minor fixes --- unicorn_mode/samples/persistent/COMPILE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'unicorn_mode') diff --git a/unicorn_mode/samples/persistent/COMPILE.md b/unicorn_mode/samples/persistent/COMPILE.md index 781f15c0..111dfc54 100644 --- a/unicorn_mode/samples/persistent/COMPILE.md +++ b/unicorn_mode/samples/persistent/COMPILE.md @@ -1,6 +1,6 @@ # C Sample -This shows a simple persistent harness for unicornafl in C +This shows a simple persistent harness for unicornafl in C. In contrast to the normal c harness, this harness manually resets the unicorn state on each new input. Thanks to this, we can rerun the testcase in unicorn multiple times, without the need to fork again. @@ -21,4 +21,4 @@ was built in case you want to rebuild it or recompile it for any reason. The pre-built binary (persistent_target_x86_64.bin) was built using -g -O0 in gcc. -We then load the binary we execute the main function directly. +We then load the binary and we execute the main function directly. -- cgit 1.4.1 From f37be09a92b846a95bee00d2a22b37fd63c6f9bb Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Mon, 11 May 2020 13:18:06 +0200 Subject: fixed unicornafl bug --- unicorn_mode/UNICORNAFL_VERSION | 2 +- unicorn_mode/unicornafl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'unicorn_mode') diff --git a/unicorn_mode/UNICORNAFL_VERSION b/unicorn_mode/UNICORNAFL_VERSION index c0cc9e02..18428f3e 100644 --- a/unicorn_mode/UNICORNAFL_VERSION +++ b/unicorn_mode/UNICORNAFL_VERSION @@ -1 +1 @@ -94c1976 +a5b79002ca18219c83f9aec4e71007917c6be2e0 diff --git a/unicorn_mode/unicornafl b/unicorn_mode/unicornafl index 94c19769..a5b79002 160000 --- a/unicorn_mode/unicornafl +++ b/unicorn_mode/unicornafl @@ -1 +1 @@ -Subproject commit 94c1976975518691a03602f7ec5a817e2f341183 +Subproject commit a5b79002ca18219c83f9aec4e71007917c6be2e0 -- cgit 1.4.1 From 4ee93331dc39e7abdc27ce437fc7ac594a9099bd Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Mon, 11 May 2020 15:11:11 +0200 Subject: updated unicornafl --- unicorn_mode/UNICORNAFL_VERSION | 2 +- unicorn_mode/update_uc_ref.sh | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'unicorn_mode') 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 +# 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 " + 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 .. -- cgit 1.4.1