Electroneum
fuzzer.cpp File Reference
#include <boost/program_options.hpp>
#include "include_base_utils.h"
#include "string_tools.h"
#include "common/command_line.h"
#include "common/util.h"
#include "fuzzer.h"
Include dependency graph for fuzzer.cpp:

Go to the source code of this file.

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 }
::std::string string
Definition: gtest-port.h:1097
virtual int init()
Definition: fuzzer.h:35
#define TRY_ENTRY()
Definition: misc_log_ex.h:151
virtual int run(const std::string &filename)=0
#define CATCH_ENTRY_L0(lacation, return_val)
Definition: misc_log_ex.h:165
Here is the call graph for this function:
Here is the caller graph for this function: