fix typo in custom format

This commit is contained in:
Andrea Fioraldi
2019-09-04 10:03:51 +02:00
parent 9705ccee67
commit e1f18f6212
37 changed files with 178 additions and 173 deletions

View File

@ -3,7 +3,7 @@
--------------------------------------- ---------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -186,14 +186,14 @@ static const u8* main_payload_32 =
" movl %ecx, __afl_prev_loc\n" " movl %ecx, __afl_prev_loc\n"
#else #else
" movl %ecx, %edi\n" " movl %ecx, %edi\n"
#endif /* ^!COVERAGE_ONLY */ #endif /* ^!COVERAGE_ONLY */
"\n" "\n"
#ifdef SKIP_COUNTS #ifdef SKIP_COUNTS
" orb $1, (%edx, %edi, 1)\n" " orb $1, (%edx, %edi, 1)\n"
#else #else
" incb (%edx, %edi, 1)\n" " incb (%edx, %edi, 1)\n"
" adcb $0, (%edx, %edi, 1)\n" // never zero counter implementation. slightly better path discovery and little performance impact " adcb $0, (%edx, %edi, 1)\n" // never zero counter implementation. slightly better path discovery and little performance impact
#endif /* ^SKIP_COUNTS */ #endif /* ^SKIP_COUNTS */
"\n" "\n"
"__afl_return:\n" "__afl_return:\n"
"\n" "\n"
@ -382,7 +382,7 @@ static const u8* main_payload_32 =
" .comm __afl_setup_failure, 1, 32\n" " .comm __afl_setup_failure, 1, 32\n"
#ifndef COVERAGE_ONLY #ifndef COVERAGE_ONLY
" .comm __afl_prev_loc, 4, 32\n" " .comm __afl_prev_loc, 4, 32\n"
#endif /* !COVERAGE_ONLY */ #endif /* !COVERAGE_ONLY */
" .comm __afl_fork_pid, 4, 32\n" " .comm __afl_fork_pid, 4, 32\n"
" .comm __afl_temp, 4, 32\n" " .comm __afl_temp, 4, 32\n"
"\n" "\n"
@ -404,7 +404,7 @@ static const u8* main_payload_32 =
#define CALL_L64(str) "call _" str "\n" #define CALL_L64(str) "call _" str "\n"
#else #else
#define CALL_L64(str) "call " str "@PLT\n" #define CALL_L64(str) "call " str "@PLT\n"
#endif /* ^__APPLE__ */ #endif /* ^__APPLE__ */
static const u8* main_payload_64 = static const u8* main_payload_64 =
@ -422,7 +422,7 @@ static const u8* main_payload_64 =
" .byte 0x9f /* lahf */\n" " .byte 0x9f /* lahf */\n"
#else #else
" lahf\n" " lahf\n"
#endif /* ^__OpenBSD__, etc */ #endif /* ^__OpenBSD__, etc */
" seto %al\n" " seto %al\n"
"\n" "\n"
" /* Check if SHM region is already mapped. */\n" " /* Check if SHM region is already mapped. */\n"
@ -439,14 +439,14 @@ static const u8* main_payload_64 =
" xorq __afl_prev_loc(%rip), %rcx\n" " xorq __afl_prev_loc(%rip), %rcx\n"
" xorq %rcx, __afl_prev_loc(%rip)\n" " xorq %rcx, __afl_prev_loc(%rip)\n"
" shrq $1, __afl_prev_loc(%rip)\n" " shrq $1, __afl_prev_loc(%rip)\n"
#endif /* ^!COVERAGE_ONLY */ #endif /* ^!COVERAGE_ONLY */
"\n" "\n"
#ifdef SKIP_COUNTS #ifdef SKIP_COUNTS
" orb $1, (%rdx, %rcx, 1)\n" " orb $1, (%rdx, %rcx, 1)\n"
#else #else
" incb (%rdx, %rcx, 1)\n" " incb (%rdx, %rcx, 1)\n"
" adcb $0, (%rdx, %rcx, 1)\n" // never zero counter implementation. slightly better path discovery and little performance impact " adcb $0, (%rdx, %rcx, 1)\n" // never zero counter implementation. slightly better path discovery and little performance impact
#endif /* ^SKIP_COUNTS */ #endif /* ^SKIP_COUNTS */
"\n" "\n"
"__afl_return:\n" "__afl_return:\n"
"\n" "\n"
@ -455,7 +455,7 @@ static const u8* main_payload_64 =
" .byte 0x9e /* sahf */\n" " .byte 0x9e /* sahf */\n"
#else #else
" sahf\n" " sahf\n"
#endif /* ^__OpenBSD__, etc */ #endif /* ^__OpenBSD__, etc */
" ret\n" " ret\n"
"\n" "\n"
".align 8\n" ".align 8\n"
@ -474,7 +474,7 @@ static const u8* main_payload_64 =
" movq (%rdx), %rdx\n" " movq (%rdx), %rdx\n"
#else #else
" movq __afl_global_area_ptr(%rip), %rdx\n" " movq __afl_global_area_ptr(%rip), %rdx\n"
#endif /* !^__APPLE__ */ #endif /* !^__APPLE__ */
" testq %rdx, %rdx\n" " testq %rdx, %rdx\n"
" je __afl_setup_first\n" " je __afl_setup_first\n"
"\n" "\n"
@ -573,7 +573,7 @@ static const u8* main_payload_64 =
#else #else
" movq __afl_global_area_ptr@GOTPCREL(%rip), %rdx\n" " movq __afl_global_area_ptr@GOTPCREL(%rip), %rdx\n"
" movq %rax, (%rdx)\n" " movq %rax, (%rdx)\n"
#endif /* ^__APPLE__ */ #endif /* ^__APPLE__ */
" movq %rax, %rdx\n" " movq %rax, %rdx\n"
"\n" "\n"
"__afl_forkserver:\n" "__afl_forkserver:\n"
@ -742,7 +742,7 @@ static const u8* main_payload_64 =
" .comm __afl_area_ptr, 8\n" " .comm __afl_area_ptr, 8\n"
#ifndef COVERAGE_ONLY #ifndef COVERAGE_ONLY
" .comm __afl_prev_loc, 8\n" " .comm __afl_prev_loc, 8\n"
#endif /* !COVERAGE_ONLY */ #endif /* !COVERAGE_ONLY */
" .comm __afl_fork_pid, 4\n" " .comm __afl_fork_pid, 4\n"
" .comm __afl_temp, 4\n" " .comm __afl_temp, 4\n"
" .comm __afl_setup_failure, 1\n" " .comm __afl_setup_failure, 1\n"
@ -752,12 +752,12 @@ static const u8* main_payload_64 =
" .lcomm __afl_area_ptr, 8\n" " .lcomm __afl_area_ptr, 8\n"
#ifndef COVERAGE_ONLY #ifndef COVERAGE_ONLY
" .lcomm __afl_prev_loc, 8\n" " .lcomm __afl_prev_loc, 8\n"
#endif /* !COVERAGE_ONLY */ #endif /* !COVERAGE_ONLY */
" .lcomm __afl_fork_pid, 4\n" " .lcomm __afl_fork_pid, 4\n"
" .lcomm __afl_temp, 4\n" " .lcomm __afl_temp, 4\n"
" .lcomm __afl_setup_failure, 1\n" " .lcomm __afl_setup_failure, 1\n"
#endif /* ^__APPLE__ */ #endif /* ^__APPLE__ */
" .comm __afl_global_area_ptr, 8, 8\n" " .comm __afl_global_area_ptr, 8, 8\n"
"\n" "\n"
@ -767,5 +767,5 @@ static const u8* main_payload_64 =
"/* --- END --- */\n" "/* --- END --- */\n"
"\n"; "\n";
#endif /* !_HAVE_AFL_AS_H */ #endif /* !_HAVE_AFL_AS_H */

