about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--utils/aflpp_driver/GNUmakefile4
-rw-r--r--utils/aflpp_driver/aflpp_driver.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/utils/aflpp_driver/GNUmakefile b/utils/aflpp_driver/GNUmakefile
index b973f96a..409789cb 100644
--- a/utils/aflpp_driver/GNUmakefile
+++ b/utils/aflpp_driver/GNUmakefile
@@ -20,6 +20,10 @@ endif
 
 CFLAGS := -O3 -funroll-loops -g -fPIC
 
+ifdef MAGMA_PATCH
+	CFLAGS += -DMAGMA_PATCH
+endif
+
 all:	libAFLDriver.a libAFLQemuDriver.a aflpp_qemu_driver_hook.so
 
 aflpp_driver.o:	aflpp_driver.c
diff --git a/utils/aflpp_driver/aflpp_driver.c b/utils/aflpp_driver/aflpp_driver.c
index f08c9864..b92e68e9 100644
--- a/utils/aflpp_driver/aflpp_driver.c
+++ b/utils/aflpp_driver/aflpp_driver.c
@@ -58,8 +58,12 @@ $AFL_HOME/afl-fuzz -i IN -o OUT ./a.out
   #include "hash.h"
 #endif
 
+#ifdef MAGMA_PATCH
+int                   __afl_sharedmem_fuzzing = 0;
+#else
 // AFL++ shared memory fuzz cases
 int                   __afl_sharedmem_fuzzing = 1;
+#endif
 extern unsigned int  *__afl_fuzz_len;
 extern unsigned char *__afl_fuzz_ptr;
 
@@ -97,10 +101,10 @@ __attribute__((weak)) void *__asan_region_is_poisoned(void *beg, size_t size);
 
 // Notify AFL about persistent mode.
 static volatile char AFL_PERSISTENT[] = "##SIG_AFL_PERSISTENT##";
-int                  __afl_persistent_loop(unsigned int);
-
 // Notify AFL about deferred forkserver.
 static volatile char AFL_DEFER_FORKSVR[] = "##SIG_AFL_DEFER_FORKSRV##";
+
+int                  __afl_persistent_loop(unsigned int);
 void                 __afl_manual_init();
 
 // Use this optionally defined function to output sanitizer messages even if