about summary refs log tree commit diff
path: root/instrumentation/README.persistent_mode.md
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-11-30 13:03:33 +0100
committervan Hauser <vh@thc.org>2020-11-30 13:03:33 +0100
commit63c317218bfe1ffc91443a2620c653581aff0ba1 (patch)
tree70a4efbd65645b154a1648f74196b66afe3e45c8 /instrumentation/README.persistent_mode.md
parentaff4ccb0b2324259554537983e9261e48cccf275 (diff)
downloadafl++-63c317218bfe1ffc91443a2620c653581aff0ba1.tar.gz
persistent_demo -> persistent_mode
Diffstat (limited to 'instrumentation/README.persistent_mode.md')
-rw-r--r--instrumentation/README.persistent_mode.md9
1 files changed, 7 insertions, 2 deletions
diff --git a/instrumentation/README.persistent_mode.md b/instrumentation/README.persistent_mode.md
index e095f036..2fd7027d 100644
--- a/instrumentation/README.persistent_mode.md
+++ b/instrumentation/README.persistent_mode.md
@@ -23,15 +23,20 @@ __AFL_FUZZ_INIT();
 
 main() {
 
+  // anything else here, eg. command line arguments, initialization, etc.
+
 #ifdef __AFL_HAVE_MANUAL_CONTROL
   __AFL_INIT();
 #endif
 
   unsigned char *buf = __AFL_FUZZ_TESTCASE_BUF;  // must be after __AFL_INIT
+                                                 // and before __AFL_LOOP!
 
   while (__AFL_LOOP(10000)) {
 
-    int len = __AFL_FUZZ_TESTCASE_LEN;
+    int len = __AFL_FUZZ_TESTCASE_LEN;  // don't use the macro directly in a
+                                        // call!
+
     if (len < 8) continue;  // check for a required/useful minimum input length
 
     /* Setup function call, e.g. struct target *tmp = libtarget_init() */
@@ -169,7 +174,7 @@ the impact of memory leaks and similar glitches; 1000 is a good starting point,
 and going much higher increases the likelihood of hiccups without giving you
 any real performance benefits.
 
-A more detailed template is shown in ../examples/persistent_demo/.
+A more detailed template is shown in ../examples/persistent_mode/.
 Similarly to the previous mode, the feature works only with afl-clang-fast; #ifdef
 guards can be used to suppress it when using other compilers.