about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--custom_mutators/autotokens/TODO9
-rw-r--r--custom_mutators/autotokens/autotokens.cpp12
-rw-r--r--include/config.h4
3 files changed, 18 insertions, 7 deletions
diff --git a/custom_mutators/autotokens/TODO b/custom_mutators/autotokens/TODO
index 3cae3060..528dff1f 100644
--- a/custom_mutators/autotokens/TODO
+++ b/custom_mutators/autotokens/TODO
@@ -1,5 +1,3 @@
-cmplog: only add tokens that were found to fit?
-
 create from thin air if no good seed after a cycle and dict large enough?
 (static u32 no_of_struct_inputs;) 
 
@@ -16,8 +14,9 @@ corpus analyse:
 	- libpcap
 min len, max len, % wenn 95/98/99/100 ascii
 
-funktion und env für menge an mutationen
-
 env für menge an per mutation run
 
-only add inital dictionary, not furher finds, e.g. cmplog
+AFL_TXT_MAX_LEN 65535
+AFL_TXT_MIN_LEN 16
+AFL_TXT_MIN_PERCENT=99
+
diff --git a/custom_mutators/autotokens/autotokens.cpp b/custom_mutators/autotokens/autotokens.cpp
index a0125851..46a347f8 100644
--- a/custom_mutators/autotokens/autotokens.cpp
+++ b/custom_mutators/autotokens/autotokens.cpp
@@ -34,6 +34,9 @@ extern "C" {
 #ifndef AUTOTOKENS_SPLICE_DISABLE
   #define AUTOTOKENS_SPLICE_DISABLE 0
 #endif
+#ifndef AFL_TXT_MAX_LEN
+  #define AFL_TXT_MAX_LEN 65535
+#endif
 
 #if AUTOTOKENS_SPLICE_MIN >= AUTOTOKENS_SIZE_MIN
   #error SPLICE_MIN must be lower than SIZE_MIN
@@ -571,6 +574,15 @@ extern "C" unsigned char afl_custom_queue_get(void                *data,
       DEBUGF(stderr, "Too short (%lu) %s\n", len, filename);
       return 1;
 
+    } else
+    if (len > AFL_TXT_MAX_LEN) {
+
+      fclose(fp);
+      file_mapping[fn] = structure;  // NULL ptr so we don't read the file again
+      s = NULL;
+      DEBUGF(stderr, "Too long (%lu) %s\n", len, filename);
+      return 1;
+
     }
 
     string input;
diff --git a/include/config.h b/include/config.h
index f8a742f2..ed8b844c 100644
--- a/include/config.h
+++ b/include/config.h
@@ -489,12 +489,12 @@
 
 /* Minimum length of a queue input to be evaluated for "is_ascii"? */
 
-#define AFL_TXT_MIN_LEN 12
+#define AFL_TXT_MIN_LEN 16
 
 /* What is the minimum percentage of ascii characters present to be classifed
    as "is_ascii"? */
 
-#define AFL_TXT_MIN_PERCENT 95
+#define AFL_TXT_MIN_PERCENT 98
 
 /* How often to perform ASCII mutations 0 = disable, 1-8 are good values */