about summary refs log tree commit diff
path: root/afl-cmin.bash
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-08-25 15:56:36 +0200
committerGitHub <noreply@github.com>2022-08-25 15:56:36 +0200
commit413e68ab6d588b12976c5ff34e1a27eae48c26d8 (patch)
tree24ac9dc2eb3bf5c3f114e9e0abb52729f893b8ed /afl-cmin.bash
parent3e2986dd78dbc45035b47a34eedd7dd1b9a4d0b3 (diff)
parenteb5a914ef670d43cc41ce130edb4e0586d97e278 (diff)
downloadafl++-413e68ab6d588b12976c5ff34e1a27eae48c26d8.tar.gz
Merge pull request #1499 from AFLplusplus/dev
push to stable
Diffstat (limited to 'afl-cmin.bash')
-rwxr-xr-xafl-cmin.bash9
1 files changed, 9 insertions, 0 deletions
diff --git a/afl-cmin.bash b/afl-cmin.bash
index 9ac65199..d2218cd0 100755
--- a/afl-cmin.bash
+++ b/afl-cmin.bash
@@ -215,6 +215,15 @@ if [ ! -f "$TARGET_BIN" -o ! -x "$TARGET_BIN" ]; then
 
 fi
 
+grep -aq AFL_DUMP_MAP_SIZE "./$TARGET_BIN" && {
+  echo "[!] Trying to obtain the map size of the target ..."
+  MAPSIZE=`AFL_DUMP_MAP_SIZE=1 "./$TARGET_BIN" 2>/dev/null`
+  test -n "$MAPSIZE" && {
+    export AFL_MAP_SIZE=$MAPSIZE
+    echo "[+] Setting AFL_MAP_SIZE=$MAPSIZE"
+  }
+}
+
 if [ "$AFL_SKIP_BIN_CHECK" = "" -a "$QEMU_MODE" = "" -a "$FRIDA_MODE" = "" -a "$UNICORN_MODE" = "" ]; then
 
   if ! grep -qF "__AFL_SHM_ID" "$TARGET_BIN"; then