about summary refs log tree commit diff
path: root/src/afl-fuzz-cmplog.c
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-02-06 21:43:50 +0100
committerAndrea Fioraldi <andreafioraldi@gmail.com>2020-02-06 21:43:50 +0100
commite5972efa41c6371a6d1fed14492418ad0a756eae (patch)
tree8db5b5c8afc9e9b2bfd4f294b76e9fae11821320 /src/afl-fuzz-cmplog.c
parent1ece4bb7dfc617dd03a9d416108aade97579a3c1 (diff)
downloadafl++-e5972efa41c6371a6d1fed14492418ad0a756eae.tar.gz
cmplog for qemu mode
Diffstat (limited to 'src/afl-fuzz-cmplog.c')
-rw-r--r--src/afl-fuzz-cmplog.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/afl-fuzz-cmplog.c b/src/afl-fuzz-cmplog.c
index 92bac4ab..69efcffa 100644
--- a/src/afl-fuzz-cmplog.c
+++ b/src/afl-fuzz-cmplog.c
@@ -150,8 +150,10 @@ void init_cmplog_forkserver(char** argv) {
            "msan_track_origins=0",
            0);
 
-    argv[0] = cmplog_binary;
-    execv(cmplog_binary, argv);
+    setenv("___AFL_EINS_ZWEI_POLIZEI___", "1", 1);
+
+    if (!qemu_mode) argv[0] = cmplog_binary;
+    execv(argv[0], argv);
 
     /* Use a distinctive bitmap signature to tell the parent about execv()
        falling through. */
@@ -440,9 +442,11 @@ u8 run_cmplog_target(char** argv, u32 timeout) {
       setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":"
                              "symbolize=0:"
                              "msan_track_origins=0", 0);
+      
+      setenv("___AFL_EINS_ZWEI_POLIZEI___", "1", 1);
 
-      argv[0] = cmplog_binary;
-      execv(cmplog_binary, argv);
+      if (!qemu_mode) argv[0] = cmplog_binary;
+      execv(argv[0], argv);
 
       /* Use a distinctive bitmap value to tell the parent about execv()
          falling through. */