fastexit + code format

This commit is contained in:
vanhauser-thc
2022-10-11 08:53:49 +02:00
parent c5008362c6
commit e6e82948bf
11 changed files with 56 additions and 9 deletions

View File

@ -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

View File

@ -8,11 +8,14 @@
- 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

View File

@ -505,3 +505,4 @@ struct afl_base_pass : gimple_opt_pass {
#else
#define gimple gimple
#endif

View File

@ -0,0 +1,30 @@
#
# 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

View File

@ -0,0 +1,5 @@
# fastexit
This library forces _exit on exit when preloaded to gain speed.
Gives speed on complex tarets like Android or Wine.

View File

@ -0,0 +1,6 @@
#include <unistd.h>
#include <stdlib.h>
void exit(int status) {
_exit(status);
}

View File

@ -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);