From 126d1f1cd14c6bb1fb59159965045f02d98d1b43 Mon Sep 17 00:00:00 2001 From: Rishi Ranjan <43873720+rish9101@users.noreply.github.com> Date: Sun, 15 Mar 2020 22:59:23 +0530 Subject: Move afl-fuzz related env variables into afl_state_t (#252) * Move afl-fuzz related env variables into afl_state_t * Move the env variables assignment from fuzz_init and code Format * Fix typo * Remove redundant env variables from afl_env struct * Rename function to read_afl_environment --- include/afl-fuzz.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/afl-fuzz.h') diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h index 895ca34e..fe3926a7 100644 --- a/include/afl-fuzz.h +++ b/include/afl-fuzz.h @@ -302,6 +302,21 @@ typedef struct MOpt_globals { extern char *power_names[POWER_SCHEDULES_NUM]; +typedef struct afl_env_vars { + + u8 afl_skip_cpufreq, afl_exit_when_done, afl_no_affinity, + afl_skip_bin_check, afl_dumb_forksrv, + afl_import_first, afl_custom_mutator_only, + afl_no_ui, afl_force_ui, afl_i_dont_care_about_missing_crashes, + afl_bench_just_one, afl_bench_until_crash, afl_debug_child_output, + afl_autoresume; + + u8 *afl_tmpdir, *afl_post_library, *afl_custom_mutator_library, + *afl_python_module, *afl_path, *afl_hang_tmout, *afl_skip_crashes, + *afl_preload; + +} afl_env_vars_t; + typedef struct afl_state { /* Position of this state in the global states list */ @@ -309,6 +324,7 @@ typedef struct afl_state { afl_forkserver_t fsrv; sharedmem_t shm; + afl_env_vars_t afl_env; char **argv; /* argv if needed */ @@ -704,6 +720,7 @@ struct custom_mutator { void afl_state_init(afl_state_t *); void afl_state_deinit(afl_state_t *); +void read_afl_environment(afl_state_t *, char **); /**** Prototypes ****/ -- cgit 1.4.1