mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 03:18:07 +00:00
persistent replay env setup
This commit is contained in:
@ -390,7 +390,7 @@ typedef struct afl_env_vars {
|
|||||||
*afl_hang_tmout, *afl_forksrv_init_tmout, *afl_skip_crashes, *afl_preload,
|
*afl_hang_tmout, *afl_forksrv_init_tmout, *afl_skip_crashes, *afl_preload,
|
||||||
*afl_max_det_extras, *afl_statsd_host, *afl_statsd_port,
|
*afl_max_det_extras, *afl_statsd_host, *afl_statsd_port,
|
||||||
*afl_crash_exitcode, *afl_statsd_tags_flavor, *afl_testcache_size,
|
*afl_crash_exitcode, *afl_statsd_tags_flavor, *afl_testcache_size,
|
||||||
*afl_testcache_entries, *afl_kill_signal;
|
*afl_testcache_entries, *afl_kill_signal, *afl_persistent_replay;
|
||||||
|
|
||||||
} afl_env_vars_t;
|
} afl_env_vars_t;
|
||||||
|
|
||||||
|
@ -123,6 +123,7 @@ static char *afl_environment_variables[] = {
|
|||||||
"AFL_MAX_DET_EXTRAS",
|
"AFL_MAX_DET_EXTRAS",
|
||||||
"AFL_PATH",
|
"AFL_PATH",
|
||||||
"AFL_PERFORMANCE_FILE",
|
"AFL_PERFORMANCE_FILE",
|
||||||
|
"AFL_PERSISTEN_REPLAY",
|
||||||
"AFL_PRELOAD",
|
"AFL_PRELOAD",
|
||||||
"AFL_PYTHON_MODULE",
|
"AFL_PYTHON_MODULE",
|
||||||
"AFL_QEMU_COMPCOV",
|
"AFL_QEMU_COMPCOV",
|
||||||
|
@ -55,6 +55,9 @@ typedef struct afl_forkserver {
|
|||||||
u32 init_tmout; /* Configurable init timeout (ms) */
|
u32 init_tmout; /* Configurable init timeout (ms) */
|
||||||
u32 map_size; /* map size used by the target */
|
u32 map_size; /* map size used by the target */
|
||||||
u32 snapshot; /* is snapshot feature used */
|
u32 snapshot; /* is snapshot feature used */
|
||||||
|
u32 persistent_replay; /* persistent replay setting */
|
||||||
|
u32 persistent_replay_idx; /* persistent replay cache ptr */
|
||||||
|
u32 persistent_replay_cnt; /* persistent replay counter */
|
||||||
u64 mem_limit; /* Memory cap for child (MB) */
|
u64 mem_limit; /* Memory cap for child (MB) */
|
||||||
|
|
||||||
u64 total_execs; /* How often run_target was called */
|
u64 total_execs; /* How often run_target was called */
|
||||||
|
@ -126,7 +126,7 @@ void afl_fsrv_init_dup(afl_forkserver_t *fsrv_to, afl_forkserver_t *from) {
|
|||||||
fsrv_to->last_run_timed_out = 0;
|
fsrv_to->last_run_timed_out = 0;
|
||||||
|
|
||||||
fsrv_to->init_child_func = from->init_child_func;
|
fsrv_to->init_child_func = from->init_child_func;
|
||||||
// Note: do not copy ->add_extra_func
|
// Note: do not copy ->add_extra_func or ->persistent_replay*
|
||||||
|
|
||||||
list_append(&fsrv_list, fsrv_to);
|
list_append(&fsrv_list, fsrv_to);
|
||||||
|
|
||||||
|
@ -292,6 +292,13 @@ void read_afl_environment(afl_state_t *afl, char **envp) {
|
|||||||
afl->afl_env.afl_autoresume =
|
afl->afl_env.afl_autoresume =
|
||||||
get_afl_env(afl_environment_variables[i]) ? 1 : 0;
|
get_afl_env(afl_environment_variables[i]) ? 1 : 0;
|
||||||
|
|
||||||
|
} else if (!strncmp(env, "AFL_PERSISTENT_REPLAY",
|
||||||
|
|
||||||
|
afl_environment_variable_len)) {
|
||||||
|
|
||||||
|
afl->afl_env.afl_persistent_replay =
|
||||||
|
get_afl_env(afl_environment_variables[i]);
|
||||||
|
|
||||||
} else if (!strncmp(env, "AFL_CYCLE_SCHEDULES",
|
} else if (!strncmp(env, "AFL_CYCLE_SCHEDULES",
|
||||||
|
|
||||||
afl_environment_variable_len)) {
|
afl_environment_variable_len)) {
|
||||||
|
@ -1239,6 +1239,12 @@ int main(int argc, char **argv_orig, char **envp) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (afl->afl_env.afl_persistent_replay) {
|
||||||
|
|
||||||
|
afl->fsrv.persistent_replay = atoi(afl->afl_env.afl_persistent_replay);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (afl->afl_env.afl_crash_exitcode) {
|
if (afl->afl_env.afl_crash_exitcode) {
|
||||||
|
|
||||||
long exitcode = strtol(afl->afl_env.afl_crash_exitcode, NULL, 10);
|
long exitcode = strtol(afl->afl_env.afl_crash_exitcode, NULL, 10);
|
||||||
|
Reference in New Issue
Block a user