aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2023-06-29 15:01:41 +0300
committerGitHub <noreply@github.com>2023-06-29 15:01:41 +0300
commit15fc47a62cd4fa47d6e2436a3830c656ffe64fc9 (patch)
tree476421e898e6268c220009dce0863817707ed608 /src
parent7b1238b0f4d177976a4de5fa35182009da59cc45 (diff)
parentc2c27349c3d74f79ceb6cd3795862b21d90429ea (diff)
downloadafl++-15fc47a62cd4fa47d6e2436a3830c656ffe64fc9.tar.gz
Merge pull request #1789 from AFLplusplus/orig_mut3
better mutator weightings
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-one.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/afl-fuzz-one.c b/src/afl-fuzz-one.c
index 4efc661e..c6e49653 100644
--- a/src/afl-fuzz-one.c
+++ b/src/afl-fuzz-one.c
@@ -2101,17 +2101,17 @@ havoc_stage:
*/
- rand_max = MUT_STRATEGY_ARRAY_SIZE;
-
- if (unlikely(afl->text_input /*|| afl->queue_cur->is_ascii*/)) { // is text?
+ if (unlikely(afl->text_input)) { // is text?
if (likely(afl->fuzz_mode == 0)) { // is exploration?
- mutation_array = (unsigned int *)&mutation_strategy_exploration_text;
+ mutation_array = (unsigned int *)&text_array;
+ rand_max = MUT_TXT_ARRAY_SIZE;
} else { // is exploitation!
mutation_array = (unsigned int *)&mutation_strategy_exploitation_text;
+ rand_max = MUT_STRATEGY_ARRAY_SIZE;
}
@@ -2119,11 +2119,13 @@ havoc_stage:
if (likely(afl->fuzz_mode == 0)) { // is exploration?
- mutation_array = (unsigned int *)&mutation_strategy_exploration_binary;
+ mutation_array = (unsigned int *)&binary_array;
+ rand_max = MUT_BIN_ARRAY_SIZE;
} else { // is exploitation!
mutation_array = (unsigned int *)&mutation_strategy_exploitation_binary;
+ rand_max = MUT_STRATEGY_ARRAY_SIZE;
}