Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
elfreader.cpp File Reference
#include "elfreader.h"
#include <QDir>
+ Include dependency graph for elfreader.cpp:

Go to the source code of this file.

Classes

class  ElfMapper
 

Enumerations

enum  DynamicSectionTags {
  DT_NULL = 0 , DT_NEEDED = 1 , DT_STRTAB = 5 , DT_SONAME = 14 ,
  DT_RPATH = 15
}
 

Functions

quint16 getHalfWord (const unsigned char *&s, const ElfData &context)
 
quint32 getWord (const unsigned char *&s, const ElfData &context)
 
quint64 getAddress (const unsigned char *&s, const ElfData &context)
 
quint64 getOffset (const unsigned char *&s, const ElfData &context)
 
static void parseSectionHeader (const uchar *s, ElfSectionHeader *sh, const ElfData &context)
 
static void parseProgramHeader (const uchar *s, ElfProgramHeader *sh, const ElfData &context)
 
static QString msgInvalidElfObject (const QString &binary, const QString &why)
 
static QByteArray cutout (const char *s)
 

Enumeration Type Documentation

◆ DynamicSectionTags

Enumerator
DT_NULL 
DT_NEEDED 
DT_STRTAB 
DT_SONAME 
DT_RPATH 

Definition at line 358 of file elfreader.cpp.

Function Documentation

◆ cutout()

static QByteArray cutout ( const char *  s)
static

Definition at line 297 of file elfreader.cpp.

References pos.

Referenced by ElfReader::readCoreName().

+ Here is the caller graph for this function:

◆ getAddress()

quint64 getAddress ( const unsigned char *&  s,
const ElfData context 
)

Definition at line 37 of file elfreader.cpp.

References context, Elf_ELFCLASS32, and Elf_ELFDATA2MSB.

Referenced by getOffset(), parseProgramHeader(), and parseSectionHeader().

+ Here is the caller graph for this function:

◆ getHalfWord()

quint16 getHalfWord ( const unsigned char *&  s,
const ElfData context 
)

Definition at line 15 of file elfreader.cpp.

References context, and Elf_ELFDATA2MSB.

◆ getOffset()

quint64 getOffset ( const unsigned char *&  s,
const ElfData context 
)

Definition at line 56 of file elfreader.cpp.

References context, and getAddress().

Referenced by parseProgramHeader(), and parseSectionHeader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWord()

quint32 getWord ( const unsigned char *&  s,
const ElfData context 
)

Definition at line 26 of file elfreader.cpp.

References context, and Elf_ELFDATA2MSB.

Referenced by ElfReader::dependencies(), parseProgramHeader(), and parseSectionHeader().

+ Here is the caller graph for this function:

◆ msgInvalidElfObject()

static QString msgInvalidElfObject ( const QString binary,
const QString why 
)
inlinestatic

Definition at line 120 of file elfreader.cpp.

References QStringLiteral, and QDir::toNativeSeparators().

+ Here is the call graph for this function:

◆ parseProgramHeader()

static void parseProgramHeader ( const uchar s,
ElfProgramHeader sh,
const ElfData context 
)
static

Definition at line 71 of file elfreader.cpp.

References context, ElfProgramHeader::filesz, getAddress(), getOffset(), getWord(), ElfProgramHeader::memsz, ElfProgramHeader::offset, and ElfProgramHeader::type.

+ Here is the call graph for this function:

◆ parseSectionHeader()

static void parseSectionHeader ( const uchar s,
ElfSectionHeader sh,
const ElfData context 
)
static

Definition at line 61 of file elfreader.cpp.

References ElfSectionHeader::addr, context, ElfSectionHeader::flags, getAddress(), getOffset(), getWord(), ElfSectionHeader::index, ElfSectionHeader::offset, ElfSectionHeader::size, and ElfSectionHeader::type.

+ Here is the call graph for this function: