Skip to content
Snippets Groups Projects
Unverified Commit 71011928 authored by van Hauser's avatar van Hauser Committed by GitHub
Browse files

Merge pull request #1682 from AFLplusplus/dev

push to stable
parents 64fd01d4 19f96129
Branches
Tags
No related merge requests found
PWD:=$(shell pwd)/ PWD:=$(shell pwd)/
ROOT:=$(PWD)../ ROOT:=$(PWD)../
INC_DIR:=$(PWD)include/ INC_DIR:=$(PWD)include/
...@@ -164,7 +165,7 @@ ifndef OS ...@@ -164,7 +165,7 @@ ifndef OS
$(error "Operating system unsupported") $(error "Operating system unsupported")
endif endif
GUM_DEVKIT_VERSION=16.0.6 GUM_DEVKIT_VERSION=16.0.11
GUM_DEVKIT_FILENAME=frida-gumjs-devkit-$(GUM_DEVKIT_VERSION)-$(OS)-$(ARCH).tar.xz GUM_DEVKIT_FILENAME=frida-gumjs-devkit-$(GUM_DEVKIT_VERSION)-$(OS)-$(ARCH).tar.xz
GUM_DEVKIT_URL="https://github.com/frida/frida/releases/download/$(GUM_DEVKIT_VERSION)/$(GUM_DEVKIT_FILENAME)" GUM_DEVKIT_URL="https://github.com/frida/frida/releases/download/$(GUM_DEVKIT_VERSION)/$(GUM_DEVKIT_FILENAME)"
......
...@@ -59,7 +59,7 @@ static list_t fsrv_list = {.element_prealloc_count = 0}; ...@@ -59,7 +59,7 @@ static list_t fsrv_list = {.element_prealloc_count = 0};
static void fsrv_exec_child(afl_forkserver_t *fsrv, char **argv) { static void fsrv_exec_child(afl_forkserver_t *fsrv, char **argv) {
if (fsrv->qemu_mode || fsrv->frida_mode || fsrv->cs_mode) { if (fsrv->qemu_mode || fsrv->cs_mode) {
setenv("AFL_DISABLE_LLVM_INSTRUMENTATION", "1", 0); setenv("AFL_DISABLE_LLVM_INSTRUMENTATION", "1", 0);
......
...@@ -33,7 +33,7 @@ void cmplog_exec_child(afl_forkserver_t *fsrv, char **argv) { ...@@ -33,7 +33,7 @@ void cmplog_exec_child(afl_forkserver_t *fsrv, char **argv) {
setenv("___AFL_EINS_ZWEI_POLIZEI___", "1", 1); setenv("___AFL_EINS_ZWEI_POLIZEI___", "1", 1);
if (fsrv->qemu_mode || fsrv->frida_mode || fsrv->cs_mode) { if (fsrv->qemu_mode || fsrv->cs_mode) {
setenv("AFL_DISABLE_LLVM_INSTRUMENTATION", "1", 0); setenv("AFL_DISABLE_LLVM_INSTRUMENTATION", "1", 0);
......
...@@ -70,7 +70,7 @@ test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc ...@@ -70,7 +70,7 @@ test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc
test -z "$SKIP" && { test -z "$SKIP" && {
$ECHO "$GREY[*] running afl-fuzz for ${AFL_GCC}, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz for ${AFL_GCC}, this will take approx 10 seconds"
{ {
../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -D -- ./test-instr.plain >>errors 2>&1 ../afl-fuzz -V07 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with ${AFL_GCC}" $ECHO "$GREEN[+] afl-fuzz is working correctly with ${AFL_GCC}"
...@@ -191,7 +191,7 @@ test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc ...@@ -191,7 +191,7 @@ test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc
test -z "$SKIP" && { test -z "$SKIP" && {
$ECHO "$GREY[*] running afl-fuzz for ${AFL_CLANG}, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz for ${AFL_CLANG}, this will take approx 10 seconds"
{ {
../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -D -- ./test-instr.plain >>errors 2>&1 ../afl-fuzz -V07 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with ${AFL_CLANG}" $ECHO "$GREEN[+] afl-fuzz is working correctly with ${AFL_CLANG}"
......
...@@ -38,7 +38,7 @@ test -e test-custom-mutator.c -a -e ${CUSTOM_MUTATOR_PATH}/example.c -a -e ${CUS ...@@ -38,7 +38,7 @@ test -e test-custom-mutator.c -a -e ${CUSTOM_MUTATOR_PATH}/example.c -a -e ${CUS
# Run afl-fuzz w/ the C mutator # Run afl-fuzz w/ the C mutator
$ECHO "$GREY[*] running afl-fuzz for the C mutator, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz for the C mutator, this will take approx 10 seconds"
{ {
AFL_CUSTOM_MUTATOR_LIBRARY=./libexamplemutator.so AFL_CUSTOM_MUTATOR_ONLY=1 ../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -- ./test-custom-mutator >>errors 2>&1 AFL_CUSTOM_MUTATOR_LIBRARY=./libexamplemutator.so AFL_CUSTOM_MUTATOR_ONLY=1 ../afl-fuzz -V07 -m ${MEM_LIMIT} -i in -o out -- ./test-custom-mutator >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
# Check results # Check results
...@@ -58,7 +58,7 @@ test -e test-custom-mutator.c -a -e ${CUSTOM_MUTATOR_PATH}/example.c -a -e ${CUS ...@@ -58,7 +58,7 @@ test -e test-custom-mutator.c -a -e ${CUSTOM_MUTATOR_PATH}/example.c -a -e ${CUS
# Run afl-fuzz w/ multiple C mutators # Run afl-fuzz w/ multiple C mutators
$ECHO "$GREY[*] running afl-fuzz with multiple custom C mutators, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz with multiple custom C mutators, this will take approx 10 seconds"
{ {
AFL_CUSTOM_MUTATOR_LIBRARY="./libexamplemutator.so;./libexamplemutator2.so" AFL_CUSTOM_MUTATOR_ONLY=1 ../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -- ./test-multiple-mutators >>errors 2>&1 AFL_CUSTOM_MUTATOR_LIBRARY="./libexamplemutator.so;./libexamplemutator2.so" AFL_CUSTOM_MUTATOR_ONLY=1 ../afl-fuzz -V07 -m ${MEM_LIMIT} -i in -o out -- ./test-multiple-mutators >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/crashes/id:000000* 2>/dev/null )" && { # TODO: update here test -n "$( ls out/default/crashes/id:000000* 2>/dev/null )" && { # TODO: update here
...@@ -88,7 +88,7 @@ test "1" = "`../afl-fuzz | grep -i 'without python' >/dev/null; echo $?`" && { ...@@ -88,7 +88,7 @@ test "1" = "`../afl-fuzz | grep -i 'without python' >/dev/null; echo $?`" && {
{ {
export PYTHONPATH=${CUSTOM_MUTATOR_PATH} export PYTHONPATH=${CUSTOM_MUTATOR_PATH}
export AFL_PYTHON_MODULE=example export AFL_PYTHON_MODULE=example
AFL_CUSTOM_MUTATOR_ONLY=1 ../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -- ./test-custom-mutator >>errors 2>&1 AFL_CUSTOM_MUTATOR_ONLY=1 ../afl-fuzz -V07 -m ${MEM_LIMIT} -i in -o out -- ./test-custom-mutator >>errors 2>&1
unset PYTHONPATH unset PYTHONPATH
unset AFL_PYTHON_MODULE unset AFL_PYTHON_MODULE
} >>errors 2>&1 } >>errors 2>&1
......
...@@ -22,7 +22,7 @@ test -e ../afl-frida-trace.so && { ...@@ -22,7 +22,7 @@ test -e ../afl-frida-trace.so && {
echo 00000 > in/in echo 00000 > in/in
$ECHO "$GREY[*] running afl-fuzz for frida_mode, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz for frida_mode, this will take approx 10 seconds"
{ {
AFL_DEBUG=1 AFL_FRIDA_VERBOSE=1 ../afl-fuzz -m ${MEM_LIMIT} -V10 -O -i in -o out -- ./test-instr >>errors 2>&1 AFL_DEBUG=1 AFL_FRIDA_VERBOSE=1 ../afl-fuzz -m ${MEM_LIMIT} -V07 -O -i in -o out -- ./test-instr >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with frida_mode" $ECHO "$GREEN[+] afl-fuzz is working correctly with frida_mode"
...@@ -39,7 +39,7 @@ test -e ../afl-frida-trace.so && { ...@@ -39,7 +39,7 @@ test -e ../afl-frida-trace.so && {
test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc" -o "$SYS" = "aarch64" -o ! "${SYS%%arm*}" && { test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc" -o "$SYS" = "aarch64" -o ! "${SYS%%arm*}" && {
$ECHO "$GREY[*] running afl-fuzz for frida_mode cmplog, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz for frida_mode cmplog, this will take approx 10 seconds"
{ {
../afl-fuzz -m none -V10 -O -c 0 -i in -o out -- ./test-compcov >>errors 2>&1 ../afl-fuzz -m none -V07 -O -c 0 -i in -o out -- ./test-compcov >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000003* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000003* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with frida_mode cmplog" $ECHO "$GREEN[+] afl-fuzz is working correctly with frida_mode cmplog"
...@@ -67,7 +67,7 @@ test -e ../afl-frida-trace.so && { ...@@ -67,7 +67,7 @@ test -e ../afl-frida-trace.so && {
file test-instr file test-instr
export AFL_DEBUG_CHILD=1 export AFL_DEBUG_CHILD=1
export AFL_FRIDA_VERBOSE=1 export AFL_FRIDA_VERBOSE=1
../afl-fuzz -m ${MEM_LIMIT} -V10 -O -i in -o out -- ./test-instr ../afl-fuzz -m ${MEM_LIMIT} -V07 -O -i in -o out -- ./test-instr
nm test-instr | grep -i "main" nm test-instr | grep -i "main"
unset AFL_FRIDA_PERSISTENT_ADDR unset AFL_FRIDA_PERSISTENT_ADDR
} >>errors 2>&1 } >>errors 2>&1
......
...@@ -63,7 +63,7 @@ test -e ../afl-gcc-fast -a -e ../afl-compiler-rt.o && { ...@@ -63,7 +63,7 @@ test -e ../afl-gcc-fast -a -e ../afl-compiler-rt.o && {
echo 0 > in/in echo 0 > in/in
$ECHO "$GREY[*] running afl-fuzz for gcc_plugin, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz for gcc_plugin, this will take approx 10 seconds"
{ {
../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -D -- ./test-instr.plain.gccpi >>errors 2>&1 ../afl-fuzz -V07 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain.gccpi >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with gcc_plugin" $ECHO "$GREEN[+] afl-fuzz is working correctly with gcc_plugin"
......
...@@ -133,7 +133,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && { ...@@ -133,7 +133,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && {
test -z "$SKIP" && { test -z "$SKIP" && {
$ECHO "$GREY[*] running afl-fuzz for llvm_mode, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz for llvm_mode, this will take approx 10 seconds"
{ {
../afl-fuzz -V10 -m ${MEM_LIMIT} -i in -o out -D -- ./test-instr.plain >>errors 2>&1 ../afl-fuzz -V07 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with llvm_mode" $ECHO "$GREEN[+] afl-fuzz is working correctly with llvm_mode"
...@@ -228,7 +228,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && { ...@@ -228,7 +228,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && {
echo ZZZZ > in/in echo ZZZZ > in/in
$ECHO "$GREY[*] running afl-fuzz with floating point splitting, this will take max. 45 seconds" $ECHO "$GREY[*] running afl-fuzz with floating point splitting, this will take max. 45 seconds"
{ {
AFL_BENCH_UNTIL_CRASH=1 AFL_NO_UI=1 ../afl-fuzz -Z -s 123 -V50 -m ${MEM_LIMIT} -i in -o out -D -- ./test-floatingpoint >>errors 2>&1 AFL_BENCH_UNTIL_CRASH=1 AFL_NO_UI=1 ../afl-fuzz -Z -s 123 -V15 -m ${MEM_LIMIT} -i in -o out -- ./test-floatingpoint >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/crashes/id:* 2>/dev/null )" && { test -n "$( ls out/default/crashes/id:* 2>/dev/null )" && {
$ECHO "$GREEN[+] llvm_mode laf-intel floatingpoint splitting feature works correctly" $ECHO "$GREEN[+] llvm_mode laf-intel floatingpoint splitting feature works correctly"
...@@ -263,7 +263,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && { ...@@ -263,7 +263,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && {
{ {
mkdir -p in mkdir -p in
echo 00000000000000000000000000000000 > in/in echo 00000000000000000000000000000000 > in/in
AFL_BENCH_UNTIL_CRASH=1 ../afl-fuzz -m none -V60 -i in -o out -c./test-cmplog -- ./test-c >>errors 2>&1 AFL_BENCH_UNTIL_CRASH=1 ../afl-fuzz -m none -V15 -i in -o out -c./test-cmplog -- ./test-c >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/crashes/id:000000* out/default/hangs/id:000000* 2>/dev/null )" & { test -n "$( ls out/default/crashes/id:000000* out/default/hangs/id:000000* 2>/dev/null )" & {
$ECHO "$GREEN[+] afl-fuzz is working correctly with llvm_mode cmplog" $ECHO "$GREEN[+] afl-fuzz is working correctly with llvm_mode cmplog"
......
...@@ -22,7 +22,7 @@ test -e ../afl-qemu-trace && { ...@@ -22,7 +22,7 @@ test -e ../afl-qemu-trace && {
echo 00000 > in/in echo 00000 > in/in
$ECHO "$GREY[*] running afl-fuzz for qemu_mode, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz for qemu_mode, this will take approx 10 seconds"
{ {
../afl-fuzz -m ${MEM_LIMIT} -V10 -Q -i in -o out -- ./test-instr >>errors 2>&1 ../afl-fuzz -m ${MEM_LIMIT} -V07 -Q -i in -o out -- ./test-instr >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with qemu_mode" $ECHO "$GREEN[+] afl-fuzz is working correctly with qemu_mode"
...@@ -63,7 +63,7 @@ test -e ../afl-qemu-trace && { ...@@ -63,7 +63,7 @@ test -e ../afl-qemu-trace && {
{ {
export AFL_PRELOAD=../libcompcov.so export AFL_PRELOAD=../libcompcov.so
export AFL_COMPCOV_LEVEL=2 export AFL_COMPCOV_LEVEL=2
../afl-fuzz -m ${MEM_LIMIT} -V10 -Q -i in -o out -- ./test-compcov >>errors 2>&1 ../afl-fuzz -m ${MEM_LIMIT} -V07 -Q -i in -o out -- ./test-compcov >>errors 2>&1
unset AFL_PRELOAD unset AFL_PRELOAD
unset AFL_COMPCOV_LEVEL unset AFL_COMPCOV_LEVEL
} >>errors 2>&1 } >>errors 2>&1
...@@ -88,7 +88,7 @@ test -e ../afl-qemu-trace && { ...@@ -88,7 +88,7 @@ test -e ../afl-qemu-trace && {
test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc" -o "$SYS" = "aarch64" -o ! "${SYS%%arm*}" && { test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc" -o "$SYS" = "aarch64" -o ! "${SYS%%arm*}" && {
$ECHO "$GREY[*] running afl-fuzz for qemu_mode cmplog, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz for qemu_mode cmplog, this will take approx 10 seconds"
{ {
../afl-fuzz -m none -V10 -Q -c 0 -i in -o out -- ./test-compcov >>errors 2>&1 ../afl-fuzz -m none -V07 -Q -c 0 -i in -o out -- ./test-compcov >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000001* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000001* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with qemu_mode cmplog" $ECHO "$GREEN[+] afl-fuzz is working correctly with qemu_mode cmplog"
...@@ -126,7 +126,7 @@ test -e ../afl-qemu-trace && { ...@@ -126,7 +126,7 @@ test -e ../afl-qemu-trace && {
$ECHO "Info: AFL_QEMU_PERSISTENT_ADDR=$AFL_QEMU_PERSISTENT_ADDR <= $(nm test-instr | grep "T main" | awk '{print $1}')" $ECHO "Info: AFL_QEMU_PERSISTENT_ADDR=$AFL_QEMU_PERSISTENT_ADDR <= $(nm test-instr | grep "T main" | awk '{print $1}')"
env|grep AFL_|sort env|grep AFL_|sort
file test-instr file test-instr
../afl-fuzz -m ${MEM_LIMIT} -V10 -Q -i in -o out -- ./test-instr ../afl-fuzz -m ${MEM_LIMIT} -V07 -Q -i in -o out -- ./test-instr
unset AFL_QEMU_PERSISTENT_ADDR unset AFL_QEMU_PERSISTENT_ADDR
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
......
...@@ -34,7 +34,7 @@ test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/Makefile && ...@@ -34,7 +34,7 @@ test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/Makefile &&
cd ../unicorn_mode/samples/persistent cd ../unicorn_mode/samples/persistent
make >>errors 2>&1 make >>errors 2>&1
$ECHO "$GREY[*] running afl-fuzz for unicorn_mode (persistent), this will take approx 25 seconds" $ECHO "$GREY[*] running afl-fuzz for unicorn_mode (persistent), this will take approx 25 seconds"
AFL_DEBUG_CHILD=1 ../../../afl-fuzz -m none -V25 -U -i sample_inputs -o out -d -- ./harness @@ >>errors 2>&1 AFL_DEBUG_CHILD=1 ../../../afl-fuzz -m none -V15 -U -i sample_inputs -o out -d -- ./harness @@ >>errors 2>&1
test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with unicorn_mode (persistent)" $ECHO "$GREEN[+] afl-fuzz is working correctly with unicorn_mode (persistent)"
} || { } || {
...@@ -61,7 +61,7 @@ test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/Makefile && ...@@ -61,7 +61,7 @@ test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/Makefile &&
{ {
$ECHO "$GREY[*] running afl-fuzz for unicorn_mode in python, this will take approx 25 seconds" $ECHO "$GREY[*] running afl-fuzz for unicorn_mode in python, this will take approx 25 seconds"
{ {
../afl-fuzz -m ${MEM_LIMIT} -V25 -U -i in -o out -d -- "$PY" ../unicorn_mode/samples/python_simple/simple_test_harness.py @@ >>errors 2>&1 ../afl-fuzz -m ${MEM_LIMIT} -V15 -U -i in -o out -d -- "$PY" ../unicorn_mode/samples/python_simple/simple_test_harness.py @@ >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with unicorn_mode" $ECHO "$GREEN[+] afl-fuzz is working correctly with unicorn_mode"
...@@ -80,7 +80,7 @@ test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/Makefile && ...@@ -80,7 +80,7 @@ test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/Makefile &&
$ECHO "$GREY[*] running afl-fuzz for unicorn_mode compcov, this will take approx 35 seconds" $ECHO "$GREY[*] running afl-fuzz for unicorn_mode compcov, this will take approx 35 seconds"
{ {
export AFL_COMPCOV_LEVEL=2 export AFL_COMPCOV_LEVEL=2
../afl-fuzz -m ${MEM_LIMIT} -V35 -U -i in -o out -d -- "$PY" ../unicorn_mode/samples/compcov_x64/compcov_test_harness.py @@ >>errors 2>&1 ../afl-fuzz -m ${MEM_LIMIT} -V15 -U -i in -o out -d -- "$PY" ../unicorn_mode/samples/compcov_x64/compcov_test_harness.py @@ >>errors 2>&1
unset AFL_COMPCOV_LEVEL unset AFL_COMPCOV_LEVEL
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/default/queue/id:000001* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000001* 2>/dev/null )" && {
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
char *foo = NULL;
int __attribute__((noinline)) crashme(const uint8_t *Data, size_t Size) { int __attribute__((noinline)) crashme(const uint8_t *Data, size_t Size) {
if (Size < 5) return -1; if (Size < 5) return -1;
...@@ -10,7 +12,7 @@ int __attribute__((noinline)) crashme(const uint8_t *Data, size_t Size) { ...@@ -10,7 +12,7 @@ int __attribute__((noinline)) crashme(const uint8_t *Data, size_t Size) {
if (Data[1] == 'A') if (Data[1] == 'A')
if (Data[2] == '$') if (Data[2] == '$')
if (Data[3] == '$') if (Data[3] == '$')
if (Data[4] == '$') abort(); if (Data[4] == '$') *foo = 1;
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment