2022-06-16 14:30:22 +00:00
|
|
|
#include <string>
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
#include <elfio/elfio.hpp>
|
2022-06-19 14:37:22 +00:00
|
|
|
#include <elfio/elfio_dump.hpp>
|
|
|
|
|
2022-06-16 14:30:22 +00:00
|
|
|
using namespace ELFIO;
|
|
|
|
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput( const uint8_t* Data, size_t Size )
|
|
|
|
{
|
|
|
|
std::string str( (const char*)Data, Size );
|
|
|
|
std::istringstream ss( str );
|
2022-06-19 14:37:22 +00:00
|
|
|
std::ostringstream oss;
|
2022-06-16 14:30:22 +00:00
|
|
|
|
|
|
|
elfio elf;
|
2022-06-19 14:37:22 +00:00
|
|
|
|
|
|
|
if ( !elf.load( ss ) ) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
dump::header( oss, elf );
|
|
|
|
dump::section_headers( oss, elf );
|
|
|
|
dump::segment_headers( oss, elf );
|
|
|
|
dump::symbol_tables( oss, elf );
|
|
|
|
dump::notes( oss, elf );
|
|
|
|
dump::modinfo( oss, elf );
|
|
|
|
dump::dynamic_tags( oss, elf );
|
|
|
|
dump::section_datas( oss, elf );
|
|
|
|
dump::segment_datas( oss, elf );
|
2022-06-16 14:30:22 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|