#include "FuzzerInterface.h"
namespace fuzzer {
-typedef std::vector<uint8_t> Unit;
using namespace std::chrono;
std::string FileToString(const std::string &Path);
void Printf(const char *Fmt, ...);
void Print(const Unit &U, const char *PrintAfter = "");
+void PrintASCII(const uint8_t *Data, size_t Size, const char *PrintAfter = "");
void PrintASCII(const Unit &U, const char *PrintAfter = "");
std::string Hash(const Unit &U);
void SetTimer(int Seconds);
-void PrintFileAsBase64(const std::string &Path);
+std::string Base64(const Unit &U);
int ExecuteCommand(const std::string &Command);
// Private copy of SHA1 implementation.
int SyncTimeout = 600;
int ReportSlowUnits = 10;
bool OnlyASCII = false;
- int TBMDepth = 10;
- int TBMWidth = 10;
std::string OutputCorpus;
std::string SyncCommand;
std::string ArtifactPrefix = "./";
+ std::string ExactArtifactPath;
bool SaveArtifacts = true;
bool PrintNEW = true; // Print a status line when new units are found;
bool OutputCSV = false;
+ bool PrintNewCovPcs = false;
};
Fuzzer(UserSuppliedFuzzer &USF, FuzzingOptions Options);
void AddToCorpus(const Unit &U) { Corpus.push_back(U); }
private:
void AlarmCallback();
- void MutateAndTestOne(Unit *U);
+ void MutateAndTestOne();
void ReportNewCoverage(const Unit &U);
bool RunOne(const Unit &U);
void RunOneAndUpdateCorpus(Unit &U);
// Start tracing; forget all previously proposed mutations.
void StartTraceRecording();
- // Stop tracing and return the number of proposed mutations.
- size_t StopTraceRecording();
- // Apply Idx-th trace-based mutation to U.
- void ApplyTraceBasedMutation(size_t Idx, Unit *U);
+ // Stop tracing.
+ void StopTraceRecording();
void SetDeathCallback();
static void StaticDeathCallback();
long EpochOfLastReadOfOutputCorpus = 0;
size_t LastRecordedBlockCoverage = 0;
size_t LastRecordedCallerCalleeCoverage = 0;
+ size_t LastCoveragePcBufferLen = 0;
};
class SimpleUserSuppliedFuzzer: public UserSuppliedFuzzer {