From 428b88a82a6dd01db8a50e618fe2021bc8215229 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Mon, 16 Sep 2019 16:17:16 +0200 Subject: added afl_custom_mutator_only --- src/afl-fuzz-globals.c | 1 + src/afl-fuzz-one.c | 9 ++++++++- src/afl-fuzz.c | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/afl-fuzz-globals.c b/src/afl-fuzz-globals.c index 9aaa03cc..d457d28c 100644 --- a/src/afl-fuzz-globals.c +++ b/src/afl-fuzz-globals.c @@ -84,6 +84,7 @@ u64 mem_limit = MEM_LIMIT; /* Memory cap for child (MB) */ u8 cal_cycles = CAL_CYCLES, /* Calibration cycles defaults */ cal_cycles_long = CAL_CYCLES_LONG, debug, /* Debug mode */ + custom_only, /* Custom mutator only mode */ python_only; /* Python-only mode */ u32 stats_update_freq = 1; /* Stats update frequency (execs) */ diff --git a/src/afl-fuzz-one.c b/src/afl-fuzz-one.c index 3928a88f..82643722 100644 --- a/src/afl-fuzz-one.c +++ b/src/afl-fuzz-one.c @@ -516,7 +516,14 @@ u8 fuzz_one_original(char** argv) { stage_finds[STAGE_CUSTOM_MUTATOR] += new_hit_cnt - orig_hit_cnt; stage_cycles[STAGE_CUSTOM_MUTATOR] += stage_max; - goto abandon_entry; + + if (custom_only) { + + /* Skip other stages */ + ret_val = 0; + goto abandon_entry; + + } } diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c index 2d16345a..c2e18477 100644 --- a/src/afl-fuzz.c +++ b/src/afl-fuzz.c @@ -622,6 +622,16 @@ int main(int argc, char** argv) { } + if (getenv("AFL_CUSTOM_MUTATOR_ONLY")) { + + /* This ensures we don't proceed to havoc/splice */ + custom_only = 1; + + /* Ensure we also skip all deterministic steps */ + skip_deterministic = 1; + + } + get_core_count(); #ifdef HAVE_AFFINITY -- cgit 1.4.1