aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-08-10 11:45:32 +0200
committervan Hauser <vh@thc.org>2020-08-10 11:45:32 +0200
commit464c27082a8c75b400d4387d46a86542630cac45 (patch)
tree4487eb8975439e955b9c9761ca599d1f24de6d58 /examples
parent3aa7d8081d20c824aa19c6383637ade7334e8353 (diff)
downloadafl++-464c27082a8c75b400d4387d46a86542630cac45.tar.gz
fuzzbench integration
Diffstat (limited to 'examples')
-rw-r--r--examples/aflpp_driver/aflpp_driver.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/examples/aflpp_driver/aflpp_driver.c b/examples/aflpp_driver/aflpp_driver.c
index 397228ed..2b7be45f 100644
--- a/examples/aflpp_driver/aflpp_driver.c
+++ b/examples/aflpp_driver/aflpp_driver.c
@@ -266,7 +266,7 @@ __attribute__((constructor(1))) void __afl_protect(void) {
int main(int argc, char **argv) {
- fprintf(stderr, "dummy map is at %p\n", __afl_area_ptr);
+ fprintf(stderr, "map is at %p\n", __afl_area_ptr);
printf(
"======================= INFO =========================\n"
@@ -305,10 +305,11 @@ int main(int argc, char **argv) {
printf("WARNING: using the deprecated call style `%s %d`\n", argv[0], N);
else if (argc > 1) {
- __afl_sharedmem_fuzzing = 0;
- munmap(__afl_area_ptr, MAX_DUMMY_SIZE); // we need to free 0x10000
- __afl_area_ptr = NULL;
- __afl_manual_init();
+ if (!getenv("AFL_DISABLE_LLVM_INSTRUMENTATION")) {
+ munmap(__afl_area_ptr, MAX_DUMMY_SIZE); // we need to free 0x10000
+ __afl_area_ptr = NULL;
+ __afl_manual_init();
+ }
return ExecuteFilesOnyByOne(argc, argv);
}
@@ -318,9 +319,10 @@ int main(int argc, char **argv) {
if (!getenv("AFL_DISABLE_LLVM_INSTRUMENTATION")) {
munmap(__afl_area_ptr, MAX_DUMMY_SIZE);
__afl_area_ptr = NULL;
- __afl_manual_init();
+ fprintf(stderr, "performing manual init\n");
+ __afl_manual_init();
}
- fprintf(stderr, "dummy map is now at %p\n", __afl_area_ptr);
+ fprintf(stderr, "map is now at %p\n", __afl_area_ptr);
// Call LLVMFuzzerTestOneInput here so that coverage caused by initialization
// on the first execution of LLVMFuzzerTestOneInput is ignored.