mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-14 11:08:06 +00:00
fix errors in last commit (u8)afl_get_env
This commit is contained in:
@ -304,12 +304,10 @@ 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_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,
|
||||
|
@ -1,2 +1,3 @@
|
||||
|
||||
extern char *afl_environment_variables[];
|
||||
|
||||
|
@ -147,98 +147,98 @@ void read_afl_environment(afl_state_t *afl, char **envp) {
|
||||
if (strncmp(env, "AFL_SKIP_CPUFREQ",
|
||||
strlen(afl_environment_variables[i]) == 0)) {
|
||||
|
||||
afl->afl_env.afl_skip_cpufreq = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_skip_cpufreq = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_EXIT_WHEN_DONE",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_exit_when_done = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_exit_when_done = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_NO_AFFINITY",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_no_affinity = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_no_affinity = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_SKIP_CRASHES",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_skip_crashes = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_skip_crashes = (u8 *)get_afl_env(env);
|
||||
|
||||
} else if (!strncmp(env, "AFL_HANG_TMOUT",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_hang_tmout = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_hang_tmout = (u8 *)get_afl_env(env);
|
||||
|
||||
} else if (!strncmp(env, "AFL_SKIP_BIN_CHECK",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_skip_bin_check = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_skip_bin_check = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_DUMB_FORKSRV",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_dumb_forksrv = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_dumb_forksrv = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_IMPORT_FIRST",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_import_first = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_import_first = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_CUSTOM_MUTATOR_ONLY",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_custom_mutator_only = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_custom_mutator_only = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_NO_UI",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_no_ui = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_no_ui = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_FORCE_UI",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_force_ui = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_force_ui = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_i_dont_care_about_missing_crashes =
|
||||
(u8)get_afl_env(env);
|
||||
get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_BENCH_JUST_ONE",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_bench_just_one = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_bench_just_one = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_BENCH_UNTIL_CRASH",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_bench_until_crash = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_bench_until_crash = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_DEBUG_CHILD_OUTPUT",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_debug_child_output = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_debug_child_output = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_AUTORESUME",
|
||||
|
||||
strlen(afl_environment_variables[i]))) {
|
||||
|
||||
afl->afl_env.afl_autoresume = (u8)get_afl_env(env);
|
||||
afl->afl_env.afl_autoresume = get_afl_env(env) ? 1 : 0;
|
||||
|
||||
} else if (!strncmp(env, "AFL_TMPDIR",
|
||||
|
||||
|
@ -347,9 +347,9 @@ void show_stats(afl_state_t *afl) {
|
||||
|
||||
/* Lord, forgive me this. */
|
||||
|
||||
SAYF(SET_G1 bSTG bLT bH bSTOP cCYA
|
||||
SAYF(SET_G1 bSTG bLT bH bSTOP cCYA
|
||||
" process timing " bSTG bH30 bH5 bH bHB bH bSTOP cCYA
|
||||
" overall results " bSTG bH2 bH2 bRT "\n");
|
||||
" overall results " bSTG bH2 bH2 bRT "\n");
|
||||
|
||||
if (afl->dumb_mode) {
|
||||
|
||||
@ -429,9 +429,9 @@ void show_stats(afl_state_t *afl) {
|
||||
" uniq hangs : " cRST "%-6s" bSTG bV "\n",
|
||||
DTD(cur_ms, afl->last_hang_time), tmp);
|
||||
|
||||
SAYF(bVR bH bSTOP cCYA
|
||||
SAYF(bVR bH bSTOP cCYA
|
||||
" cycle progress " bSTG bH10 bH5 bH2 bH2 bHB bH bSTOP cCYA
|
||||
" map coverage " bSTG bH bHT bH20 bH2 bVL "\n");
|
||||
" map coverage " bSTG bH bHT bH20 bH2 bVL "\n");
|
||||
|
||||
/* This gets funny because we want to print several variable-length variables
|
||||
together, but then cram them into a fixed-width field - so we need to
|
||||
@ -460,9 +460,9 @@ void show_stats(afl_state_t *afl) {
|
||||
|
||||
SAYF(bSTOP " count coverage : " cRST "%-21s" bSTG bV "\n", tmp);
|
||||
|
||||
SAYF(bVR bH bSTOP cCYA
|
||||
SAYF(bVR bH bSTOP cCYA
|
||||
" stage progress " bSTG bH10 bH5 bH2 bH2 bX bH bSTOP cCYA
|
||||
" findings in depth " bSTG bH10 bH5 bH2 bH2 bVL "\n");
|
||||
" findings in depth " bSTG bH10 bH5 bH2 bH2 bVL "\n");
|
||||
|
||||
sprintf(tmp, "%s (%0.02f%%)", DI(afl->queued_favored),
|
||||
((double)afl->queued_favored) * 100 / afl->queued_paths);
|
||||
@ -533,7 +533,7 @@ void show_stats(afl_state_t *afl) {
|
||||
|
||||
/* Aaaalmost there... hold on! */
|
||||
|
||||
SAYF(bVR bH cCYA bSTOP
|
||||
SAYF(bVR bH cCYA bSTOP
|
||||
" fuzzing strategy yields " bSTG bH10 bHT bH10 bH5 bHB bH bSTOP cCYA
|
||||
" path geometry " bSTG bH5 bH2 bVL "\n");
|
||||
|
||||
|
@ -139,7 +139,7 @@ static void usage(afl_state_t *afl, u8 *argv0, int more_help) {
|
||||
|
||||
"Other stuff:\n"
|
||||
" -T text - text banner to show on the screen\n"
|
||||
" -M / -S id - distributed mode (see parallel_fuzzing.md)\n"
|
||||
" -M / -S id - distributed mode (see docs/parallel_fuzzing.md)\n"
|
||||
" -I command - execute this command/script when a new crash is "
|
||||
"found\n"
|
||||
" -B bitmap.txt - mutate a specific test case, use the out/fuzz_bitmap "
|
||||
|
Reference in New Issue
Block a user