mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-14 11:08:06 +00:00
code-format
This commit is contained in:
@ -223,10 +223,10 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!(getenv("AFL_LLVM_LTO_AUTODICTIONARY") // disabled when autodictionary
|
if ((!(getenv("AFL_LLVM_LTO_AUTODICTIONARY") // disabled when autodictionary
|
||||||
&& instrument_mode != INSTRUMENT_LTO)) // and lto_mode is used
|
&& instrument_mode != INSTRUMENT_LTO)) // and lto_mode is used
|
||||||
&& (getenv("LAF_TRANSFORM_COMPARES") ||
|
&& (getenv("LAF_TRANSFORM_COMPARES") ||
|
||||||
getenv("AFL_LLVM_LAF_TRANSFORM_COMPARES"))) {
|
getenv("AFL_LLVM_LAF_TRANSFORM_COMPARES"))) {
|
||||||
|
|
||||||
cc_params[cc_par_cnt++] = "-Xclang";
|
cc_params[cc_par_cnt++] = "-Xclang";
|
||||||
cc_params[cc_par_cnt++] = "-load";
|
cc_params[cc_par_cnt++] = "-load";
|
||||||
|
@ -408,11 +408,14 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
|
|||||||
if ((status & FS_OPT_MAPSIZE) == FS_OPT_MAPSIZE) {
|
if ((status & FS_OPT_MAPSIZE) == FS_OPT_MAPSIZE) {
|
||||||
|
|
||||||
fsrv->map_size = FS_OPT_GET_MAPSIZE(status);
|
fsrv->map_size = FS_OPT_GET_MAPSIZE(status);
|
||||||
if (unlikely(fsrv->map_size % 8)) {
|
if (unlikely(fsrv->map_size % 8)) {
|
||||||
|
|
||||||
// should not happen
|
// should not happen
|
||||||
WARNF("Target reported non-aligned map size of %ud", fsrv->map_size);
|
WARNF("Target reported non-aligned map size of %ud", fsrv->map_size);
|
||||||
fsrv->map_size = (((fsrv->map_size + 8) >> 3) << 3);
|
fsrv->map_size = (((fsrv->map_size + 8) >> 3) << 3);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!be_quiet) ACTF("Target map size: %u", fsrv->map_size);
|
if (!be_quiet) ACTF("Target map size: %u", fsrv->map_size);
|
||||||
if (fsrv->map_size > MAP_SIZE)
|
if (fsrv->map_size > MAP_SIZE)
|
||||||
FATAL(
|
FATAL(
|
||||||
@ -787,7 +790,7 @@ fsrv_run_result_t afl_fsrv_run_target(
|
|||||||
behave very normally and do not have to be treated as volatile. */
|
behave very normally and do not have to be treated as volatile. */
|
||||||
|
|
||||||
MEM_BARRIER();
|
MEM_BARRIER();
|
||||||
//u32 tb4 = *(u32 *)fsrv->trace_bits;
|
// u32 tb4 = *(u32 *)fsrv->trace_bits;
|
||||||
|
|
||||||
if (likely(classify_counts_func)) classify_counts_func(fsrv);
|
if (likely(classify_counts_func)) classify_counts_func(fsrv);
|
||||||
|
|
||||||
|
@ -112,18 +112,20 @@ u8 has_new_bits(afl_state_t *afl, u8 *virgin_map) {
|
|||||||
|
|
||||||
#ifdef WORD_SIZE_64
|
#ifdef WORD_SIZE_64
|
||||||
|
|
||||||
if (*virgin == 0xffffffffffffffff || (cur[0] && vir[0] == 0xff) || (cur[1] && vir[1] == 0xff) ||
|
if (*virgin == 0xffffffffffffffff || (cur[0] && vir[0] == 0xff) ||
|
||||||
(cur[2] && vir[2] == 0xff) || (cur[3] && vir[3] == 0xff) ||
|
(cur[1] && vir[1] == 0xff) || (cur[2] && vir[2] == 0xff) ||
|
||||||
(cur[4] && vir[4] == 0xff) || (cur[5] && vir[5] == 0xff) ||
|
(cur[3] && vir[3] == 0xff) || (cur[4] && vir[4] == 0xff) ||
|
||||||
(cur[6] && vir[6] == 0xff) || (cur[7] && vir[7] == 0xff))
|
(cur[5] && vir[5] == 0xff) || (cur[6] && vir[6] == 0xff) ||
|
||||||
|
(cur[7] && vir[7] == 0xff))
|
||||||
ret = 2;
|
ret = 2;
|
||||||
else
|
else
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if (*virgin == 0xffffffff || (cur[0] && vir[0] == 0xff) || (cur[1] && vir[1] == 0xff) ||
|
if (*virgin == 0xffffffff || (cur[0] && vir[0] == 0xff) ||
|
||||||
(cur[2] && vir[2] == 0xff) || (cur[3] && vir[3] == 0xff))
|
(cur[1] && vir[1] == 0xff) || (cur[2] && vir[2] == 0xff) ||
|
||||||
|
(cur[3] && vir[3] == 0xff))
|
||||||
ret = 2;
|
ret = 2;
|
||||||
else
|
else
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
@ -50,7 +50,7 @@ void write_to_testcase(afl_state_t *afl, void *mem, u32 len) {
|
|||||||
s32 doc_fd;
|
s32 doc_fd;
|
||||||
char fn[PATH_MAX];
|
char fn[PATH_MAX];
|
||||||
snprintf(fn, PATH_MAX, "%s/mutations/%09u:%s", afl->out_dir,
|
snprintf(fn, PATH_MAX, "%s/mutations/%09u:%s", afl->out_dir,
|
||||||
afl->document_counter++, describe_op(afl, 0));
|
afl->document_counter++, describe_op(afl, 0));
|
||||||
|
|
||||||
if ((doc_fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600)) >= 0) {
|
if ((doc_fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600)) >= 0) {
|
||||||
|
|
||||||
|
@ -63,8 +63,7 @@
|
|||||||
static char *stdin_file; /* stdin file */
|
static char *stdin_file; /* stdin file */
|
||||||
|
|
||||||
static u8 *in_dir = NULL, /* input folder */
|
static u8 *in_dir = NULL, /* input folder */
|
||||||
*out_file = NULL,
|
*out_file = NULL, *at_file = NULL; /* Substitution string for @@ */
|
||||||
*at_file = NULL; /* Substitution string for @@ */
|
|
||||||
|
|
||||||
static u8 *in_data; /* Input data */
|
static u8 *in_data; /* Input data */
|
||||||
|
|
||||||
@ -878,8 +877,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
|||||||
if (-1 == stat(infile, &statbuf) || !S_ISREG(statbuf.st_mode)) continue;
|
if (-1 == stat(infile, &statbuf) || !S_ISREG(statbuf.st_mode)) continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
snprintf(outfile, sizeof(outfile), "%s/%s", out_file,
|
snprintf(outfile, sizeof(outfile), "%s/%s", out_file, dir_ent->d_name);
|
||||||
dir_ent->d_name);
|
|
||||||
|
|
||||||
if (read_file(infile)) {
|
if (read_file(infile)) {
|
||||||
|
|
||||||
@ -901,8 +899,6 @@ int main(int argc, char **argv_orig, char **envp) {
|
|||||||
run_target(fsrv, use_argv);
|
run_target(fsrv, use_argv);
|
||||||
tcnt = write_results_to_file(fsrv, out_file);
|
tcnt = write_results_to_file(fsrv, out_file);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!quiet_mode) {
|
if (!quiet_mode) {
|
||||||
|
@ -62,8 +62,7 @@
|
|||||||
static u8 *mask_bitmap; /* Mask for trace bits (-B) */
|
static u8 *mask_bitmap; /* Mask for trace bits (-B) */
|
||||||
|
|
||||||
static u8 *in_file, /* Minimizer input test case */
|
static u8 *in_file, /* Minimizer input test case */
|
||||||
*out_file,
|
*out_file, *output_file; /* Minimizer output file */
|
||||||
*output_file; /* Minimizer output file */
|
|
||||||
|
|
||||||
static u8 *in_data; /* Input data for trimming */
|
static u8 *in_data; /* Input data for trimming */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user