mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-14 11:08:06 +00:00
code format
This commit is contained in:
@ -24,7 +24,7 @@ import importlib.metadata
|
|||||||
|
|
||||||
# string_re = re.compile('(\\"(\\\\.|[^"\\\\])*\\")') # TODO: for future use
|
# string_re = re.compile('(\\"(\\\\.|[^"\\\\])*\\")') # TODO: for future use
|
||||||
|
|
||||||
CURRENT_LLVM = os.getenv('LLVM_VERSION', 14)
|
CURRENT_LLVM = os.getenv('LLVM_VERSION', 15)
|
||||||
CLANG_FORMAT_BIN = os.getenv("CLANG_FORMAT_BIN", "")
|
CLANG_FORMAT_BIN = os.getenv("CLANG_FORMAT_BIN", "")
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
will be kept and written to the crash/ directory as RECORD:... files.
|
will be kept and written to the crash/ directory as RECORD:... files.
|
||||||
Note that every crash will be written, not only unique ones! */
|
Note that every crash will be written, not only unique ones! */
|
||||||
|
|
||||||
//#define AFL_PERSISTENT_RECORD
|
// #define AFL_PERSISTENT_RECORD
|
||||||
|
|
||||||
/* console output colors: There are three ways to configure its behavior
|
/* console output colors: There are three ways to configure its behavior
|
||||||
* 1. default: colored outputs fixed on: defined USE_COLOR && defined
|
* 1. default: colored outputs fixed on: defined USE_COLOR && defined
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
#include "llvm/IR/Module.h"
|
#include "llvm/IR/Module.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
//#include "llvm/Transforms/IPO/PassManagerBuilder.h"
|
// #include "llvm/Transforms/IPO/PassManagerBuilder.h"
|
||||||
#include "llvm/Passes/PassPlugin.h"
|
#include "llvm/Passes/PassPlugin.h"
|
||||||
#include "llvm/Passes/PassBuilder.h"
|
#include "llvm/Passes/PassBuilder.h"
|
||||||
#include "llvm/IR/PassManager.h"
|
#include "llvm/IR/PassManager.h"
|
||||||
|
@ -60,7 +60,7 @@ using namespace llvm;
|
|||||||
|
|
||||||
// uncomment this toggle function verification at each step. horribly slow, but
|
// uncomment this toggle function verification at each step. horribly slow, but
|
||||||
// helps to pinpoint a potential problem in the splitting code.
|
// helps to pinpoint a potential problem in the splitting code.
|
||||||
//#define VERIFY_TOO_MUCH 1
|
// #define VERIFY_TOO_MUCH 1
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -68,7 +68,11 @@ static int debug_fd = -1;
|
|||||||
|
|
||||||
#define MAX_MAPPINGS 1024
|
#define MAX_MAPPINGS 1024
|
||||||
|
|
||||||
static struct mapping { void *st, *en; } __compcov_ro[MAX_MAPPINGS];
|
static struct mapping {
|
||||||
|
|
||||||
|
void *st, *en;
|
||||||
|
|
||||||
|
} __compcov_ro[MAX_MAPPINGS];
|
||||||
|
|
||||||
static u32 __compcov_ro_cnt;
|
static u32 __compcov_ro_cnt;
|
||||||
|
|
||||||
|
@ -933,10 +933,10 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if LLVM_MAJOR >= 13
|
// #if LLVM_MAJOR >= 13
|
||||||
// // Use the old pass manager in LLVM 14 which the AFL++ passes still
|
// // Use the old pass manager in LLVM 14 which the AFL++ passes still
|
||||||
// use. cc_params[cc_par_cnt++] = "-flegacy-pass-manager";
|
// use. cc_params[cc_par_cnt++] = "-flegacy-pass-manager";
|
||||||
//#endif
|
// #endif
|
||||||
|
|
||||||
if (lto_mode && !have_c) {
|
if (lto_mode && !have_c) {
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
#include "afl-fuzz.h"
|
#include "afl-fuzz.h"
|
||||||
#include "cmplog.h"
|
#include "cmplog.h"
|
||||||
|
|
||||||
//#define _DEBUG
|
// #define _DEBUG
|
||||||
//#define CMPLOG_INTROSPECTION
|
// #define CMPLOG_INTROSPECTION
|
||||||
|
|
||||||
// CMP attribute enum
|
// CMP attribute enum
|
||||||
enum {
|
enum {
|
||||||
@ -571,7 +571,7 @@ static u8 its_fuzz(afl_state_t *afl, u8 *buf, u32 len, u8 *status) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//#ifdef CMPLOG_SOLVE_TRANSFORM
|
// #ifdef CMPLOG_SOLVE_TRANSFORM
|
||||||
static int strntoll(const char *str, size_t sz, char **end, int base,
|
static int strntoll(const char *str, size_t sz, char **end, int base,
|
||||||
long long *out) {
|
long long *out) {
|
||||||
|
|
||||||
@ -771,7 +771,7 @@ static void to_base64(u8 *src, u8 *dst, u32 dst_len) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#endif
|
// #endif
|
||||||
|
|
||||||
static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
|
static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
|
||||||
u64 pattern, u64 repl, u64 o_pattern,
|
u64 pattern, u64 repl, u64 o_pattern,
|
||||||
@ -803,7 +803,7 @@ static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
|
|||||||
// o_pattern, pattern, repl, changed_val, idx, taint_len,
|
// o_pattern, pattern, repl, changed_val, idx, taint_len,
|
||||||
// hshape, attr);
|
// hshape, attr);
|
||||||
|
|
||||||
//#ifdef CMPLOG_SOLVE_TRANSFORM
|
// #ifdef CMPLOG_SOLVE_TRANSFORM
|
||||||
// reverse atoi()/strnu?toll() is expensive, so we only to it in lvl 3
|
// reverse atoi()/strnu?toll() is expensive, so we only to it in lvl 3
|
||||||
if (afl->cmplog_enable_transform && (lvl & LVL3)) {
|
if (afl->cmplog_enable_transform && (lvl & LVL3)) {
|
||||||
|
|
||||||
@ -1120,7 +1120,7 @@ static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//#endif
|
// #endif
|
||||||
|
|
||||||
// we only allow this for ascii2integer (above) so leave if this is the case
|
// we only allow this for ascii2integer (above) so leave if this is the case
|
||||||
if (unlikely(pattern == o_pattern)) { return 0; }
|
if (unlikely(pattern == o_pattern)) { return 0; }
|
||||||
@ -1275,7 +1275,7 @@ static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
|
|||||||
// 16 = modified float, 32 = modified integer (modified = wont match
|
// 16 = modified float, 32 = modified integer (modified = wont match
|
||||||
// in original buffer)
|
// in original buffer)
|
||||||
|
|
||||||
//#ifdef CMPLOG_SOLVE_ARITHMETIC
|
// #ifdef CMPLOG_SOLVE_ARITHMETIC
|
||||||
if (!afl->cmplog_enable_arith || lvl < LVL3 || attr == IS_TRANSFORM) {
|
if (!afl->cmplog_enable_arith || lvl < LVL3 || attr == IS_TRANSFORM) {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1440,7 +1440,7 @@ static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//#endif /*
|
// #endif /*
|
||||||
// CMPLOG_SOLVE_ARITHMETIC
|
// CMPLOG_SOLVE_ARITHMETIC
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1948,9 +1948,9 @@ static u8 rtn_extend_encoding(afl_state_t *afl, u8 entry,
|
|||||||
#ifndef CMPLOG_COMBINE
|
#ifndef CMPLOG_COMBINE
|
||||||
(void)(cbuf);
|
(void)(cbuf);
|
||||||
#endif
|
#endif
|
||||||
//#ifndef CMPLOG_SOLVE_TRANSFORM
|
// #ifndef CMPLOG_SOLVE_TRANSFORM
|
||||||
// (void)(changed_val);
|
// (void)(changed_val);
|
||||||
//#endif
|
// #endif
|
||||||
|
|
||||||
if (afl->fsrv.total_execs - last_update > screen_update) {
|
if (afl->fsrv.total_execs - last_update > screen_update) {
|
||||||
|
|
||||||
@ -2418,7 +2418,7 @@ static u8 rtn_extend_encoding(afl_state_t *afl, u8 entry,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//#endif
|
// #endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -2818,9 +2818,9 @@ u8 input_to_state_stage(afl_state_t *afl, u8 *orig_buf, u8 *buf, u32 len) {
|
|||||||
|
|
||||||
} else if ((lvl & LVL1)
|
} else if ((lvl & LVL1)
|
||||||
|
|
||||||
//#ifdef CMPLOG_SOLVE_TRANSFORM
|
// #ifdef CMPLOG_SOLVE_TRANSFORM
|
||||||
|| ((lvl & LVL3) && afl->cmplog_enable_transform)
|
|| ((lvl & LVL3) && afl->cmplog_enable_transform)
|
||||||
//#endif
|
// #endif
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if (unlikely(rtn_fuzz(afl, k, orig_buf, buf, cbuf, len, lvl, taint))) {
|
if (unlikely(rtn_fuzz(afl, k, orig_buf, buf, cbuf, len, lvl, taint))) {
|
||||||
|
@ -81,7 +81,11 @@ void *(*__libc_memmem)(const void *haystack, size_t haystack_len,
|
|||||||
|
|
||||||
#define MAX_MAPPINGS 1024
|
#define MAX_MAPPINGS 1024
|
||||||
|
|
||||||
static struct mapping { void *st, *en; } __tokencap_ro[MAX_MAPPINGS];
|
static struct mapping {
|
||||||
|
|
||||||
|
void *st, *en;
|
||||||
|
|
||||||
|
} __tokencap_ro[MAX_MAPPINGS];
|
||||||
|
|
||||||
static u32 __tokencap_ro_cnt;
|
static u32 __tokencap_ro_cnt;
|
||||||
static u8 __tokencap_ro_loaded;
|
static u8 __tokencap_ro_loaded;
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
//#include "logging.h" // switche from preeny_info() to fprintf(stderr, "Info: "
|
// #include "logging.h" // switched from preeny_info() to fprintf(stderr, "Info:
|
||||||
|
// "
|
||||||
|
|
||||||
//
|
//
|
||||||
// originals
|
// originals
|
||||||
|
Reference in New Issue
Block a user