diff options
-rwxr-xr-x | afl-cmin | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/afl-cmin b/afl-cmin index de5a66ed..865809e1 100755 --- a/afl-cmin +++ b/afl-cmin @@ -292,6 +292,24 @@ BEGIN { exit 1 } + # Check for the more efficient way to copy files... + if (0 != system("mkdir -p -m 0700 "trace_dir)) { + print "[-] Error: Cannot create directory "trace_dir > "/dev/stderr" + exit 1 + } + if (0 != system("mkdir -p -m 0700 "trace_dir"/.state/auto_extras")) { + print "[-] Error: Cannot create directory "trace_dir"/.state/auto_extras" > "/dev/stderr" + exit 1 + } + if (0 != system("mkdir -p -m 0700 "trace_dir"/.state/redundant_edges")) { + print "[-] Error: Cannot create directory "trace_dir"/.state/redundant_edges" > "/dev/stderr" + exit 1 + } + if (0 != system("mkdir -p -m 0700 "trace_dir"/.state/deterministic_done")) { + print "[-] Error: Cannot create directory "trace_dir"/.state/deterministic_done" > "/dev/stderr" + exit 1 + } + if (stdin_file) { # truncate input file printf "" > stdin_file @@ -339,12 +357,6 @@ BEGIN { exit 1 } - # Check for the more efficient way to copy files... - if (0 != system("mkdir -p -m 0700 "trace_dir)) { - print "[-] Error: Cannot create directory "trace_dir > "/dev/stderr" - exit 1 - } - if (0 == system("ln "in_dir"/"first_file" "trace_dir"/.link_test")) { cp_tool = "ln" } else { @@ -360,7 +372,7 @@ BEGIN { system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"/.run_test\" -Z "extra_par" -- \""target_bin"\" "prog_args_string" <\""in_dir"/"first_file"\"") } else { system("cp "in_dir"/"first_file" "stdin_file) - system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"/.run_test\" -Z "extra_par" -A \""stdin_file"\" -- \""target_bin"\" "prog_args_string" <dev/null") + system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"/.run_test\" -Z "extra_par" -A \""stdin_file"\" -- \""target_bin"\" "prog_args_string" < /dev/null") } first_count = 0 @@ -402,7 +414,7 @@ BEGIN { ++cur printf "\r Processing file "cur"/"in_count system("cp "in_dir"/"fn" "stdin_file) - system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"/"fn"\" -Z "extra_par" -A \""stdin_file"\" -- \""target_bin"\" "prog_args_string" <dev/null") + system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"/"fn"\" -Z "extra_par" -A \""stdin_file"\" -- \""target_bin"\" "prog_args_string" < /dev/null") } } |