fuzz_multi.sh 841 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. MEMLIMIT_BYTES=21990500990976
  3. N_CPUS=1
  4. if [ $# -ge 1 ]; then
  5. N_CPUS="$1"
  6. shift
  7. fi
  8. FILTER="echo"
  9. for i in $(seq -w "$N_CPUS"); do
  10. if [ "$i" -eq 1 ]; then
  11. if [ "$N_CPUS" -eq 1 ]; then
  12. INSTANCE=""
  13. NUMBER=""
  14. else
  15. INSTANCE="-M"
  16. NUMBER="$i"
  17. fi
  18. else
  19. INSTANCE="-S"
  20. NUMBER="$i"
  21. fi
  22. # use whatever remains on the command-line to prefix the fuzzer command
  23. # you have to copy and paste and run these commands yourself
  24. "$FILTER" "$@" \
  25. ../afl/afl-fuzz \
  26. -i src/test/fuzz/fuzz_dir_testcase \
  27. -o src/test/fuzz/fuzz_dir_findings \
  28. -x src/test/fuzz/fuzz_dir_dictionary/fuzz_dir_http_header.dct \
  29. -m "$MEMLIMIT_BYTES" \
  30. "$INSTANCE" "$NUMBER" \
  31. -- src/test/fuzz_dir
  32. done