forked from bitcoinfuzz/bitcoinfuzz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
19 lines (16 loc) · 650 Bytes
/
main.cpp
File metadata and controls
19 lines (16 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <bitcoinfuzz/module_loader.h>
static std::shared_ptr<bitcoinfuzz::Driver> driver = nullptr;
static bitcoinfuzz::ModuleLogger module_logger;
static const char *g_target = nullptr;
extern "C" int LLVMFuzzerInitialize([[maybe_unused]] int *argc,
[[maybe_unused]] char ***argv) {
bitcoinfuzz::InitializeRegistry();
g_target = std::getenv("FUZZ");
driver = std::make_shared<bitcoinfuzz::Driver>(module_logger);
bitcoinfuzz::LoadModules(driver, module_logger);
return 0;
}
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
driver->Run(Data, Size, g_target);
return 0;
}