diff options
author | van Hauser <vh@thc.org> | 2020-09-10 15:26:46 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-09-10 15:26:46 +0200 |
commit | 380051868a7531830d94d312f0f11b0e19e3284f (patch) | |
tree | a06cd1b2e2127b2ce2c7de4714fcdccab4a9502e /custom_mutators/libfuzzer/libfuzzer.inc | |
parent | fdb0452245672db94be0832288f1335e905a2fc8 (diff) | |
download | afl++-380051868a7531830d94d312f0f11b0e19e3284f.tar.gz |
add libfuzzer custom mutator, minor enhancements and fixes
Diffstat (limited to 'custom_mutators/libfuzzer/libfuzzer.inc')
-rw-r--r-- | custom_mutators/libfuzzer/libfuzzer.inc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/custom_mutators/libfuzzer/libfuzzer.inc b/custom_mutators/libfuzzer/libfuzzer.inc new file mode 100644 index 00000000..01f21dbe --- /dev/null +++ b/custom_mutators/libfuzzer/libfuzzer.inc @@ -0,0 +1,36 @@ + + +extern "C" ATTRIBUTE_INTERFACE void +LLVMFuzzerMyInit(int (*Callback)(const uint8_t *Data, size_t Size), unsigned int Seed) { + Random Rand(Seed); + FuzzingOptions Options; + Options.Verbosity = 3; + Options.MaxLen = 1024000; + Options.LenControl = true; + Options.DoCrossOver = false; + Options.MutateDepth = 6; + Options.UseCounters = false; + Options.UseMemmem = false; + Options.UseCmp = false; + Options.UseValueProfile = false; + Options.Shrink = false; + Options.ReduceInputs = false; + Options.PreferSmall = false; + Options.ReloadIntervalSec = 0; + Options.OnlyASCII = false; + Options.DetectLeaks = false; + Options.PurgeAllocatorIntervalSec = 0; + Options.TraceMalloc = false; + Options.RssLimitMb = 100; + Options.MallocLimitMb = 100; + Options.MaxNumberOfRuns = 0; + Options.ReportSlowUnits = false; + Options.Entropic = false; + + struct EntropicOptions Entropic; + Entropic.Enabled = Options.Entropic; + EF = new ExternalFunctions(); + auto *MD = new MutationDispatcher(Rand, Options); + auto *Corpus = new InputCorpus(Options.OutputCorpus, Entropic); + auto *F = new Fuzzer(Callback, *Corpus, *MD, Options); +} |