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

#include <elf_segment.h>

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

Public Member Functions

 ElfSegment ()
 
Getters
unsigned long long getElfType () const
 
unsigned long long getElfAlign () const
 
unsigned long long getElfFlags () const
 
Setters
void setElfType (unsigned long long sElfType)
 
void setElfAlign (unsigned long long sElfAlign)
 
void setElfFlags (unsigned long long sElfFlags)
 
- Public Member Functions inherited from retdec::fileformat::Segment
 Segment ()
 
- 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
 
virtual bool isValid (const FileFormat *sOwner) 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 segment More...
 
unsigned long long elfAlign
 align of segment in memory More...
 
unsigned long long elfFlags
 segment flags 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

Segment in ELF file

Constructor & Destructor Documentation

◆ ElfSegment()

retdec::fileformat::ElfSegment::ElfSegment ( )

Constructor

Member Function Documentation

◆ getElfAlign()

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

Get align of section in memory

Returns
Align of section in memory

◆ getElfFlags()

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

Get flags of ELF section

Returns
Flags of ELF section

◆ getElfType()

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

Get type of ELF section

Returns
Type of ELF section

◆ setElfAlign()

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

Set align in memory

Parameters
sElfAlignAlign of section in memory

◆ setElfFlags()

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

Set flags

Parameters
sElfFlagsFlags of ELF section

◆ setElfType()

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

Set type of ELF section

Parameters
sElfTypeType of ELF section

Member Data Documentation

◆ elfAlign

unsigned long long retdec::fileformat::ElfSegment::elfAlign
private

align of segment in memory

◆ elfFlags

unsigned long long retdec::fileformat::ElfSegment::elfFlags
private

segment flags

◆ elfType

unsigned long long retdec::fileformat::ElfSegment::elfType
private

type of ELF segment


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