about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-06-19 18:05:04 +0200
committervan Hauser <vh@thc.org>2020-06-19 18:05:04 +0200
commitde2c565953228a52b2ac75b778b27aab983151c6 (patch)
tree39b0a476721ef6e18cec35376f7881c3098501da /include
parent758f136d3ec11ad9bff39643962a4f2320713a6a (diff)
downloadafl++-de2c565953228a52b2ac75b778b27aab983151c6.tar.gz
first commit, looks good
Diffstat (limited to 'include')
-rw-r--r--include/afl-fuzz.h7
-rw-r--r--include/config.h25
2 files changed, 28 insertions, 4 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index e7b52d56..8d8db100 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -138,7 +138,8 @@ struct queue_entry {
       var_behavior,                     /* Variable behavior?               */
       favored,                          /* Currently favored?               */
       fs_redundant,                     /* Marked as redundant in the fs?   */
-      fully_colorized;                  /* Do not run redqueen stage again  */
+      fully_colorized,                  /* Do not run redqueen stage again  */
+      is_ascii;                         /* Is the input just ascii text?    */
 
   u32 bitmap_size,                      /* Number of bits set in bitmap     */
       fuzz_level;                       /* Number of fuzzing iterations     */
@@ -947,7 +948,7 @@ u8 input_to_state_stage(afl_state_t *afl, u8 *orig_buf, u8 *buf, u32 len,
                         u64 exec_cksum);
 
 /* xoshiro256** */
-uint64_t rand_next(afl_state_t *afl);
+uint32_t rand_next(afl_state_t *afl);
 
 /**** Inline routines ****/
 
@@ -967,7 +968,7 @@ static inline u32 rand_below(afl_state_t *afl, u32 limit) {
 
   }
 
-  return rand_next(afl) % limit;
+  return (rand_next(afl) % limit);
 
 }
 
diff --git a/include/config.h b/include/config.h
index 711d0b77..d4dd70ff 100644
--- a/include/config.h
+++ b/include/config.h
@@ -293,7 +293,7 @@
 
 /* Call count interval between reseeding the libc PRNG from /dev/urandom: */
 
-#define RESEED_RNG 100000
+#define RESEED_RNG 256000
 
 /* Maximum line length passed from GCC to 'as' and used for parsing
    configuration files: */
@@ -397,6 +397,29 @@
 
 // #define IGNORE_FINDS
 
+/* Text mutations */
+
+/* What is the minimum length of a queue input to be evaluated for "is_ascii"?
+ */
+
+#define AFL_TXT_MIN_LEN 8
+
+/* What is the minimum percentage of ascii characters present to be classifed
+   as "is_ascii"? */
+
+#define AFL_TXT_MIN_PERCENT 80
+
+/* How often to perform ASCII mutations 0 = disable, 1-8 are good values */
+
+#define AFL_TXT_BIAS 6
+
+/* Maximum length of a string to tamper with */
+
+#define AFL_TXT_STRING_MAX_LEN 1024
+
+/* Maximum mutations on a string */
+
+#define AFL_TXT_STRING_MAX_MUTATIONS 16
 
 #endif                                                  /* ! _HAVE_CONFIG_H */