fastexit + code format
MODIFY
GNUmakefile
GNUmakefile
@@ -592,6 +592,7 @@ clean:
-$(MAKE) -C utils/argv_fuzzing clean
-$(MAKE) -C utils/plot_ui clean
-$(MAKE) -C qemu_mode/unsigaction clean
+ -$(MAKE) -C qemu_mode/fastexit clean
-$(MAKE) -C qemu_mode/libcompcov clean
-$(MAKE) -C qemu_mode/libqasan clean
-$(MAKE) -C frida_mode clean

MODIFY
docs/Changelog.md
docs/Changelog.md
- fix gramatron and grammar_mutator build scripts
- enhancements to the afl-persistent-config and afl-system-config
scripts
+ - afl-fuzz:
+ - force writing all stats on exit
- afl-cc:
- make gcc_mode (afl-gcc-fast) work with gcc down to version 3.6
- qemu_mode:
- fixed 10x speed degredation in v4.03c, thanks to @ele7enxxh for
reporting!
+ - added qemu_mode/fastexit helper library
- unicorn_mode:
- Enabled tricore arch (by @jma-qb)
- Updated Capstone version in Rust bindings

MODIFY
instrumentation/afl-gcc-common.h
instrumentation/afl-gcc-common.h
@@ -505,3 +505,4 @@ struct afl_base_pass : gimple_opt_pass {
#else
#define gimple gimple
#endif
+

ADD
qemu_mode/fastexit/Makefile
+#
+# american fuzzy lop++ - fastexit
+# --------------------------------
+#
+# Written by Andrea Fioraldi <andreafioraldi@gmail.com>
+#
+# Copyright 2019-2022 Andrea Fioraldi. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+TARGETS=fastexit.so fastexit32.so fastexit64.so
+
+all: $(TARGETS)
+
+fastexit.so: fastexit.c
+ @if $(CC) -fPIC -shared fastexit.c -o fastexit.so 2>/dev/null ; then echo "fastexit build success"; else echo "fastexit build failure (that's fine)"; fi
+
+fastexit32.so: fastexit.c
+ @if $(CC) -fPIC -m32 -shared fastexit.c -o fastexit32.so 2>/dev/null ; then echo "fastexit32 build success"; else echo "fastexit32 build failure (that's fine)"; fi
+
+fastexit64.so: fastexit.c
+ @if $(CC) -fPIC -m64 -shared fastexit.c -o fastexit64.so 2>/dev/null ; then echo "fastexit64 build success"; else echo "fastexit64 build failure (that's fine)"; fi
+
+clean:
+ rm -f fastexit.so

ADD
qemu_mode/fastexit/README.md
+# fastexit
+
+This library forces _exit on exit when preloaded to gain speed.
+
+Gives speed on complex tarets like Android or Wine.

ADD
qemu_mode/fastexit/fastexit.c
+#include <unistd.h>
+#include <stdlib.h>
+
+void exit(int status) {
+ _exit(status);
+}

MODIFY
src/afl-fuzz.c
src/afl-fuzz.c
@@ -2570,6 +2570,7 @@ int main(int argc, char **argv_orig, char **envp) {
stop_fuzzing:
afl->force_ui_update = 1; // ensure the screen is reprinted
+ afl->stop_soon = 1; // ensure everything is written
show_stats(afl); // print the screen one last time
write_bitmap(afl);
save_auto(afl);

fastexit + code format