mirror of
https://github.com/serge1/ELFIO.git
synced 2025-04-16 05:42:31 +00:00
Another change
This commit is contained in:
parent
6d60be2dfd
commit
e04476791a
@ -39,7 +39,7 @@ class dump
|
|||||||
out << "ELF Header\n" << std::endl;
|
out << "ELF Header\n" << std::endl;
|
||||||
out << " Class: "
|
out << " Class: "
|
||||||
<< str_elf_class( reader.get_class() )
|
<< str_elf_class( reader.get_class() )
|
||||||
<< "(" << (int)reader.get_class() << ")"
|
<< " (" << (int)reader.get_class() << ")"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
out << " Encoding: "
|
out << " Encoding: "
|
||||||
<< ( ( ELFDATA2LSB == reader.get_encoding() ) ? "Little endian" : "" )
|
<< ( ( ELFDATA2LSB == reader.get_encoding() ) ? "Little endian" : "" )
|
||||||
@ -59,8 +59,21 @@ class dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct convert
|
||||||
|
{
|
||||||
|
Elf_Word type;
|
||||||
|
const char* str;
|
||||||
|
};
|
||||||
|
|
||||||
|
convert converts[] =
|
||||||
|
{
|
||||||
|
{ ELFCLASS32, "ELF32" },
|
||||||
|
{ ELFCLASS64, "ELF64" },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
static std::string
|
template<class T> static std::string
|
||||||
str_section_type( Elf_Word type )
|
str_section_type( Elf_Word type )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -68,17 +81,6 @@ class dump
|
|||||||
static std::string
|
static std::string
|
||||||
str_elf_class( Elf_Word type )
|
str_elf_class( Elf_Word type )
|
||||||
{
|
{
|
||||||
struct convert
|
|
||||||
{
|
|
||||||
Elf_Word type;
|
|
||||||
const char* str;
|
|
||||||
};
|
|
||||||
convert converts[] =
|
|
||||||
{
|
|
||||||
{ ELFCLASS32, "ELF32" },
|
|
||||||
{ ELFCLASS64, "ELF64" },
|
|
||||||
};
|
|
||||||
|
|
||||||
std::string res = "UNKNOWN";
|
std::string res = "UNKNOWN";
|
||||||
for ( unsigned int i = 0; i < sizeof( converts )/sizeof( convert ); ++i ) {
|
for ( unsigned int i = 0; i < sizeof( converts )/sizeof( convert ); ++i ) {
|
||||||
if ( converts[i].type == type ) {
|
if ( converts[i].type == type ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user