View File

@ -3,7 +3,7 @@
------------------------------------ ------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -74,20 +74,20 @@
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/sysctl.h> #include <sys/sysctl.h>
#define HAVE_ARC4RANDOM 1 #define HAVE_ARC4RANDOM 1
#endif /* __APPLE__ || __FreeBSD__ || __OpenBSD__ */ #endif /* __APPLE__ || __FreeBSD__ || __OpenBSD__ */
/* For systems that have sched_setaffinity; right now just Linux, but one /* For systems that have sched_setaffinity; right now just Linux, but one
can hope... */ can hope... */
#ifdef __linux__ #ifdef __linux__
#define HAVE_AFFINITY 1 #define HAVE_AFFINITY 1
#endif /* __linux__ */ #endif /* __linux__ */
#ifndef SIMPLE_FILES #ifndef SIMPLE_FILES
#define CASE_PREFIX "id:" #define CASE_PREFIX "id:"
#else #else
#define CASE_PREFIX "id_" #define CASE_PREFIX "id_"
#endif /* ^!SIMPLE_FILES */ #endif /* ^!SIMPLE_FILES */
struct queue_entry { struct queue_entry {
@ -400,7 +400,7 @@ extern s32 cpu_core_count; /* CPU core count */
extern s32 cpu_aff; /* Selected CPU core */ extern s32 cpu_aff; /* Selected CPU core */
#endif /* HAVE_AFFINITY */ #endif /* HAVE_AFFINITY */
extern FILE* plot_file; /* Gnuplot output file */ extern FILE* plot_file; /* Gnuplot output file */

View File

@ -3,7 +3,7 @@
-------------------------------------------------------------------- --------------------------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -69,9 +69,9 @@
/* Magic tokens used to mark used / freed chunks. */ /* Magic tokens used to mark used / freed chunks. */
#define ALLOC_MAGIC_C1 0xFF00FF00 /* Used head (dword) */ #define ALLOC_MAGIC_C1 0xFF00FF00 /* Used head (dword) */
#define ALLOC_MAGIC_F 0xFE00FE00 /* Freed head (dword) */ #define ALLOC_MAGIC_F 0xFE00FE00 /* Freed head (dword) */
#define ALLOC_MAGIC_C2 0xF0 /* Used tail (byte) */ #define ALLOC_MAGIC_C2 0xF0 /* Used tail (byte) */
/* Positions of guard tokens in relation to the user-visible pointer. */ /* Positions of guard tokens in relation to the user-visible pointer. */
@ -111,14 +111,17 @@
\ \
\ \
\ \
\
if (_p) { \ if (_p) { \
\ \
\ \
\ \
\
if (ALLOC_C1(_p) ^ ALLOC_MAGIC_C1) {\ if (ALLOC_C1(_p) ^ ALLOC_MAGIC_C1) {\
\ \
\ \
\ \
\
if (ALLOC_C1(_p) == ALLOC_MAGIC_F) \ if (ALLOC_C1(_p) == ALLOC_MAGIC_F) \
ABORT("Use after free."); \ ABORT("Use after free."); \
else ABORT("Corrupted head alloc canary."); \ else ABORT("Corrupted head alloc canary."); \
@ -126,6 +129,7 @@
} \ } \
\ \
\ \
\
if (ALLOC_C2(_p) ^ ALLOC_MAGIC_C2) \ if (ALLOC_C2(_p) ^ ALLOC_MAGIC_C2) \
ABORT("Corrupted tail alloc canary."); \ ABORT("Corrupted tail alloc canary."); \
\ \
@ -134,6 +138,7 @@
\ \
\ \
\ \
\
} while (0) } while (0)
*/ */
@ -197,7 +202,7 @@ static inline void DFL_ck_free(void* mem) {
/* Catch pointer issues sooner. */ /* Catch pointer issues sooner. */
memset(mem, 0xFF, ALLOC_S(mem)); memset(mem, 0xFF, ALLOC_S(mem));
#endif /* DEBUG_BUILD */ #endif /* DEBUG_BUILD */
ALLOC_C1(mem) = ALLOC_MAGIC_F; ALLOC_C1(mem) = ALLOC_MAGIC_F;
@ -228,7 +233,7 @@ static inline void* DFL_ck_realloc(void* orig, u32 size) {
#ifndef DEBUG_BUILD #ifndef DEBUG_BUILD
ALLOC_C1(orig) = ALLOC_MAGIC_F; ALLOC_C1(orig) = ALLOC_MAGIC_F;
#endif /* !DEBUG_BUILD */ #endif /* !DEBUG_BUILD */
old_size = ALLOC_S(orig); old_size = ALLOC_S(orig);
u8* origu8 = orig; u8* origu8 = orig;
@ -266,7 +271,7 @@ static inline void* DFL_ck_realloc(void* orig, u32 size) {
} }
#endif /* ^!DEBUG_BUILD */ #endif /* ^!DEBUG_BUILD */
ret += ALLOC_OFF_HEAD; ret += ALLOC_OFF_HEAD;
@ -297,7 +302,7 @@ static inline void* DFL_ck_realloc_block(void* orig, u32 size) {
} }
#endif /* !DEBUG_BUILD */ #endif /* !DEBUG_BUILD */
return DFL_ck_realloc(orig, size); return DFL_ck_realloc(orig, size);
@ -424,7 +429,7 @@ extern u32 TRK_cnt[ALLOC_BUCKETS];
#define alloc_report() #define alloc_report()
#endif /* ^AFL_MAIN */ #endif /* ^AFL_MAIN */
/* Bucket-assigning function for a given pointer: */ /* Bucket-assigning function for a given pointer: */
@ -600,7 +605,7 @@ static inline void TRK_ck_free(void* ptr, const char* file, const char* func,
#define ck_free(_p1) TRK_ck_free(_p1, __FILE__, __FUNCTION__, __LINE__) #define ck_free(_p1) TRK_ck_free(_p1, __FILE__, __FUNCTION__, __LINE__)
#endif /* ^!DEBUG_BUILD */ #endif /* ^!DEBUG_BUILD */
#endif /* ! _HAVE_ALLOC_INL_H */ #endif /* ! _HAVE_ALLOC_INL_H */

View File

@ -3,7 +3,7 @@
---------------------------------------------------------------- ----------------------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>

View File

@ -3,7 +3,7 @@
--------------------------------------------- ---------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>

View File

@ -3,7 +3,7 @@
------------------------------------------------ ------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -58,7 +58,7 @@
#define MEM_LIMIT 25 #define MEM_LIMIT 25
#else #else
#define MEM_LIMIT 50 #define MEM_LIMIT 50
#endif /* ^!__x86_64__ */ #endif /* ^!__x86_64__ */
/* Default memory limit when running in QEMU mode (MB): */ /* Default memory limit when running in QEMU mode (MB): */
@ -128,9 +128,9 @@
/* Probabilities of skipping non-favored entries in the queue, expressed as /* Probabilities of skipping non-favored entries in the queue, expressed as
percentages: */ percentages: */
#define SKIP_TO_NEW_PROB 99 /* ...when there are new, pending favorites */ #define SKIP_TO_NEW_PROB 99 /* ...when there are new, pending favorites */
#define SKIP_NFAV_OLD_PROB 95 /* ...no new favs, cur entry already fuzzed */ #define SKIP_NFAV_OLD_PROB 95 /* ...no new favs, cur entry already fuzzed */
#define SKIP_NFAV_NEW_PROB 75 /* ...no new favs, cur entry not fuzzed yet */ #define SKIP_NFAV_NEW_PROB 75 /* ...no new favs, cur entry not fuzzed yet */
/* Splicing cycle count: */ /* Splicing cycle count: */
@ -371,5 +371,5 @@
// #define IGNORE_FINDS // #define IGNORE_FINDS
#endif /* ! _HAVE_CONFIG_H */ #endif /* ! _HAVE_CONFIG_H */

View File

@ -3,7 +3,7 @@
---------------------------------------------------- ----------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -105,7 +105,7 @@
#define bgLCY "" #define bgLCY ""
#define bgBRI "" #define bgBRI ""
#endif /* ^USE_COLOR */ #endif /* ^USE_COLOR */
/************************* /*************************
* Box drawing sequences * * Box drawing sequences *
@ -113,21 +113,21 @@
#ifdef FANCY_BOXES #ifdef FANCY_BOXES
#define SET_G1 "\x1b)0" /* Set G1 for box drawing */ #define SET_G1 "\x1b)0" /* Set G1 for box drawing */
#define RESET_G1 "\x1b)B" /* Reset G1 to ASCII */ #define RESET_G1 "\x1b)B" /* Reset G1 to ASCII */
#define bSTART "\x0e" /* Enter G1 drawing mode */ #define bSTART "\x0e" /* Enter G1 drawing mode */
#define bSTOP "\x0f" /* Leave G1 drawing mode */ #define bSTOP "\x0f" /* Leave G1 drawing mode */
#define bH "q" /* Horizontal line */ #define bH "q" /* Horizontal line */
#define bV "x" /* Vertical line */ #define bV "x" /* Vertical line */
#define bLT "l" /* Left top corner */ #define bLT "l" /* Left top corner */
#define bRT "k" /* Right top corner */ #define bRT "k" /* Right top corner */
#define bLB "m" /* Left bottom corner */ #define bLB "m" /* Left bottom corner */
#define bRB "j" /* Right bottom corner */ #define bRB "j" /* Right bottom corner */
#define bX "n" /* Cross */ #define bX "n" /* Cross */
#define bVR "t" /* Vertical, branch right */ #define bVR "t" /* Vertical, branch right */
#define bVL "u" /* Vertical, branch left */ #define bVL "u" /* Vertical, branch left */
#define bHT "v" /* Horizontal, branch top */ #define bHT "v" /* Horizontal, branch top */
#define bHB "w" /* Horizontal, branch bottom */ #define bHB "w" /* Horizontal, branch bottom */
#else #else
@ -147,7 +147,7 @@
#define bHT "+" #define bHT "+"
#define bHB "+" #define bHB "+"
#endif /* ^FANCY_BOXES */ #endif /* ^FANCY_BOXES */
/*********************** /***********************
* Misc terminal codes * * Misc terminal codes *
@ -169,7 +169,7 @@
#define SAYF(x...) printf(x) #define SAYF(x...) printf(x)
#else #else
#define SAYF(x...) fprintf(stderr, x) #define SAYF(x...) fprintf(stderr, x)
#endif /* ^MESSAGES_TO_STDOUT */ #endif /* ^MESSAGES_TO_STDOUT */
/* Show a prefixed warning. */ /* Show a prefixed warning. */
@ -286,5 +286,5 @@
\ \
} while (0) } while (0)
#endif /* ! _HAVE_DEBUG_H */ #endif /* ! _HAVE_DEBUG_H */

View File

@ -3,9 +3,9 @@
---------------------------------------- ----------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -45,7 +45,7 @@ void init_forkserver(char **argv);
#define MSG_ULIMIT_USAGE " ( ulimit -Sv $[%llu << 10];" #define MSG_ULIMIT_USAGE " ( ulimit -Sv $[%llu << 10];"
#else #else
#define MSG_ULIMIT_USAGE " ( ulimit -Sd $[%llu << 10];" #define MSG_ULIMIT_USAGE " ( ulimit -Sd $[%llu << 10];"
#endif /* ^RLIMIT_AS */ #endif /* ^RLIMIT_AS */
#endif #endif

View File

@ -99,7 +99,7 @@ static inline u32 hash32(const void* key, u32 len, u32 seed) {
} }
#endif /* ^__x86_64__ */ #endif /* ^__x86_64__ */
#endif /* !_HAVE_HASH_H */ #endif /* !_HAVE_HASH_H */

