retdec
|
#include <macho_section.h>
Public Member Functions | |
MachOSection () | |
Getters | |
std::string | getSegmentName () const |
unsigned long long | getAlignment () const |
unsigned long long | getRelocationOffset () const |
unsigned long long | getNumberOfRelocations () const |
unsigned long long | getMachOFlags () const |
unsigned long long | getReserved1 () const |
unsigned long long | getReserved2 () const |
Setters | |
void | setSegmentName (const std::string &segmentName) |
void | setAlignment (unsigned long long alignment) |
void | setRelocationOffset (unsigned long long offset) |
void | setNumberOfRelocations (unsigned long long number) |
void | setMachOFlags (unsigned long long flags) |
void | setReserved1 (unsigned long long reserved1) |
void | setReserved2 (unsigned long long reserved2) |
![]() | |
Section () | |
![]() | |
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 | |
std::string | segname |
Name of the segment this section is placed in. More... | |
unsigned long long | align |
Byte alignment as power of two. More... | |
unsigned long long | reloff |
File offset of first relocation entry. More... | |
unsigned long long | nreloc |
Number of relocations. More... | |
unsigned long long | flags |
Mach-O section flags. More... | |
unsigned long long | reserved1 |
Various interpretations (depends on flags) More... | |
unsigned long long | reserved2 |
Various interpretations (depends on flags) More... | |
Additional Inherited Members | |
![]() | |
enum class | Type { UNDEFINED_SEC_SEG , CODE , DATA , CODE_DATA , CONST_DATA , BSS , DEBUG , INFO } |
Section in Mach-O file
retdec::fileformat::MachOSection::MachOSection | ( | ) |
unsigned long long retdec::fileformat::MachOSection::getAlignment | ( | ) | const |
Get section's byte alignment
unsigned long long retdec::fileformat::MachOSection::getMachOFlags | ( | ) | const |
Get Mach-O flags
unsigned long long retdec::fileformat::MachOSection::getNumberOfRelocations | ( | ) | const |
Get number of relocations
unsigned long long retdec::fileformat::MachOSection::getRelocationOffset | ( | ) | const |
Get offset of first relocation
unsigned long long retdec::fileformat::MachOSection::getReserved1 | ( | ) | const |
Get field reserved1
unsigned long long retdec::fileformat::MachOSection::getReserved2 | ( | ) | const |
Get field reserved2
std::string retdec::fileformat::MachOSection::getSegmentName | ( | ) | const |
Get name of segment this section is placed in.
void retdec::fileformat::MachOSection::setAlignment | ( | unsigned long long | alignment | ) |
Set section's byte alignment
alignment | Byte alignment as power of 2 |
void retdec::fileformat::MachOSection::setMachOFlags | ( | unsigned long long | flags | ) |
Set Mach-O flags
flags | Mach-O flags |
void retdec::fileformat::MachOSection::setNumberOfRelocations | ( | unsigned long long | number | ) |
Set number of relocations
number | Number of relocations |
void retdec::fileformat::MachOSection::setRelocationOffset | ( | unsigned long long | offset | ) |
Set offset of first relocation
offset | Offset of first relocation |
void retdec::fileformat::MachOSection::setReserved1 | ( | unsigned long long | reserved1 | ) |
Set reserved1 field
reserved1 | Reserved1 field |
void retdec::fileformat::MachOSection::setReserved2 | ( | unsigned long long | reserved2 | ) |
Set reserved2 field
reserved2 | Reserved2 field |
void retdec::fileformat::MachOSection::setSegmentName | ( | const std::string & | segmentName | ) |
Set segment name this section is placed in.
segmentName | Segment name. |
|
private |
Byte alignment as power of two.
|
private |
Mach-O section flags.
|
private |
Number of relocations.
|
private |
File offset of first relocation entry.
|
private |
Various interpretations (depends on flags)
|
private |
Various interpretations (depends on flags)
|
private |
Name of the segment this section is placed in.