mirror of
https://github.com/QuasarApp/ELFIO.git
synced 2025-05-17 21:29:33 +00:00
28 lines
509 B
C++
28 lines
509 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 );
|
|
|
|
|
|
return 0;
|
|
}
|