about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2019-09-17 02:11:34 +0200
committerAndrea Fioraldi <andreafioraldi@gmail.com>2019-09-17 02:11:34 +0200
commit61b0a3775b8695cf53d8e367b9408add1f37d4e6 (patch)
tree86a1281635777eb9fbcde6ea07a85d591e60dd6d
parent5f5096417675fc1f492d128f2bab097c0c1f7ce7 (diff)
downloadafl++-61b0a3775b8695cf53d8e367b9408add1f37d4e6.tar.gz
code start and end in qemu env vars
-rw-r--r--qemu_mode/patches/afl-qemu-cpu-inl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/qemu_mode/patches/afl-qemu-cpu-inl.h b/qemu_mode/patches/afl-qemu-cpu-inl.h
index 13ec4fc8..9933be5c 100644
--- a/qemu_mode/patches/afl-qemu-cpu-inl.h
+++ b/qemu_mode/patches/afl-qemu-cpu-inl.h
@@ -181,6 +181,11 @@ static void afl_setup(void) {
     afl_end_code = (abi_ulong)-1;
 
   }
+  
+  if (getemv("AFL_CODE_START"))
+    afl_start_code = strtoll(getenv("AFL_CODE_START"), NULL, 16);
+  if (getemv("AFL_CODE_END"))
+    afl_end_code = strtoll(getenv("AFL_CODE_END"), NULL, 16);
 
   /* Maintain for compatibility */
   if (getenv("AFL_QEMU_COMPCOV")) { afl_compcov_level = 1; }