about summary refs log tree commit diff
path: root/afl-cmin.bash
diff options
context:
space:
mode:
Diffstat (limited to 'afl-cmin.bash')
-rwxr-xr-xafl-cmin.bash11
1 files changed, 7 insertions, 4 deletions
diff --git a/afl-cmin.bash b/afl-cmin.bash
index db3e8ae5..d2218cd0 100755
--- a/afl-cmin.bash
+++ b/afl-cmin.bash
@@ -215,10 +215,13 @@ if [ ! -f "$TARGET_BIN" -o ! -x "$TARGET_BIN" ]; then
 
 fi
 
-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"
+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