ELFIO/elfio/elfio_dump_test.cpp
Serge Lamikhov-Center 4a2b8c1e85 Section output started
2012-08-18 21:05:11 +03:00

28 lines
561 B
C++

#include <iostream>
#include <elfio_dump.hpp>
using namespace ELFIO;
int main( int argc, char** argv )
{
if ( argc != 2 ) {
printf( "Usage: ELFDump <file_name>\n" );
return 1;
}
// Open ELF reader
elfio reader;
if ( !reader.load( argv[1] ) ) {
printf( "File %s is not found or it is not an ELF file\n", argv[1] );
return 1;
}
// Print ELF file header
dump::header ( std::cout, reader );
dump::section_headers( std::cout, reader );
return 0;
}