aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-03-29 10:57:57 +0200
committervanhauser-thc <vh@thc.org>2023-03-29 10:57:57 +0200
commitdbdf2d79f235d475eb8e085a7dbace757c9ac361 (patch)
tree81e7aceb20fc05ca77a1d82c3bfa1e0c84e4670d /utils
parent48816417eedd98c2afc270678a3996e9ffd77dd7 (diff)
downloadafl++-dbdf2d79f235d475eb8e085a7dbace757c9ac361.tar.gz
magma support
Diffstat (limited to 'utils')
-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