mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-12 18:18:07 +00:00
cmplog decision updates
This commit is contained in:
@ -446,9 +446,12 @@ u8 fuzz_one_original(afl_state_t *afl) {
|
|||||||
|
|
||||||
ACTF(
|
ACTF(
|
||||||
"Fuzzing test case #%u (%u total, %llu crashes saved, "
|
"Fuzzing test case #%u (%u total, %llu crashes saved, "
|
||||||
"perf_score=%0.0f, exec_us=%llu, hits=%u, map=%u, ascii=%u)...",
|
"perf_score=%0.0f, weight=%0.0f, favorite=%u, was_fuzzed=%u, "
|
||||||
|
"exec_us=%llu, hits=%u, map=%u, ascii=%u)...",
|
||||||
afl->current_entry, afl->queued_items, afl->saved_crashes,
|
afl->current_entry, afl->queued_items, afl->saved_crashes,
|
||||||
afl->queue_cur->perf_score, afl->queue_cur->exec_us,
|
afl->queue_cur->perf_score, afl->queue_cur->weight,
|
||||||
|
afl->queue_cur->favored, afl->queue_cur->was_fuzzed,
|
||||||
|
afl->queue_cur->exec_us,
|
||||||
likely(afl->n_fuzz) ? afl->n_fuzz[afl->queue_cur->n_fuzz_entry] : 0,
|
likely(afl->n_fuzz) ? afl->n_fuzz[afl->queue_cur->n_fuzz_entry] : 0,
|
||||||
afl->queue_cur->bitmap_size, afl->queue_cur->is_ascii);
|
afl->queue_cur->bitmap_size, afl->queue_cur->is_ascii);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
@ -561,10 +564,11 @@ u8 fuzz_one_original(afl_state_t *afl) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (afl->cmplog_lvl == 3 ||
|
if (afl->queue_cur->favored || afl->cmplog_lvl == 3 ||
|
||||||
(afl->cmplog_lvl == 2 && afl->queue_cur->tc_ref) ||
|
(afl->cmplog_lvl == 2 &&
|
||||||
afl->queue_cur->favored ||
|
(afl->queue_cur->tc_ref ||
|
||||||
get_cur_time() - afl->last_find_time > 600000) { // 600 seconds
|
afl->fsrv.total_execs % afl->queued_items <= 10)) ||
|
||||||
|
get_cur_time() - afl->last_find_time > 250000) { // 250 seconds
|
||||||
|
|
||||||
if (input_to_state_stage(afl, in_buf, out_buf, len)) {
|
if (input_to_state_stage(afl, in_buf, out_buf, len)) {
|
||||||
|
|
||||||
|
@ -8,9 +8,14 @@ ifeq "$(shell uname -s)" "Darwin"
|
|||||||
LDFLAGS += $(SDK_LD)
|
LDFLAGS += $(SDK_LD)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq "" "$(LLVM_CONFIG)"
|
||||||
|
LLVM_CONFIG := llvm-config
|
||||||
|
endif
|
||||||
LLVM_BINDIR = $(shell $(LLVM_CONFIG) --bindir 2>/dev/null)
|
LLVM_BINDIR = $(shell $(LLVM_CONFIG) --bindir 2>/dev/null)
|
||||||
ifneq "" "$(LLVM_BINDIR)"
|
ifneq "" "$(LLVM_BINDIR)"
|
||||||
LLVM_BINDIR := $(LLVM_BINDIR)/
|
ifeq "$(shell test -x $(LLVM_BINDIR)/clang && echo 1)" "1"
|
||||||
|
CC := $(LLVM_BINDIR)/clang
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS := -O3 -funroll-loops -g -fPIC
|
CFLAGS := -O3 -funroll-loops -g -fPIC
|
||||||
@ -18,31 +23,31 @@ CFLAGS := -O3 -funroll-loops -g -fPIC
|
|||||||
all: libAFLDriver.a libAFLQemuDriver.a aflpp_qemu_driver_hook.so
|
all: libAFLDriver.a libAFLQemuDriver.a aflpp_qemu_driver_hook.so
|
||||||
|
|
||||||
aflpp_driver.o: aflpp_driver.c
|
aflpp_driver.o: aflpp_driver.c
|
||||||
-$(LLVM_BINDIR)clang -I. -I../../include $(CFLAGS) -c aflpp_driver.c
|
-$(CC) -I. -I../../include $(CFLAGS) -c aflpp_driver.c
|
||||||
|
|
||||||
libAFLDriver.a: aflpp_driver.o
|
libAFLDriver.a: aflpp_driver.o
|
||||||
@ar rc libAFLDriver.a aflpp_driver.o
|
@ar rc libAFLDriver.a aflpp_driver.o
|
||||||
@cp -vf libAFLDriver.a ../../
|
@cp -vf libAFLDriver.a ../../
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
$(LLVM_BINDIR)clang -Wno-deprecated -I../../include $(CFLAGS) -D_DEBUG=\"1\" -c -o afl-performance.o ../../src/afl-performance.c
|
$(CC) -Wno-deprecated -I../../include $(CFLAGS) -D_DEBUG=\"1\" -c -o afl-performance.o ../../src/afl-performance.c
|
||||||
$(LLVM_BINDIR)clang -I../../include -D_DEBUG=\"1\" -g -funroll-loops -c aflpp_driver.c
|
$(CC) -I../../include -D_DEBUG=\"1\" -g -funroll-loops -c aflpp_driver.c
|
||||||
#$(LLVM_BINDIR)clang -S -emit-llvm -Wno-deprecated -I../../include $(CFLAGS) -D_DEBUG=\"1\" -c -o afl-performance.ll ../../src/afl-performance.c
|
#$(CC) -S -emit-llvm -Wno-deprecated -I../../include $(CFLAGS) -D_DEBUG=\"1\" -c -o afl-performance.ll ../../src/afl-performance.c
|
||||||
#$(LLVM_BINDIR)clang -S -emit-llvm -I../../include -D_DEBUG=\"1\" -g -funroll-loops -c aflpp_driver.c
|
#$(CC) -S -emit-llvm -I../../include -D_DEBUG=\"1\" -g -funroll-loops -c aflpp_driver.c
|
||||||
ar rc libAFLDriver.a afl-performance.o aflpp_driver.o
|
ar rc libAFLDriver.a afl-performance.o aflpp_driver.o
|
||||||
|
|
||||||
aflpp_qemu_driver.o: aflpp_qemu_driver.c
|
aflpp_qemu_driver.o: aflpp_qemu_driver.c
|
||||||
-$(LLVM_BINDIR)clang $(CFLAGS) -O0 -funroll-loops -c aflpp_qemu_driver.c
|
-$(CC) $(CFLAGS) -O0 -funroll-loops -c aflpp_qemu_driver.c
|
||||||
|
|
||||||
libAFLQemuDriver.a: aflpp_qemu_driver.o
|
libAFLQemuDriver.a: aflpp_qemu_driver.o
|
||||||
@-ar rc libAFLQemuDriver.a aflpp_qemu_driver.o
|
@-ar rc libAFLQemuDriver.a aflpp_qemu_driver.o
|
||||||
@-cp -vf libAFLQemuDriver.a ../../
|
@-cp -vf libAFLQemuDriver.a ../../
|
||||||
|
|
||||||
aflpp_qemu_driver_hook.so: aflpp_qemu_driver_hook.o
|
aflpp_qemu_driver_hook.so: aflpp_qemu_driver_hook.o
|
||||||
@-test -e aflpp_qemu_driver_hook.o && $(LLVM_BINDIR)clang $(LDFLAGS) -shared aflpp_qemu_driver_hook.o -o aflpp_qemu_driver_hook.so || echo "Note: Optional aflpp_qemu_driver_hook.so not built."
|
@-test -e aflpp_qemu_driver_hook.o && $(CC) $(LDFLAGS) -shared aflpp_qemu_driver_hook.o -o aflpp_qemu_driver_hook.so || echo "Note: Optional aflpp_qemu_driver_hook.so not built."
|
||||||
|
|
||||||
aflpp_qemu_driver_hook.o: aflpp_qemu_driver_hook.c
|
aflpp_qemu_driver_hook.o: aflpp_qemu_driver_hook.c
|
||||||
@-test -e ../../qemu_mode/qemuafl/qemuafl/api.h && $(LLVM_BINDIR)clang $(CFLAGS) -funroll-loops -c aflpp_qemu_driver_hook.c || echo "Note: Optional aflpp_qemu_driver_hook.o not built."
|
@-test -e ../../qemu_mode/qemuafl/qemuafl/api.h && $(CC) $(CFLAGS) -funroll-loops -c aflpp_qemu_driver_hook.c || echo "Note: Optional aflpp_qemu_driver_hook.o not built."
|
||||||
|
|
||||||
test: debug
|
test: debug
|
||||||
#clang -S -emit-llvm -D_DEBUG=\"1\" -I../../include -Wl,--allow-multiple-definition -funroll-loops -o aflpp_driver_test.ll aflpp_driver_test.c
|
#clang -S -emit-llvm -D_DEBUG=\"1\" -I../../include -Wl,--allow-multiple-definition -funroll-loops -o aflpp_driver_test.ll aflpp_driver_test.c
|
||||||
|
Reference in New Issue
Block a user