force persistent and deferred also for tools
MODIFY
src/afl-common.c
src/afl-common.c
@@ -63,7 +63,8 @@ u32 check_binary_signatures(u8 *fn) {
if (f_data == MAP_FAILED) { PFATAL("Unable to mmap file '%s'", fn); }
close(fd);
- if (memmem(f_data, f_len, PERSIST_SIG, strlen(PERSIST_SIG) + 1)) {
+ if (memmem(f_data, f_len, PERSIST_SIG, strlen(PERSIST_SIG) + 1) ||
+ getenv(PERSIST_ENV_VAR)) {
if (!be_quiet) { OKF(cPIN "Persistent mode binary detected."); }
setenv(PERSIST_ENV_VAR, "1", 1);
@@ -90,7 +91,8 @@ u32 check_binary_signatures(u8 *fn) {
}
- if (memmem(f_data, f_len, DEFER_SIG, strlen(DEFER_SIG) + 1)) {
+ if (memmem(f_data, f_len, DEFER_SIG, strlen(DEFER_SIG) + 1) ||
+ getenv(DEFER_ENV_VAR)) {
if (!be_quiet) { OKF(cPIN "Deferred forkserver binary detected."); }
setenv(DEFER_ENV_VAR, "1", 1);

MODIFY
src/afl-fuzz-init.c
src/afl-fuzz-init.c
@@ -2830,6 +2830,7 @@ void check_binary(afl_state_t *afl, u8 *fname) {
OKF("FRIDA Persistent mode configuration options detected.");
setenv(PERSIST_ENV_VAR, "1", 1);
afl->persistent_mode = 1;
+ afl->fsrv.persistent_mode = 1;
afl->shmem_testcase_mode = 1;
}

MODIFY
src/afl-fuzz.c
src/afl-fuzz.c
@@ -1912,7 +1912,7 @@ int main(int argc, char **argv_orig, char **envp) {
WARNF(
"Deferred forkserver mode environment variable detected, forcing "
- "defered forkserver!");
+ "deferred forkserver!");
afl->deferred_mode = 1;
}

force persistent and deferred also for tools