fix and update libfuzzer custom mutator

This commit is contained in:
van Hauser
2020-09-21 15:47:10 +02:00
parent f34fe1f81e
commit 207cbd5cf7
14 changed files with 387 additions and 73 deletions

View File

@ -77,7 +77,7 @@ struct {
} Flags;
static const FlagDescription FlagDescriptions[]{
\
#define FUZZER_DEPRECATED_FLAG(Name) \
{#Name, "Deprecated; don't use", 0, nullptr, nullptr, nullptr},
#define FUZZER_FLAG_INT(Name, Default, Description) \
@ -941,23 +941,12 @@ int FuzzerDriver(int *argc, char ***argv, UserCallback Callback) {
Options.EntropicNumberOfRarestFeatures =
(size_t)Flags.entropic_number_of_rarest_features;
Options.EntropicScalePerExecTime = Flags.entropic_scale_per_exec_time;
if (Options.Entropic) {
if (!Options.FocusFunction.empty()) {
Printf(
"ERROR: The parameters `--entropic` and `--focus_function` cannot "
"be used together.\n");
exit(1);
}
if (!Options.FocusFunction.empty())
Options.Entropic = false; // FocusFunction overrides entropic scheduling.
if (Options.Entropic)
Printf("INFO: Running with entropic power schedule (0x%X, %d).\n",
Options.EntropicFeatureFrequencyThreshold,
Options.EntropicNumberOfRarestFeatures);
}
struct EntropicOptions Entropic;
Entropic.Enabled = Options.Entropic;
Entropic.FeatureFrequencyThreshold =