View File

@ -3,9 +3,9 @@
--------------------------------------------------- ---------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>

View File

@ -3,7 +3,7 @@
-------------------------------------------------------- --------------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -49,7 +49,7 @@ typedef uint32_t u32;
typedef unsigned long long u64; typedef unsigned long long u64;
#else #else
typedef uint64_t u64; typedef uint64_t u64;
#endif /* ^__x86_64__ */ #endif /* ^__x86_64__ */
typedef int8_t s8; typedef int8_t s8;
typedef int16_t s16; typedef int16_t s16;
@ -59,7 +59,7 @@ typedef int64_t s64;
#ifndef MIN #ifndef MIN
#define MIN(_a, _b) ((_a) > (_b) ? (_b) : (_a)) #define MIN(_a, _b) ((_a) > (_b) ? (_b) : (_a))
#define MAX(_a, _b) ((_a) > (_b) ? (_a) : (_b)) #define MAX(_a, _b) ((_a) > (_b) ? (_a) : (_b))
#endif /* !MIN */ #endif /* !MIN */
#define SWAP16(_x) \ #define SWAP16(_x) \
({ \ ({ \
@ -82,7 +82,7 @@ typedef int64_t s64;
#define AFL_R(x) (random() % (x)) #define AFL_R(x) (random() % (x))
#else #else
#define R(x) (random() % (x)) #define R(x) (random() % (x))
#endif /* ^AFL_LLVM_PASS */ #endif /* ^AFL_LLVM_PASS */
#define STRINGIFY_INTERNAL(x) #x #define STRINGIFY_INTERNAL(x) #x
#define STRINGIFY(x) STRINGIFY_INTERNAL(x) #define STRINGIFY(x) STRINGIFY_INTERNAL(x)
@ -97,5 +97,5 @@ typedef int64_t s64;
#define unlikely(_x) __builtin_expect(!!(_x), 0) #define unlikely(_x) __builtin_expect(!!(_x), 0)
#endif #endif
#endif /* ! _HAVE_TYPES_H */ #endif /* ! _HAVE_TYPES_H */

View File

@ -30,11 +30,11 @@
#ifndef PAGE_SIZE #ifndef PAGE_SIZE
#define PAGE_SIZE 4096 #define PAGE_SIZE 4096
#endif /* !PAGE_SIZE */ #endif /* !PAGE_SIZE */
#ifndef MAP_ANONYMOUS #ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON #define MAP_ANONYMOUS MAP_ANON
#endif /* !MAP_ANONYMOUS */ #endif /* !MAP_ANONYMOUS */
/* Error / message handling: */ /* Error / message handling: */

View File

@ -28,7 +28,7 @@
#ifndef __linux__ #ifndef __linux__
#error "Sorry, this library is Linux-specific for now!" #error "Sorry, this library is Linux-specific for now!"
#endif /* !__linux__ */ #endif /* !__linux__ */
/* Mapping data and such */ /* Mapping data and such */

View File

@ -183,7 +183,7 @@ static void edit_params(u32 argc, char** argv) {
cc_params[cc_par_cnt++] = alloc_printf("%s/libLLVMInsTrim.so", obj_path); cc_params[cc_par_cnt++] = alloc_printf("%s/libLLVMInsTrim.so", obj_path);
else else
cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-pass.so", obj_path); cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-pass.so", obj_path);
#endif /* ^USE_TRACE_PC */ #endif /* ^USE_TRACE_PC */
cc_params[cc_par_cnt++] = "-Qunused-arguments"; cc_params[cc_par_cnt++] = "-Qunused-arguments";
@ -256,7 +256,7 @@ static void edit_params(u32 argc, char** argv) {
if (getenv("AFL_INST_RATIO")) if (getenv("AFL_INST_RATIO"))
FATAL("AFL_INST_RATIO not available at compile time with 'trace-pc'."); FATAL("AFL_INST_RATIO not available at compile time with 'trace-pc'.");
#endif /* USE_TRACE_PC */ #endif /* USE_TRACE_PC */
if (!getenv("AFL_DONT_OPTIMIZE")) { if (!getenv("AFL_DONT_OPTIMIZE")) {
@ -315,7 +315,7 @@ static void edit_params(u32 argc, char** argv) {
#else #else
"__attribute__((visibility(\"default\"))) " "__attribute__((visibility(\"default\"))) "
"int _L(unsigned int) __asm__(\"__afl_persistent_loop\"); " "int _L(unsigned int) __asm__(\"__afl_persistent_loop\"); "
#endif /* ^__APPLE__ */ #endif /* ^__APPLE__ */
"_L(_A); })"; "_L(_A); })";
cc_params[cc_par_cnt++] = cc_params[cc_par_cnt++] =
@ -329,7 +329,7 @@ static void edit_params(u32 argc, char** argv) {
#else #else
"__attribute__((visibility(\"default\"))) " "__attribute__((visibility(\"default\"))) "
"void _I(void) __asm__(\"__afl_manual_init\"); " "void _I(void) __asm__(\"__afl_manual_init\"); "
#endif /* ^__APPLE__ */ #endif /* ^__APPLE__ */
"_I(); } while (0)"; "_I(); } while (0)";
if (maybe_linking) { if (maybe_linking) {
@ -382,7 +382,7 @@ int main(int argc, char** argv) {
" [tpcg] by <lszekeres@google.com>\n"); " [tpcg] by <lszekeres@google.com>\n");
#else #else
SAYF(cCYA "afl-clang-fast" VERSION cRST " by <lszekeres@google.com>\n"); SAYF(cCYA "afl-clang-fast" VERSION cRST " by <lszekeres@google.com>\n");
#endif /* ^USE_TRACE_PC */ #endif /* ^USE_TRACE_PC */
} }

View File

@ -45,7 +45,7 @@
#define CONST_PRIO 5 #define CONST_PRIO 5
#else #else
#define CONST_PRIO 0 #define CONST_PRIO 0
#endif /* ^USE_TRACE_PC */ #endif /* ^USE_TRACE_PC */
#include <sys/mman.h> #include <sys/mman.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -34,7 +34,7 @@
#ifndef __linux__ #ifndef __linux__
#error "Sorry, this library is Linux-specific for now!" #error "Sorry, this library is Linux-specific for now!"
#endif /* !__linux__ */ #endif /* !__linux__ */
/* Change this value to tune the compare coverage */ /* Change this value to tune the compare coverage */

View File

@ -103,7 +103,7 @@ void tcg_gen_afl_maybe_log_call(target_ulong cur_loc) {
} }
#endif /* TCG_TARGET_EXTEND_ARGS */ #endif /* TCG_TARGET_EXTEND_ARGS */
op = tcg_emit_op(INDEX_op_call); op = tcg_emit_op(INDEX_op_call);
@ -187,7 +187,7 @@ void tcg_gen_afl_maybe_log_call(target_ulong cur_loc) {
#elif defined(TCG_TARGET_EXTEND_ARGS) && TCG_TARGET_REG_BITS == 64 #elif defined(TCG_TARGET_EXTEND_ARGS) && TCG_TARGET_REG_BITS == 64
int is_64bit = sizemask & (1 << 2); int is_64bit = sizemask & (1 << 2);
if (!is_64bit) { tcg_temp_free_internal(arg); } if (!is_64bit) { tcg_temp_free_internal(arg); }
#endif /* TCG_TARGET_EXTEND_ARGS */ #endif /* TCG_TARGET_EXTEND_ARGS */
} }
@ -270,7 +270,7 @@ void tcg_gen_afl_compcov_log_call(void *func, target_ulong cur_loc,
} }
#endif /* TCG_TARGET_EXTEND_ARGS */ #endif /* TCG_TARGET_EXTEND_ARGS */
op = tcg_emit_op(INDEX_op_call); op = tcg_emit_op(INDEX_op_call);
@ -367,7 +367,7 @@ void tcg_gen_afl_compcov_log_call(void *func, target_ulong cur_loc,
} }
#endif /* TCG_TARGET_EXTEND_ARGS */ #endif /* TCG_TARGET_EXTEND_ARGS */
} }

View File

@ -3,7 +3,7 @@
------------------------------------------- -------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -85,14 +85,14 @@ static volatile u8 stop_soon, /* Ctrl-C pressed? */
/* Constants used for describing byte behavior. */ /* Constants used for describing byte behavior. */
#define RESP_NONE 0x00 /* Changing byte is a no-op. */ #define RESP_NONE 0x00 /* Changing byte is a no-op. */
#define RESP_MINOR 0x01 /* Some changes have no effect. */ #define RESP_MINOR 0x01 /* Some changes have no effect. */
#define RESP_VARIABLE 0x02 /* Changes produce variable paths. */ #define RESP_VARIABLE 0x02 /* Changes produce variable paths. */
#define RESP_FIXED 0x03 /* Changes produce fixed patterns. */ #define RESP_FIXED 0x03 /* Changes produce fixed patterns. */
#define RESP_LEN 0x04 /* Potential length field */ #define RESP_LEN 0x04 /* Potential length field */
#define RESP_CKSUM 0x05 /* Potential checksum */ #define RESP_CKSUM 0x05 /* Potential checksum */
#define RESP_SUSPECT 0x06 /* Potential "suspect" blob */ #define RESP_SUSPECT 0x06 /* Potential "suspect" blob */
/* Classify tuple counts. This is a slow & naive version, but good enough here. /* Classify tuple counts. This is a slow & naive version, but good enough here.
*/ */
@ -260,7 +260,7 @@ static u32 run_target(char** argv, u8* mem, u32 len, u8 first_run) {
setrlimit(RLIMIT_DATA, &r); /* Ignore errors */ setrlimit(RLIMIT_DATA, &r); /* Ignore errors */
#endif /* ^RLIMIT_AS */ #endif /* ^RLIMIT_AS */
} }
@ -371,7 +371,7 @@ static void show_legend(void) {
} }
#endif /* USE_COLOR */ #endif /* USE_COLOR */
/* Interpret and report a pattern in the input file. */ /* Interpret and report a pattern in the input file. */
@ -385,7 +385,7 @@ static void dump_hex(u8* buf, u32 len, u8* b_data) {
u32 rlen = 1, off; u32 rlen = 1, off;
#else #else
u32 rlen = 1; u32 rlen = 1;
#endif /* ^USE_COLOR */ #endif /* ^USE_COLOR */
u8 rtype = b_data[i] & 0x0f; u8 rtype = b_data[i] & 0x0f;
@ -527,7 +527,7 @@ static void dump_hex(u8* buf, u32 len, u8* b_data) {
} }
#endif /* ^USE_COLOR */ #endif /* ^USE_COLOR */
i += rlen - 1; i += rlen - 1;
@ -535,7 +535,7 @@ static void dump_hex(u8* buf, u32 len, u8* b_data) {
#ifdef USE_COLOR #ifdef USE_COLOR
SAYF(cRST "\n"); SAYF(cRST "\n");
#endif /* USE_COLOR */ #endif /* USE_COLOR */
} }
@ -555,7 +555,7 @@ static void analyze(char** argv) {
#ifdef USE_COLOR #ifdef USE_COLOR
show_legend(); show_legend();
#endif /* USE_COLOR */ #endif /* USE_COLOR */
for (i = 0; i < in_len; i++) { for (i = 0; i < in_len; i++) {

View File

@ -3,7 +3,7 @@
----------------------------------------- -----------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -81,9 +81,9 @@ static u8 use_64bit = 0;
#ifdef __APPLE__ #ifdef __APPLE__
#error "Sorry, 32-bit Apple platforms are not supported." #error "Sorry, 32-bit Apple platforms are not supported."
#endif /* __APPLE__ */ #endif /* __APPLE__ */
#endif /* ^__x86_64__ */ #endif /* ^__x86_64__ */
/* Examine and modify parameters to pass to 'as'. Note that the file name /* Examine and modify parameters to pass to 'as'. Note that the file name
is always the last parameter passed by GCC, so we exploit this property is always the last parameter passed by GCC, so we exploit this property
@ -120,7 +120,7 @@ static void edit_params(int argc, char** argv) {
} }
#endif /* __APPLE__ */ #endif /* __APPLE__ */
/* Although this is not documented, GCC also uses TEMP and TMP when TMPDIR /* Although this is not documented, GCC also uses TEMP and TMP when TMPDIR
is not set. We need to check these non-standard variables to properly is not set. We need to check these non-standard variables to properly
@ -162,7 +162,7 @@ static void edit_params(int argc, char** argv) {
if (clang_mode && (!strcmp(argv[i], "-q") || !strcmp(argv[i], "-Q"))) if (clang_mode && (!strcmp(argv[i], "-q") || !strcmp(argv[i], "-Q")))
continue; continue;
#endif /* __APPLE__ */ #endif /* __APPLE__ */
as_params[as_par_cnt++] = argv[i]; as_params[as_par_cnt++] = argv[i];
@ -181,7 +181,7 @@ static void edit_params(int argc, char** argv) {
} }
#endif /* __APPLE__ */ #endif /* __APPLE__ */
input_file = argv[argc - 1]; input_file = argv[argc - 1];
@ -242,7 +242,7 @@ static void add_instrumentation(void) {
u8* colon_pos; u8* colon_pos;
#endif /* __APPLE__ */ #endif /* __APPLE__ */
if (input_file) { if (input_file) {
@ -413,7 +413,7 @@ static void add_instrumentation(void) {
if (line[0] == '.') { if (line[0] == '.') {
#endif /* __APPLE__ */ #endif /* __APPLE__ */
/* .L0: or LBB0_0: style jump destination */ /* .L0: or LBB0_0: style jump destination */
@ -432,7 +432,7 @@ static void add_instrumentation(void) {
(clang_mode && !strncmp(line + 1, "LBB", 3))) && (clang_mode && !strncmp(line + 1, "LBB", 3))) &&
R(100) < inst_ratio) { R(100) < inst_ratio) {
#endif /* __APPLE__ */ #endif /* __APPLE__ */
/* An optimization is possible here by adding the code only if the /* An optimization is possible here by adding the code only if the
label is mentioned in the code in contexts other than call / jmp. label is mentioned in the code in contexts other than call / jmp.

View File

@ -3,7 +3,7 @@
-------------------------------------- --------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>

View File

@ -3,9 +3,9 @@
-------------------------------------- --------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -187,7 +187,7 @@ void init_forkserver(char **argv) {
maps - so we should be getting good protection against OOM bugs. */ maps - so we should be getting good protection against OOM bugs. */
setrlimit(RLIMIT_DATA, &r); /* Ignore errors */ setrlimit(RLIMIT_DATA, &r); /* Ignore errors */
#endif /* ^RLIMIT_AS */ #endif /* ^RLIMIT_AS */
} }

View File

@ -3,7 +3,7 @@
---------------------------------------------- ----------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -87,7 +87,7 @@ u8 has_new_bits(u8* virgin_map) {
u32 i = (MAP_SIZE >> 2); u32 i = (MAP_SIZE >> 2);
#endif /* ^__x86_64__ */ #endif /* ^__x86_64__ */
u8 ret = 0; u8 ret = 0;
@ -125,7 +125,7 @@ u8 has_new_bits(u8* virgin_map) {
else else
ret = 1; ret = 1;
#endif /* ^__x86_64__ */ #endif /* ^__x86_64__ */
} }
@ -306,7 +306,7 @@ void simplify_trace(u32* mem) {
} }
#endif /* ^__x86_64__ */ #endif /* ^__x86_64__ */
/* Destructively classify execution counts in a trace. This is used as a /* Destructively classify execution counts in a trace. This is used as a
preprocessing step for any newly acquired traces. Called on every exec, preprocessing step for any newly acquired traces. Called on every exec,
@ -391,7 +391,7 @@ void classify_counts(u32* mem) {
} }
#endif /* ^__x86_64__ */ #endif /* ^__x86_64__ */
/* Compact trace bytes into a smaller bitmap. We effectively just drop the /* Compact trace bytes into a smaller bitmap. We effectively just drop the
count information here. This is called only sporadically, for some count information here. This is called only sporadically, for some
@ -453,7 +453,7 @@ u8* describe_op(u8 hnb) {
} }
#endif /* !SIMPLE_FILES */ #endif /* !SIMPLE_FILES */
/* Write a message accompanying the crash directory :-) */ /* Write a message accompanying the crash directory :-) */
@ -551,7 +551,7 @@ u8 save_if_interesting(char** argv, void* mem, u32 len, u8 fault) {
fn = alloc_printf("%s/queue/id_%06u", out_dir, queued_paths); fn = alloc_printf("%s/queue/id_%06u", out_dir, queued_paths);
#endif /* ^!SIMPLE_FILES */ #endif /* ^!SIMPLE_FILES */
add_to_queue(fn, len, 0); add_to_queue(fn, len, 0);
@ -599,7 +599,7 @@ u8 save_if_interesting(char** argv, void* mem, u32 len, u8 fault) {
simplify_trace((u64*)trace_bits); simplify_trace((u64*)trace_bits);
#else #else
simplify_trace((u32*)trace_bits); simplify_trace((u32*)trace_bits);
#endif /* ^__x86_64__ */ #endif /* ^__x86_64__ */
if (!has_new_bits(virgin_tmout)) return keeping; if (!has_new_bits(virgin_tmout)) return keeping;
@ -636,7 +636,7 @@ u8 save_if_interesting(char** argv, void* mem, u32 len, u8 fault) {
fn = alloc_printf("%s/hangs/id_%06llu", out_dir, unique_hangs); fn = alloc_printf("%s/hangs/id_%06llu", out_dir, unique_hangs);
#endif /* ^!SIMPLE_FILES */ #endif /* ^!SIMPLE_FILES */
++unique_hangs; ++unique_hangs;
@ -662,7 +662,7 @@ u8 save_if_interesting(char** argv, void* mem, u32 len, u8 fault) {
simplify_trace((u64*)trace_bits); simplify_trace((u64*)trace_bits);
#else #else
simplify_trace((u32*)trace_bits); simplify_trace((u32*)trace_bits);
#endif /* ^__x86_64__ */ #endif /* ^__x86_64__ */
if (!has_new_bits(virgin_crash)) return keeping; if (!has_new_bits(virgin_crash)) return keeping;
@ -680,7 +680,7 @@ u8 save_if_interesting(char** argv, void* mem, u32 len, u8 fault) {
fn = alloc_printf("%s/crashes/id_%06llu_%02u", out_dir, unique_crashes, fn = alloc_printf("%s/crashes/id_%06llu_%02u", out_dir, unique_crashes,
kill_signal); kill_signal);
#endif /* ^!SIMPLE_FILES */ #endif /* ^!SIMPLE_FILES */
++unique_crashes; ++unique_crashes;

View File

@ -3,7 +3,7 @@
---------------------------------------------- ----------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>

View File

@ -3,7 +3,7 @@
------------------------------------------- -------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -220,7 +220,7 @@ s32 cpu_core_count; /* CPU core count */
s32 cpu_aff = -1; /* Selected CPU core */ s32 cpu_aff = -1; /* Selected CPU core */
#endif /* HAVE_AFFINITY */ #endif /* HAVE_AFFINITY */
FILE *plot_file; /* Gnuplot output file */ FILE *plot_file; /* Gnuplot output file */

View File

@ -3,7 +3,7 @@
------------------------------------------------------ ------------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -142,7 +142,7 @@ void bind_to_free_cpu(void) {
} }
#endif /* HAVE_AFFINITY */ #endif /* HAVE_AFFINITY */
/* Load postprocessor, if available. */ /* Load postprocessor, if available. */
@ -651,7 +651,7 @@ void pivot_inputs(void) {
nfn = alloc_printf("%s/queue/id_%06u", out_dir, id); nfn = alloc_printf("%s/queue/id_%06u", out_dir, id);
#endif /* ^!SIMPLE_FILES */ #endif /* ^!SIMPLE_FILES */
} }
@ -827,7 +827,7 @@ double get_runnable_processes(void) {
} }
#endif /* ^(__APPLE__ || __FreeBSD__ || __OpenBSD__) */ #endif /* ^(__APPLE__ || __FreeBSD__ || __OpenBSD__) */
return res; return res;
@ -901,7 +901,7 @@ void maybe_delete_out_dir(void) {
} }
#endif /* !__sun */ #endif /* !__sun */
f = fopen(fn, "r"); f = fopen(fn, "r");
@ -1043,7 +1043,7 @@ void maybe_delete_out_dir(void) {
t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min,
t->tm_sec); t->tm_sec);
#endif /* ^!SIMPLE_FILES */ #endif /* ^!SIMPLE_FILES */
rename(fn, nfn); /* Ignore errors. */ rename(fn, nfn); /* Ignore errors. */
ck_free(nfn); ck_free(nfn);
@ -1074,7 +1074,7 @@ void maybe_delete_out_dir(void) {
t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min,
t->tm_sec); t->tm_sec);
#endif /* ^!SIMPLE_FILES */ #endif /* ^!SIMPLE_FILES */
rename(fn, nfn); /* Ignore errors. */ rename(fn, nfn); /* Ignore errors. */
ck_free(nfn); ck_free(nfn);
@ -1174,7 +1174,7 @@ void setup_dirs_fds(void) {
if (out_dir_fd < 0 || flock(out_dir_fd, LOCK_EX | LOCK_NB)) if (out_dir_fd < 0 || flock(out_dir_fd, LOCK_EX | LOCK_NB))
PFATAL("Unable to flock() output directory."); PFATAL("Unable to flock() output directory.");
#endif /* !__sun */ #endif /* !__sun */
} }
@ -1390,7 +1390,7 @@ void check_crash_handling(void) {
close(fd); close(fd);
#endif /* ^__APPLE__ */ #endif /* ^__APPLE__ */
} }
@ -1504,7 +1504,7 @@ void get_core_count(void) {
if (sysctl(s_name, 2, &cpu_core_count, &s, NULL, 0) < 0) return; if (sysctl(s_name, 2, &cpu_core_count, &s, NULL, 0) < 0) return;
#endif /* ^__APPLE__ */ #endif /* ^__APPLE__ */
#else #else
@ -1524,9 +1524,9 @@ void get_core_count(void) {
fclose(f); fclose(f);
#endif /* ^HAVE_AFFINITY */ #endif /* ^HAVE_AFFINITY */
#endif /* ^(__APPLE__ || __FreeBSD__ || __OpenBSD__) */ #endif /* ^(__APPLE__ || __FreeBSD__ || __OpenBSD__) */
if (cpu_core_count > 0) { if (cpu_core_count > 0) {
@ -1540,7 +1540,7 @@ void get_core_count(void) {
++cur_runnable; ++cur_runnable;
#endif /* __APPLE__ || __FreeBSD__ || __OpenBSD__ */ #endif /* __APPLE__ || __FreeBSD__ || __OpenBSD__ */
OKF("You have %d CPU core%s and %u runnable tasks (utilization: %0.0f%%).", OKF("You have %d CPU core%s and %u runnable tasks (utilization: %0.0f%%).",
cpu_core_count, cpu_core_count > 1 ? "s" : "", cur_runnable, cpu_core_count, cpu_core_count > 1 ? "s" : "", cur_runnable,
@ -1780,7 +1780,7 @@ void check_binary(u8* fname) {
FATAL("Program '%s' is not a 64-bit Mach-O binary", target_path); FATAL("Program '%s' is not a 64-bit Mach-O binary", target_path);
#endif #endif
#endif /* ^!__APPLE__ */ #endif /* ^!__APPLE__ */
if (!qemu_mode && !unicorn_mode && !dumb_mode && if (!qemu_mode && !unicorn_mode && !dumb_mode &&
!memmem(f_data, f_len, SHM_ENV_VAR, strlen(SHM_ENV_VAR) + 1)) { !memmem(f_data, f_len, SHM_ENV_VAR, strlen(SHM_ENV_VAR) + 1)) {

View File

@ -3,7 +3,7 @@
---------------------------------------------- ----------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>

View File

@ -3,7 +3,7 @@
--------------------------------------------------------------- ---------------------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -328,7 +328,7 @@ static void locate_diffs(u8* ptr1, u8* ptr2, u32 len, s32* first, s32* last) {
} }
#endif /* !IGNORE_FINDS */ #endif /* !IGNORE_FINDS */
/* Take the current entry from the queue, fuzz it for a while. This /* Take the current entry from the queue, fuzz it for a while. This
function is a tad too long... returns 0 if fuzzed successfully, 1 if function is a tad too long... returns 0 if fuzzed successfully, 1 if
@ -385,7 +385,7 @@ u8 fuzz_one_original(char** argv) {
} }
#endif /* ^IGNORE_FINDS */ #endif /* ^IGNORE_FINDS */
if (not_on_tty) { if (not_on_tty) {
@ -2253,7 +2253,7 @@ retry_splicing:
} }
#endif /* !IGNORE_FINDS */ #endif /* !IGNORE_FINDS */
ret_val = 0; ret_val = 0;
@ -2337,7 +2337,7 @@ u8 pilot_fuzzing(char** argv) {
} }
#endif /* ^IGNORE_FINDS */ #endif /* ^IGNORE_FINDS */
if (not_on_tty) { if (not_on_tty) {
@ -4015,7 +4015,7 @@ pacemaker_fuzzing:
} }
#endif /* !IGNORE_FINDS */ #endif /* !IGNORE_FINDS */
ret_val = 0; ret_val = 0;
@ -4198,7 +4198,7 @@ u8 core_fuzzing(char** argv) {
} }
#endif /* ^IGNORE_FINDS */ #endif /* ^IGNORE_FINDS */
if (not_on_tty) { if (not_on_tty) {
@ -5860,7 +5860,7 @@ pacemaker_fuzzing:
} }
#endif /* !IGNORE_FINDS */ #endif /* !IGNORE_FINDS */
ret_val = 0; ret_val = 0;
abandon_entry: abandon_entry:

View File

@ -3,7 +3,7 @@
------------------------------------------------ ------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -401,5 +401,5 @@ abort_trimming:
} }
#endif /* USE_PYTHON */ #endif /* USE_PYTHON */

View File

@ -3,7 +3,7 @@
--------------------------------------------- ---------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>

View File

@ -3,7 +3,7 @@
-------------------------------------------------------- --------------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -73,7 +73,7 @@ u8 run_target(char** argv, u32 timeout) {
setrlimit(RLIMIT_DATA, &r); /* Ignore errors */ setrlimit(RLIMIT_DATA, &r); /* Ignore errors */
#endif /* ^RLIMIT_AS */ #endif /* ^RLIMIT_AS */
} }
@ -210,7 +210,7 @@ u8 run_target(char** argv, u32 timeout) {
classify_counts((u64*)trace_bits); classify_counts((u64*)trace_bits);
#else #else
classify_counts((u32*)trace_bits); classify_counts((u32*)trace_bits);
#endif /* ^__x86_64__ */ #endif /* ^__x86_64__ */
prev_timed_out = child_timed_out; prev_timed_out = child_timed_out;

View File

@ -3,7 +3,7 @@
--------------------------------------------- ---------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -310,7 +310,7 @@ void show_stats(void) {
sprintf(tmp + banner_pad, "%s " cLCY VERSION cLGN " (%s) " cPIN "[%s]", sprintf(tmp + banner_pad, "%s " cLCY VERSION cLGN " (%s) " cPIN "[%s]",
crash_mode ? cPIN "peruvian were-rabbit" : cYEL "american fuzzy lop", crash_mode ? cPIN "peruvian were-rabbit" : cYEL "american fuzzy lop",
use_banner, power_name); use_banner, power_name);
#endif /* HAVE_AFFINITY */ #endif /* HAVE_AFFINITY */
SAYF("\n%s\n", tmp); SAYF("\n%s\n", tmp);
@ -674,7 +674,7 @@ void show_stats(void) {
SAYF(SP10 cGRA " [cpu:%s%3u%%" cGRA "]\r" cRST, cpu_color, SAYF(SP10 cGRA " [cpu:%s%3u%%" cGRA "]\r" cRST, cpu_color,
MIN(cur_utilization, 999)); MIN(cur_utilization, 999));
#endif /* ^HAVE_AFFINITY */ #endif /* ^HAVE_AFFINITY */
} else } else

View File

@ -3,7 +3,7 @@
-------------------------------- --------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -621,7 +621,7 @@ int main(int argc, char** argv) {
#ifdef HAVE_AFFINITY #ifdef HAVE_AFFINITY
bind_to_free_cpu(); bind_to_free_cpu();
#endif /* HAVE_AFFINITY */ #endif /* HAVE_AFFINITY */
check_crash_handling(); check_crash_handling();
check_cpu_governor(); check_cpu_governor();
@ -880,5 +880,5 @@ stop_fuzzing:
} }
#endif /* !AFL_LIB */ #endif /* !AFL_LIB */

View File

@ -3,7 +3,7 @@
------------------------------------------------ ------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -201,7 +201,7 @@ static void edit_params(u32 argc, char** argv) {
} }
#endif /* __APPLE__ */ #endif /* __APPLE__ */
} }

View File

@ -3,7 +3,7 @@
----------------------------------- -----------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -54,7 +54,7 @@
#ifdef __linux__ #ifdef __linux__
#define HAVE_AFFINITY 1 #define HAVE_AFFINITY 1
#endif /* __linux__ */ #endif /* __linux__ */
/* Get unix time in microseconds. */ /* Get unix time in microseconds. */
@ -255,7 +255,7 @@ int main(int argc, char** argv) {
return (util_perc > 105) + (util_perc > 130); return (util_perc > 105) + (util_perc > 130);
#endif /* ^HAVE_AFFINITY */ #endif /* ^HAVE_AFFINITY */
} }

View File

@ -3,9 +3,9 @@
------------------------------------------------- -------------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>

View File

@ -3,9 +3,9 @@
------------------------------------------ ------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
@ -261,7 +261,7 @@ static void run_target(char** argv) {
setrlimit(RLIMIT_DATA, &r); /* Ignore errors */ setrlimit(RLIMIT_DATA, &r); /* Ignore errors */
#endif /* ^RLIMIT_AS */ #endif /* ^RLIMIT_AS */
} }

View File

@ -3,9 +3,9 @@
------------------------------------------ ------------------------------------------
Originally written by Michal Zalewski <lcamtuf@google.com> Originally written by Michal Zalewski <lcamtuf@google.com>
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>