aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2019-09-16 16:17:16 +0200
committervan Hauser <vh@thc.org>2019-09-16 16:17:16 +0200
commit428b88a82a6dd01db8a50e618fe2021bc8215229 (patch)
tree6b2086be2281bde4a0e1abb51b7d0cfebd6436f0 /src
parent46ac5590037af101cd17fcdc9b488cfc483523b0 (diff)
downloadafl++-428b88a82a6dd01db8a50e618fe2021bc8215229.tar.gz
added afl_custom_mutator_only
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-globals.c1
-rw-r--r--src/afl-fuzz-one.c9
-rw-r--r--src/afl-fuzz.c10
3 files changed, 19 insertions, 1 deletions
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