diff options
Diffstat (limited to 'cmdline.c')
-rw-r--r-- | cmdline.c | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -243,8 +243,10 @@ bool cmdlineParse(int argc, char* argv[], honggfuzz_t* hfuzz) { .threads = { .threadsFinished = 0, - .threadsMax = - (sysconf(_SC_NPROCESSORS_ONLN) <= 1) ? 1 : sysconf(_SC_NPROCESSORS_ONLN) / 2, + .threadsMax = ({ + long ncpus = sysconf(_SC_NPROCESSORS_ONLN); + (ncpus <= 1 ? 1 : ncpus / 2); + }), .threadsActiveCnt = 0, .mainThread = pthread_self(), .mainPid = getpid(), @@ -272,6 +274,7 @@ bool cmdlineParse(int argc, char* argv[], honggfuzz_t* hfuzz) { .fuzzStdin = false, .externalCommand = NULL, .postExternalCommand = NULL, + .feedbackMutateCommand = NULL, .persistent = false, .netDriver = false, .asLimit = 0U, @@ -418,6 +421,7 @@ bool cmdlineParse(int argc, char* argv[], honggfuzz_t* hfuzz) { { { "stackhash_bl", required_argument, NULL, 'B' }, "Stackhashes blacklist file (one entry per line)" }, { { "mutate_cmd", required_argument, NULL, 'c' }, "External command producing fuzz files (instead of internal mutators)" }, { { "pprocess_cmd", required_argument, NULL, 0x104 }, "External command postprocessing files produced by internal mutators" }, + { { "ffmutate_cmd", required_argument, NULL, 0x110 }, "External command mutating files which have effective coverage feedback" }, { { "run_time", required_argument, NULL, 0x109 }, "Number of seconds this fuzzing session will last (default: 0 [no limit])" }, { { "iterations", required_argument, NULL, 'N' }, "Number of fuzzing iterations (default: 0 [no limit])" }, { { "rlimit_as", required_argument, NULL, 0x100 }, "Per process RLIMIT_AS in MiB (default: 0 [no limit])" }, @@ -561,7 +565,12 @@ bool cmdlineParse(int argc, char* argv[], honggfuzz_t* hfuzz) { hfuzz->cfg.reportFile = optarg; break; case 'n': - hfuzz->threads.threadsMax = atol(optarg); + if (optarg[0] == 'a') { + long ncpus = sysconf(_SC_NPROCESSORS_ONLN); + hfuzz->threads.threadsMax = (ncpus < 1 ? 1 : ncpus); + } else { + hfuzz->threads.threadsMax = atol(optarg); + } break; case 0x109: { time_t p = atol(optarg); @@ -587,6 +596,9 @@ bool cmdlineParse(int argc, char* argv[], honggfuzz_t* hfuzz) { case 0x104: hfuzz->exe.postExternalCommand = optarg; break; + case 0x110: + hfuzz->exe.feedbackMutateCommand = optarg; + break; case 0x105: if ((strcasecmp(optarg, "0") == 0) || (strcasecmp(optarg, "false") == 0)) { hfuzz->cfg.monitorSIGABRT = false; |