afl-cmin bugfix if -o exists
MODIFY
afl-cmin
afl-cmin
@@ -287,7 +287,8 @@ BEGIN {
system("rm -rf "trace_dir" 2>/dev/null");
system("rm "out_dir"/id[:_]* 2>/dev/null")
- if (0 == system( "test -d "out_dir" -a -e "out_dir"/*" )) {
+ "ls "out_dir"/* 2>/dev/null | wc -l" | getline noofentries
+ if (0 == system( "test -d "out_dir" -a "noofentries" -gt 0" )) {
print "[-] Error: directory '"out_dir"' exists and is not empty - delete it first." > "/dev/stderr"
exit 1
}
@@ -392,10 +393,10 @@ BEGIN {
cur = 0;
if (!stdin_file) {
- printf " Processing "in_count" files (forkserver mode)..."
+ print " Processing "in_count" files (forkserver mode)..."
system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"\" -Z "extra_par" -i \""in_dir"\" -- \""target_bin"\" "prog_args_string)
} else {
- printf " Processing "in_count" files (forkserver mode)..."
+ print " Processing "in_count" files (forkserver mode)..."
system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"\" -Z "extra_par" -i \""in_dir"\" -- \""target_bin"\" "prog_args_string" </dev/null")
}

afl-cmin bugfix if -o exists