about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-03-24 18:19:13 +0100
committerGitHub <noreply@github.com>2021-03-24 18:19:13 +0100
commit6e2a0ef233fc09e8751e2d4cba3298610d8bed2c (patch)
tree0c04cd932d129b45e31fd17c328844295677ca5f /include
parent7dc48478698ba73eeb045af3ca25e4a62e68b359 (diff)
parent958436be4ba057e8409787e7ff4ddcfa095c46da (diff)
downloadafl++-6e2a0ef233fc09e8751e2d4cba3298610d8bed2c.tar.gz
Merge branch 'replay' into tmp
Diffstat (limited to 'include')
-rw-r--r--include/afl-fuzz.h2
-rw-r--r--include/config.h9
-rw-r--r--include/envs.h1
-rw-r--r--include/forkserver.h9
4 files changed, 20 insertions, 1 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index 565e9afd..691ba148 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -390,7 +390,7 @@ typedef struct afl_env_vars {
       *afl_hang_tmout, *afl_forksrv_init_tmout, *afl_skip_crashes, *afl_preload,
       *afl_max_det_extras, *afl_statsd_host, *afl_statsd_port,
       *afl_crash_exitcode, *afl_statsd_tags_flavor, *afl_testcache_size,
-      *afl_testcache_entries, *afl_kill_signal, *afl_target_env;
+      *afl_testcache_entries, *afl_kill_signal, *afl_target_env, *afl_persistent_record;
 
 } afl_env_vars_t;
 
diff --git a/include/config.h b/include/config.h
index 8ac74c45..ab4c49f2 100644
--- a/include/config.h
+++ b/include/config.h
@@ -73,6 +73,15 @@
 
 /* Now non-cmplog configuration options */
 
+
+/* If a persistent target keeps state and found crashes are not reproducable
+   then enable this option and set the AFL_PERSISTENT_RECORD env variable
+   to a number. These number of testcases prior the crash will be kept and
+   also written to the crash/ directory */
+
+#define AFL_PERSISTENT_RECORD
+
+
 /* console output colors: There are three ways to configure its behavior
  * 1. default: colored outputs fixed on: defined USE_COLOR && defined
  * ALWAYS_COLORED The env var. AFL_NO_COLOR will have no effect
diff --git a/include/envs.h b/include/envs.h
index d7578045..37adeff2 100644
--- a/include/envs.h
+++ b/include/envs.h
@@ -130,6 +130,7 @@ static char *afl_environment_variables[] = {
     "AFL_PASSTHROUGH",
     "AFL_PATH",
     "AFL_PERFORMANCE_FILE",
+    "AFL_PERSISTENT_RECORD",
     "AFL_PRELOAD",
     "AFL_TARGET_ENV",
     "AFL_PYTHON_MODULE",
diff --git a/include/forkserver.h b/include/forkserver.h
index ac027f81..c894ad80 100644
--- a/include/forkserver.h
+++ b/include/forkserver.h
@@ -94,6 +94,15 @@ typedef struct afl_forkserver {
 
   char *cmplog_binary;                  /* the name of the cmplog binary    */
 
+  /* persistent mode replay functionality */
+  u32   persistent_record;              /* persistent replay setting        */
+  u32   persistent_record_idx;          /* persistent replay cache ptr      */
+  u32   persistent_record_cnt;          /* persistent replay counter        */
+  u8 *  persistent_record_dir;
+  u8 ** persistent_record_data;
+  u32 * persistent_record_len;
+  s32   persistent_record_pid;
+
   /* Function to kick off the forkserver child */
   void (*init_child_func)(struct afl_forkserver *fsrv, char **argv);