4
0
mirror of https://github.com/QuasarApp/LIEF.git synced 2025-04-28 21:34:32 +00:00
LIEF/fuzzing/macho_fuzzer.cpp

15 lines
433 B
C++
Raw Normal View History

2017-09-28 10:54:37 +02:00
#include <LIEF/LIEF.hpp>
#include <vector>
#include <memory>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
std::vector<uint8_t> raw = {data, data + size};
std::unique_ptr<LIEF::MachO::FatBinary> binaries;
2017-09-28 10:54:37 +02:00
try {
binaries = std::unique_ptr<LIEF::MachO::FatBinary>(LIEF::MachO::Parser::parse(raw));
2017-09-28 10:54:37 +02:00
} catch (const LIEF::exception& e) {
std::cout << e.what() << std::endl;
}
return 0;
}