diff options
author | van Hauser <vh@thc.org> | 2021-12-09 11:55:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-09 11:55:36 +0100 |
commit | 08ca4d54a55fe73e64a994c41a12af61f52e497e (patch) | |
tree | 2d0f060cf98afbe80f5bf810fd6b167a5152be81 /custom_mutators/libfuzzer | |
parent | 773baf9391ff5f1793deb7968366819e7fa07adc (diff) | |
parent | 4c6d94ea5f854071277ed9729de2d4ef7d07cc84 (diff) | |
download | afl++-08ca4d54a55fe73e64a994c41a12af61f52e497e.tar.gz |
Merge pull request #1101 from AFLplusplus/dev
Dev
Diffstat (limited to 'custom_mutators/libfuzzer')
-rw-r--r-- | custom_mutators/libfuzzer/FuzzerLoop.cpp | 1 | ||||
-rw-r--r-- | custom_mutators/libfuzzer/README.md | 4 | ||||
-rw-r--r-- | custom_mutators/libfuzzer/libfuzzer.inc | 4 |
3 files changed, 6 insertions, 3 deletions
diff --git a/custom_mutators/libfuzzer/FuzzerLoop.cpp b/custom_mutators/libfuzzer/FuzzerLoop.cpp index 08fda520..6716dbf5 100644 --- a/custom_mutators/libfuzzer/FuzzerLoop.cpp +++ b/custom_mutators/libfuzzer/FuzzerLoop.cpp @@ -1086,6 +1086,7 @@ ATTRIBUTE_INTERFACE size_t LLVMFuzzerMutate(uint8_t *Data, size_t Size, size_t MaxSize) { assert(fuzzer::F); + fuzzer::F->GetMD().StartMutationSequence(); size_t r = fuzzer::F->GetMD().DefaultMutate(Data, Size, MaxSize); #ifdef INTROSPECTION introspection_ptr = fuzzer::F->GetMD().WriteMutationSequence(); diff --git a/custom_mutators/libfuzzer/README.md b/custom_mutators/libfuzzer/README.md index fb3025f2..cb4773b7 100644 --- a/custom_mutators/libfuzzer/README.md +++ b/custom_mutators/libfuzzer/README.md @@ -11,9 +11,11 @@ Note that this is currently a simple implementation and it is missing two featur * Dictionary support To update the source, all that is needed is that FuzzerDriver.cpp has to receive + ``` #include "libfuzzer.inc" ``` + before the closing namespace bracket. It is also libfuzzer.inc where the configuration of the libfuzzer mutations @@ -21,4 +23,4 @@ are done. > Original repository: https://github.com/llvm/llvm-project > Path: compiler-rt/lib/fuzzer/*.{h|cpp} -> Source commit: df3e903655e2499968fc7af64fb5fa52b2ee79bb +> Source commit: df3e903655e2499968fc7af64fb5fa52b2ee79bb \ No newline at end of file diff --git a/custom_mutators/libfuzzer/libfuzzer.inc b/custom_mutators/libfuzzer/libfuzzer.inc index 01f21dbe..8c4bdbf6 100644 --- a/custom_mutators/libfuzzer/libfuzzer.inc +++ b/custom_mutators/libfuzzer/libfuzzer.inc @@ -2,7 +2,7 @@ extern "C" ATTRIBUTE_INTERFACE void LLVMFuzzerMyInit(int (*Callback)(const uint8_t *Data, size_t Size), unsigned int Seed) { - Random Rand(Seed); + auto *Rand = new Random(Seed); FuzzingOptions Options; Options.Verbosity = 3; Options.MaxLen = 1024000; @@ -30,7 +30,7 @@ LLVMFuzzerMyInit(int (*Callback)(const uint8_t *Data, size_t Size), unsigned int struct EntropicOptions Entropic; Entropic.Enabled = Options.Entropic; EF = new ExternalFunctions(); - auto *MD = new MutationDispatcher(Rand, Options); + auto *MD = new MutationDispatcher(*Rand, Options); auto *Corpus = new InputCorpus(Options.OutputCorpus, Entropic); auto *F = new Fuzzer(Callback, *Corpus, *MD, Options); } |