retdec
Public Member Functions | Private Attributes | List of all members
retdec::fileformat::ElfSection Class Reference

#include <elf_section.h>

Inheritance diagram for retdec::fileformat::ElfSection:
Inheritance graph
[legend]
Collaboration diagram for retdec::fileformat::ElfSection:
Collaboration graph
[legend]

Public Member Functions

 ElfSection ()
 
Virtual query methods
virtual bool isValid (const FileFormat *sOwner) const override
 
Getters
unsigned long long getElfType () const
 
unsigned long long getElfAlign () const
 
unsigned long long getElfFlags () const
 
unsigned long long getElfLink () const
 
unsigned long long getNumberOfSections () const
 
unsigned long long getArchByteSize () const
 
Setters
void setElfType (unsigned long long sElfType)
 
void setElfAlign (unsigned long long sElfAlign)
 
void setElfFlags (unsigned long long sElfFlags)
 
void setElfLink (unsigned long long sElfLink)
 
void setNumberOfSections (unsigned long long sNumberOfSections)
 
void setArchByteSize (unsigned long long sArchByteSize)
 
- Public Member Functions inherited from retdec::fileformat::Section
 Section ()
 
- Public Member Functions inherited from retdec::fileformat::SecSeg
virtual ~SecSeg ()=default
 
bool isUndefined () const
 
bool isCode () const
 
bool isData () const
 
bool isCodeAndData () const
 
bool isConstData () const
 
bool isBss () const
 
bool isDebug () const
 
bool isInfo () const
 
bool isSomeData () const
 
bool isSomeCode () const
 
bool isDataOnly () const
 
bool isReadOnly () const
 
std::string getCrc32 () const
 
std::string getMd5 () const
 
std::string getSha256 () const
 
std::string getName () const
 
const char * getNameAsCStr () const
 
const llvm::StringRef getBytes (unsigned long long sOffset=0, unsigned long long sSize=0) const
 
SecSeg::Type getType () const
 
unsigned long long getIndex () const
 
unsigned long long getOffset () const
 
unsigned long long getEndOffset () const
 
unsigned long long getSizeInFile () const
 
unsigned long long getLoadedSize () const
 
unsigned long long getAddress () const
 
unsigned long long getEndAddress () const
 
bool getSizeInMemory (unsigned long long &sMemorySize) const
 
bool getSizeOfOneEntry (unsigned long long &sEntrySize) const
 
bool getMemory () const
 
bool getEntropy (double &res) const
 
template<typename NumberType >
NumberType getBytesAtOffsetAsNumber (unsigned long long sOffset) const
 
bool getBits (std::string &sResult) const
 
bool getBytes (std::vector< unsigned char > &sResult, unsigned long long sOffset=0, unsigned long long sSize=0) const
 
bool getString (std::string &sResult, unsigned long long sOffset=0, unsigned long long sSize=0) const
 
bool getHexBytes (std::string &sResult) const
 
void setName (std::string sName)
 
void setType (SecSeg::Type sType)
 
void setIndex (unsigned long long sIndex)
 
void setOffset (unsigned long long sOffset)
 
void setSizeInFile (unsigned long long sFileSize)
 
void setAddress (unsigned long long sAddress)
 
void setSizeInMemory (unsigned long long sMemorySize)
 
void setSizeOfOneEntry (unsigned long long sEntrySize)
 
void setMemory (bool sMemory)
 
void computeEntropy ()
 
void invalidateMemorySize ()
 
void invalidateEntrySize ()
 
void load (const FileFormat *sOwner)
 
void dump (std::string &sDump) const
 
bool hasCrc32 () const
 
bool hasMd5 () const
 
bool hasSha256 () const
 
bool hasEmptyName () const
 
bool belong (unsigned long long sAddress) const
 
bool operator< (const SecSeg &sOther) const
 

Private Attributes

unsigned long long elfType
 type of ELF section More...
 
unsigned long long elfAlign
 align of section in memory More...
 
