• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <string>
2 #include <sstream>
3 
4 #include <elfio/elfio.hpp>
5 #include <elfio/elfio_dump.hpp>
6 
7 using namespace ELFIO;
8 
LLVMFuzzerTestOneInput(const uint8_t * Data,size_t Size)9 extern "C" int LLVMFuzzerTestOneInput( const uint8_t* Data, size_t Size )
10 {
11     std::string        str( (const char*)Data, Size );
12     std::istringstream ss( str );
13     std::ostringstream oss;
14 
15     elfio elf;
16 
17     if ( !elf.load( ss ) ) {
18         return 0;
19     }
20 
21     dump::header( oss, elf );
22     dump::section_headers( oss, elf );
23     dump::segment_headers( oss, elf );
24     dump::symbol_tables( oss, elf );
25     dump::notes( oss, elf );
26     dump::modinfo( oss, elf );
27     dump::dynamic_tags( oss, elf );
28     dump::section_datas( oss, elf );
29     dump::segment_datas( oss, elf );
30 
31     return 0;
32 }
33