Electroneum
Loading...
Searching...
No Matches
fuzzer.h File Reference
#include <string>
Include dependency graph for fuzzer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Fuzzer

Functions

int run_fuzzer (int argc, const char **argv, Fuzzer &fuzzer)

Function Documentation

◆ run_fuzzer()

int run_fuzzer ( int argc,
const char ** argv,
Fuzzer & fuzzer )

Definition at line 48 of file fuzzer.cpp.

49{
50 TRY_ENTRY();
51
52 if (argc < 2)
53 {
54 std::cout << "usage: " << argv[0] << " " << "<filename>" << std::endl;
55 return 1;
56 }
57
58#ifdef __AFL_HAVE_MANUAL_CONTROL
59 __AFL_INIT();
60#endif
61
62 int ret = fuzzer.init();
63 if (ret)
64 return ret;
65
66 const std::string filename = argv[1];
67 while (__AFL_LOOP(1000))
68 {
69 ret = fuzzer.run(filename);
70 if (ret)
71 return ret;
72 }
73
74 return 0;
75
76 CATCH_ENTRY_L0("run_fuzzer", 1);
77}
virtual int init()
Definition fuzzer.h:35
virtual int run(const std::string &filename)=0
#define CATCH_ENTRY_L0(lacation, return_val)
#define TRY_ENTRY()
Here is the call graph for this function:
Here is the caller graph for this function: