about summary refs log tree commit diff
path: root/src/afl-fuzz-redqueen.c
diff options
context:
space:
mode:
authorguyf2010 <guyf2010@hotmail.com>2022-11-13 14:37:33 +0000
committerguyf2010 <guyf2010@hotmail.com>2022-11-13 14:37:33 +0000
commitbb81fb784e7c855fe230136a4878f68c33d0f98f (patch)
treea2a9d2a9a5139abbe3861510f8b8cf2cdbcd1354 /src/afl-fuzz-redqueen.c
parentc5f8869778b237f89cc4c12c1961a9ef559179b8 (diff)
downloadafl++-bb81fb784e7c855fe230136a4878f68c33d0f98f.tar.gz
Add option for random cmplog colorization
Diffstat (limited to 'src/afl-fuzz-redqueen.c')
-rw-r--r--src/afl-fuzz-redqueen.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/afl-fuzz-redqueen.c b/src/afl-fuzz-redqueen.c
index 337f124d..aa0b3210 100644
--- a/src/afl-fuzz-redqueen.c
+++ b/src/afl-fuzz-redqueen.c
@@ -167,6 +167,13 @@ static u8 get_exec_checksum(afl_state_t *afl, u8 *buf, u32 len, u64 *cksum) {
 
 }
 
+/* replace everything with different values */
+static void random_replace(afl_state_t *afl, u8 *buf, u32 len){
+  for(u32 i=0; i < len; i++){
+    buf[i] = rand_below(afl, 256);
+  }
+}
+
 /* replace everything with different values but stay in the same type */
 static void type_replace(afl_state_t *afl, u8 *buf, u32 len) {
 
@@ -293,7 +300,11 @@ static u8 colorization(afl_state_t *afl, u8 *buf, u32 len,
 
   memcpy(backup, buf, len);
   memcpy(changed, buf, len);
-  type_replace(afl, changed, len);
+  if (afl->cmplog_random_colorization) {
+    random_replace(afl, changed, len);
+  } else {
+    type_replace(afl, changed, len);
+  }
 
   while ((rng = pop_biggest_range(&ranges)) != NULL &&
          afl->stage_cur < afl->stage_max) {