fix new map size extraction for afl-gcc
MODIFY
afl-cmin
afl-cmin
@@ -291,13 +291,14 @@ BEGIN {
target_bin = tnew
}
+ if (0 == system ( "grep -aq AFL_DUMP_MAP_SIZE" target_bin )) {
+ echo "[!] Trying to obtain the map size of the target ..."
get_map_size = "AFL_DUMP_MAP_SIZE=1 " target_bin
get_map_size | getline mapsize
- if (mapsize && mapsize > 65535) {
-
+ if (mapsize && mapsize > 65535 && mapsize < 100000000) {
AFL_MAP_SIZE = "AFL_MAP_SIZE="mapsize" "
print "[+] Setting "AFL_MAP_SIZE
-
+ }
}
if (!ENVIRON["AFL_SKIP_BIN_CHECK"] && !qemu_mode && !frida_mode && !unicorn_mode) {

MODIFY
afl-cmin.bash
afl-cmin.bash
@@ -215,11 +215,14 @@ 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

fix new map size extraction for afl-gcc