unsigned long long elfFlags
 section flags More...
 
unsigned long long elfLink
 link to another section More...
 
unsigned long long numberOfSections
 total number of sections in input file More...
 
unsigned long long archByteSize
 byte size of target architecture More...
 

Additional Inherited Members

- Public Types inherited from retdec::fileformat::SecSeg
enum class  Type {
  UNDEFINED_SEC_SEG , CODE , DATA , CODE_DATA ,
  CONST_DATA , BSS , DEBUG , INFO
}
 

Detailed Description

Section in ELF file

Constructor & Destructor Documentation

◆ ElfSection()

retdec::fileformat::ElfSection::ElfSection ( )

Constructor

Member Function Documentation

◆ getArchByteSize()

unsigned long long retdec::fileformat::ElfSection::getArchByteSize ( ) const

Get byte size of target architecture

Returns
Byte size of target architecture

◆ getElfAlign()

unsigned long long retdec::fileformat::ElfSection::getElfAlign ( ) const

Get align of section in memory

Returns
Align of section in memory

◆ getElfFlags()

unsigned long long retdec::fileformat::ElfSection::getElfFlags ( ) const

Get flags of ELF section

Returns
Flags of ELF section

◆ getElfLink()

unsigned long long retdec::fileformat::ElfSection::getElfLink ( ) const

Get link to another section in ELF file

Returns
Link to another section in ELF file

◆ getElfType()

unsigned long long retdec::fileformat::ElfSection::getElfType ( ) const

Get type of ELF section

Returns
Type of ELF section

◆ getNumberOfSections()

unsigned long long retdec::fileformat::ElfSection::getNumberOfSections ( ) const

Get total number of sections in ELF file

Returns
Total number of sections in ELF file

◆ isValid()

bool retdec::fileformat::ElfSection::isValid ( const FileFormat sOwner) const
overridevirtual

Does this section appear to be valid in the context of the provided input file?

Parameters
sOwnerPointer to input file
Returns
true if section is valid, false otherwise

Reimplemented from retdec::fileformat::SecSeg.

◆ setArchByteSize()

void retdec::fileformat::ElfSection::setArchByteSize ( unsigned long long  sArchByteSize)

Set byte size of target architecture

Parameters
sArchByteSizeByte size of target architecture

◆ setElfAlign()

void retdec::fileformat::ElfSection::setElfAlign ( unsigned long long  sElfAlign)

Set align in memory

Parameters
sElfAlignAlign of section in memory

◆ setElfFlags()

void retdec::fileformat::ElfSection::setElfFlags ( unsigned long long  sElfFlags)

Set flags

Parameters
sElfFlagsFlags of ELF section

◆ setElfLink()

void retdec::fileformat::ElfSection::setElfLink ( unsigned long long  sElfLink)

Set link to another section

Parameters
sElfLinkLink to another section in ELF file

◆ setElfType()

void retdec::fileformat::ElfSection::setElfType ( unsigned long long  sElfType)

Set type of ELF section

Parameters
sElfTypeType of ELF section

◆ setNumberOfSections()

void retdec::fileformat::ElfSection::setNumberOfSections ( unsigned long long  sNumberOfSections)

Set total number of sections in input file

Parameters
sNumberOfSectionsTotal number of sections in input file

Member Data Documentation

◆ archByteSize

unsigned long long retdec::fileformat::ElfSection::archByteSize
private

byte size of target architecture

◆ elfAlign

unsigned long long retdec::fileformat::ElfSection::elfAlign
private

align of section in memory

◆ elfFlags

unsigned long long retdec::fileformat::ElfSection::elfFlags
private

section flags

◆ elfLink

unsigned long long retdec::fileformat::ElfSection::elfLink
private

link to another section

◆ elfType

unsigned long long retdec::fileformat::ElfSection::elfType
private

type of ELF section

◆ numberOfSections

unsigned long long retdec::fileformat::ElfSection::numberOfSections
private

total number of sections in input file


The documentation for this class was generated from the following files: