about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWorksButNotTested <62701594+WorksButNotTested@users.noreply.github.com>2021-07-05 10:28:39 +0100
committerGitHub <noreply@github.com>2021-07-05 11:28:39 +0200
commitdcf450ecba2f3ad8ed00c02a00b84da97e14df77 (patch)
tree728ee8ba17c44d74ad696d4d12b3fb4094aa4a5e
parent886e2ba7702b2354243daaae81e2fd325d01f5d4 (diff)
downloadafl++-dcf450ecba2f3ad8ed00c02a00b84da97e14df77.tar.gz
Changes to automatically disable optimization when AFL_FRIDA_INST_TRACE is set (#1003)
Co-authored-by: Your Name <you@example.com>
-rw-r--r--frida_mode/README.md2
-rw-r--r--frida_mode/src/instrument/instrument.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/frida_mode/README.md b/frida_mode/README.md
index 6bed52b7..c85cf3af 100644
--- a/frida_mode/README.md
+++ b/frida_mode/README.md
@@ -160,7 +160,7 @@ instrumentation (the default where available). Required to use
 report instrumented blocks back to the parent so that it can also instrument
 them and they be inherited by the next child on fork.
 * `AFL_FRIDA_INST_TRACE` - Log to stdout the address of executed blocks,
-requires `AFL_FRIDA_INST_NO_OPTIMIZE`.
+implies `AFL_FRIDA_INST_NO_OPTIMIZE`.
 * `AFL_FRIDA_INST_TRACE_UNIQUE` - As per `AFL_FRIDA_INST_TRACE`, but each edge
 is logged only once, requires `AFL_FRIDA_INST_NO_OPTIMIZE`.
 * `AFL_FRIDA_OUTPUT_STDOUT` - Redirect the standard output of the target
diff --git a/frida_mode/src/instrument/instrument.c b/frida_mode/src/instrument/instrument.c
index 2a217d96..c646843c 100644
--- a/frida_mode/src/instrument/instrument.c
+++ b/frida_mode/src/instrument/instrument.c
@@ -214,13 +214,15 @@ void instrument_init(void) {
 
   if (instrument_tracing && instrument_optimize) {
 
-    FATAL("AFL_FRIDA_INST_TRACE requires AFL_FRIDA_INST_NO_OPTIMIZE");
+    WARNF("AFL_FRIDA_INST_TRACE implies AFL_FRIDA_INST_NO_OPTIMIZE");
+    instrument_optimize = FALSE;
 
   }
 
   if (instrument_unique && instrument_optimize) {
 
-    FATAL("AFL_FRIDA_INST_TRACE_UNIQUE requires AFL_FRIDA_INST_NO_OPTIMIZE");
+    WARNF("AFL_FRIDA_INST_TRACE_UNIQUE implies AFL_FRIDA_INST_NO_OPTIMIZE");
+    instrument_optimize = FALSE;
 
   }