mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-19 13:03:44 +00:00
fuzzbench integration
This commit is contained in:
@ -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.
|
||||
|
@ -834,6 +834,11 @@ void __afl_manual_init(void) {
|
||||
if (getenv("AFL_DISABLE_LLVM_INSTRUMENTATION")) {
|
||||
|
||||
init_done = 1;
|
||||
is_persistent = 0;
|
||||
__afl_sharedmem_fuzzing = 0;
|
||||
if (__afl_area_ptr == NULL)
|
||||
__afl_area_ptr = __afl_area_initial;
|
||||
|
||||
if (getenv("AFL_DEBUG"))
|
||||
fprintf(stderr,
|
||||
"DEBUG: disabled instrumenation because of "
|
||||
@ -855,6 +860,8 @@ void __afl_manual_init(void) {
|
||||
|
||||
__attribute__((constructor(CONST_PRIO))) void __afl_auto_init(void) {
|
||||
|
||||
if (getenv("AFL_DISABLE_LLVM_INSTRUMENTATION")) return;
|
||||
|
||||
is_persistent = !!getenv(PERSIST_ENV_VAR);
|
||||
|
||||
if (getenv(DEFER_ENV_VAR)) return;
|
||||
|
Reference in New Issue
Block a user