about summary refs log tree commit diff
path: root/qemu_mode/patches/afl-qemu-cpu-inl.h
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-04-28 10:55:22 +0200
committerAndrea Fioraldi <andreafioraldi@gmail.com>2020-04-28 10:55:22 +0200
commit9276dc9e6c8a966c86aeef7ec6ebe6712c302615 (patch)
treeda7cb3949465fd5d684e36258f1e8ec725801491 /qemu_mode/patches/afl-qemu-cpu-inl.h
parentfbd9994f6f959def9c228b81711706bbc5be8cde (diff)
downloadafl++-9276dc9e6c8a966c86aeef7ec6ebe6712c302615.tar.gz
fix #329
Diffstat (limited to 'qemu_mode/patches/afl-qemu-cpu-inl.h')
-rw-r--r--qemu_mode/patches/afl-qemu-cpu-inl.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/qemu_mode/patches/afl-qemu-cpu-inl.h b/qemu_mode/patches/afl-qemu-cpu-inl.h
index 06243141..6e9ddc3b 100644
--- a/qemu_mode/patches/afl-qemu-cpu-inl.h
+++ b/qemu_mode/patches/afl-qemu-cpu-inl.h
@@ -275,20 +275,6 @@ void afl_setup(void) {
 
 }
 
-static void print_mappings(void) {
-
-  u8    buf[MAX_LINE];
-  FILE *f = fopen("/proc/self/maps", "r");
-
-  if (!f) return;
-
-  while (fgets(buf, MAX_LINE, f))
-    printf("%s", buf);
-
-  fclose(f);
-
-}
-
 /* Fork server logic, invoked once we hit _start. */
 
 void afl_forkserver(CPUState *cpu) {
@@ -299,7 +285,7 @@ void afl_forkserver(CPUState *cpu) {
   if (forkserver_installed == 1) return;
   forkserver_installed = 1;
 
-  if (getenv("AFL_QEMU_DEBUG_MAPS")) print_mappings();
+  if (getenv("AFL_QEMU_DEBUG_MAPS")) open_self_maps(cpu->env_ptr, 0);
 
   // if (!afl_area_ptr) return; // not necessary because of fixed dummy buffer