retdec
Private Attributes | List of all members
retdec::fileinfo::FileSection Class Reference

#include <file_section.h>

Collaboration diagram for retdec::fileinfo::FileSection:
Collaboration graph
[legend]

Public Member Functions

Getters
std::string getName () const
 
std::string getType () const
 
std::string getCrc32 () const
 
std::string getMd5 () const
 
std::string getSha256 () const
 
std::string getIndexStr () const
 
std::string getOffsetStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getSizeInFileStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getEntrySizeStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getStartAddressStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getSizeInMemoryStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getRelocationsOffsetStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getNumberOfRelocationsStr () const
 
std::string getLineNumbersOffsetStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getNumberOfLineNumbersStr () const
 
std::string getMemoryAlignmentStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getLinkToAnotherSectionStr () const
 
std::string getExtraInfoStr () const
 
std::string getLineOffsetStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getRelocationsLineOffsetStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getEntropyStr (std::ios_base &(*format)(std::ios_base &)) const
 
unsigned long long getFlagsSize () const
 
unsigned long long getFlags () const
 
std::string getFlagsStr () const
 
std::size_t getNumberOfFlagsDescriptors () const
 
void getFlagsDescriptors (std::vector< std::string > &desc, std::vector< std::string > &abb) const
 
Setters
void setName (const std::string &name)
 
void setType (std::string type)
 
void setCrc32 (std::string sectionCrc32)
 
void setMd5 (std::string sectionMd5)
 
void setSha256 (std::string sectionSha256)
 
void setIndex (unsigned long long sectionIndex)
 
void setOffset (unsigned long long sectionOffset)
 
void setSizeInFile (unsigned long long size)
 
void setEntrySize (unsigned long long sizeOfOneEntry)
 
void setStartAddress (unsigned long long memoryAddress)
 
void setSizeInMemory (unsigned long long size)
 
void setRelocationsOffset (unsigned long long relocOffset)
 
void setNumberOfRelocations (unsigned long long relocations)
 
void setLineNumbersOffset (unsigned long long lineNumOffset)
 
void setNumberOfLineNumbers (unsigned long long lineNumbers)
 
void setMemoryAlignment (unsigned long long alignment)
 
void setLinkToAnotherSection (unsigned long long link)
 
void setExtraInfo (unsigned long long extraInformation)
 
void setLineOffset (unsigned long long sectionOffset)
 
void setRelocationsLineOffset (unsigned long long relocOffset)
 
void setEntropy (double entr)
 
void setFlagsSize (unsigned long long flagsSize)
 
void setFlags (unsigned long long flags)
 
Other methods
void addFlagsDescriptor (std::string descriptor, std::string abbreviation)
 
void clearFlagsDescriptors ()
 

Private Attributes

std::string sectionName
 name of section More...
 
std::string sectionType
 type of section More...
 
std::string crc32
 CRC32 of section content. More...
 
std::string md5
 MD5 of section content. More...
 
std::string sha256
 SHA256 of section content. More...
 
unsigned long long index = std::numeric_limits<unsigned long long>::max()
 index of section More...
 
unsigned long long offset = std::numeric_limits<unsigned long long>::max()
 offset in file More...
 
unsigned long long sizeInFile = std::numeric_limits<unsigned long long>::max()
 size of section in file More...
 
unsigned long long entrySize = std::numeric_limits<unsigned long long>::max()
 size of one entry in section More...
 
unsigned long long startAddress = std::numeric_limits<unsigned long long>::max()
 start address in memory More...
 
unsigned long long sizeInMemory = std::numeric_limits<unsigned long long>::max()
 size of section in memory More...
 
unsigned long long relocationsOffset = std::numeric_limits<unsigned long long>::max()
 offset of relocation entries for this section More...
 
unsigned long long numberOfRelocations = std::numeric_limits<unsigned long long>::max()
 number of relocation entries for this section More...
 
unsigned long long lineNumbersOffset = std::numeric_limits<unsigned long long>::max()
 offset of line-number entries for this section More...
 
unsigned long long numberOfLineNumbers = std::numeric_limits<unsigned long long>::max()
 number of line-number entries for this section More...
 
unsigned long long memoryAlignment = std::numeric_limits<unsigned long long>::max()
 alignment in memory More...
 
unsigned long long linkToSection = std::numeric_limits<unsigned long long>::max()
 link to another section More...
 
unsigned long long extraInfo = std::numeric_limits<unsigned long long>::max()
 extra information about section More...
 
unsigned long long lineOffset = std::numeric_limits<unsigned long long>::max()
 start line in file More...
 
unsigned long long relocationsLineOffset = std::numeric_limits<unsigned long long>::max()
 start line of relocation entries for this section More...
 
double entropy = std::numeric_limits<double>::min()
 section data entropy More...
 
Flags flags
 section flags More...
 

Detailed Description

Class for save information about section

Value std::numeric_limits<unsigned long long>::max()/min() mean unspecified value or error for numeric types.

Member Function Documentation

◆ addFlagsDescriptor()

void retdec::fileinfo::FileSection::addFlagsDescriptor ( std::string  descriptor,
std::string  abbreviation 
)

Add flag descriptor

Parameters
descriptorDescriptor (full description of flag)
abbreviationAbbreviation (short description of flag)

◆ clearFlagsDescriptors()

void retdec::fileinfo::FileSection::clearFlagsDescriptors ( )

Delete all flags descriptors

◆ getCrc32()

std::string retdec::fileinfo::FileSection::getCrc32 ( ) const

Get CRC32

Returns
CRC32 of section content

◆ getEntropyStr()

std::string retdec::fileinfo::FileSection::getEntropyStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get entropy of section data

Returns
Start line of relocations for this section

◆ getEntrySizeStr()

std::string retdec::fileinfo::FileSection::getEntrySizeStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get size of one entry of section

Returns
Size of one entry of section

◆ getExtraInfoStr()

std::string retdec::fileinfo::FileSection::getExtraInfoStr ( ) const

Get section extra information

Returns
Section extra information

◆ getFlags()

unsigned long long retdec::fileinfo::FileSection::getFlags ( ) const

Get flags of section

Returns
Flags as number

◆ getFlagsDescriptors()

void retdec::fileinfo::FileSection::getFlagsDescriptors ( std::vector< std::string > &  desc,
std::vector< std::string > &  abb 
) const

Get flags descriptors and its abbreviations

Parameters
descVector for save descriptors
abbVector for save abbreviations of descriptors

It is guaranteed that the number of stored descriptors and abbreviations are the same

◆ getFlagsSize()

unsigned long long retdec::fileinfo::FileSection::getFlagsSize ( ) const

Get flags size

Returns
Flags size

◆ getFlagsStr()

std::string retdec::fileinfo::FileSection::getFlagsStr ( ) const

Get flags of section

Returns
Flags as string

◆ getIndexStr()

std::string retdec::fileinfo::FileSection::getIndexStr ( ) const

Get section index

Returns
Index of file section

◆ getLineNumbersOffsetStr()

std::string retdec::fileinfo::FileSection::getLineNumbersOffsetStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get offset of line-number entries for section

Parameters
formatFormat of resulting string (e.g. std::dec, std::hex)
Returns
Offset of line-number entries for section

◆ getLineOffsetStr()

std::string retdec::fileinfo::FileSection::getLineOffsetStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get start line of section in file

Parameters
formatFormat of resulting string (e.g. std::dec, std::hex)
Returns
Start line of section in file

◆ getLinkToAnotherSectionStr()

std::string retdec::fileinfo::FileSection::getLinkToAnotherSectionStr ( ) const

Get link to another section

Returns
Link to another section

◆ getMd5()

std::string retdec::fileinfo::FileSection::getMd5 ( ) const

Get MD5

Returns
MD5 of section content

◆ getMemoryAlignmentStr()

std::string retdec::fileinfo::FileSection::getMemoryAlignmentStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get section memory alignment

Parameters
formatFormat of resulting string (e.g. std::dec, std::hex)
Returns
Section memory alignmnet

◆ getName()

std::string retdec::fileinfo::FileSection::getName ( ) const

Get section name

Returns
Section name

◆ getNumberOfFlagsDescriptors()

std::size_t retdec::fileinfo::FileSection::getNumberOfFlagsDescriptors ( ) const

Get number of flags descriptors

Returns
Number of flags descriptors

◆ getNumberOfLineNumbersStr()

std::string retdec::fileinfo::FileSection::getNumberOfLineNumbersStr ( ) const

Get number of line-number entries for section

Returns
Number of line-number entries for section

◆ getNumberOfRelocationsStr()

std::string retdec::fileinfo::FileSection::getNumberOfRelocationsStr ( ) const

Get number of relocation entries for section

Returns
Number of relocation entries for section

◆ getOffsetStr()

std::string retdec::fileinfo::FileSection::getOffsetStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get offset of section in file

Parameters
formatFormat of resulting string (e.g. std::dec, std::hex)
Returns
Offset of section

◆ getRelocationsLineOffsetStr()

std::string retdec::fileinfo::FileSection::getRelocationsLineOffsetStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get start line of relocations for this section

Parameters
formatFormat of resulting string (e.g. std::dec, std::hex)
Returns
Start line of relocations for this section

◆ getRelocationsOffsetStr()

std::string retdec::fileinfo::FileSection::getRelocationsOffsetStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get offset of relocation entries for section

Parameters
formatFormat of resulting string (e.g. std::dec, std::hex)
Returns
Offset of relocation entries for section

◆ getSha256()

std::string retdec::fileinfo::FileSection::getSha256 ( ) const

Get SHA256

Returns
SHA256 of section content

◆ getSizeInFileStr()

std::string retdec::fileinfo::FileSection::getSizeInFileStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get section size in file

Returns
Section size in file

◆ getSizeInMemoryStr()

std::string retdec::fileinfo::FileSection::getSizeInMemoryStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get size of section in memory

Returns
Size of section in memory

◆ getStartAddressStr()

std::string retdec::fileinfo::FileSection::getStartAddressStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get start address of section in memory

Parameters
formatFormat of resulting string (e.g. std::dec, std::hex)
Returns
Start address of section in memory

◆ getType()

std::string retdec::fileinfo::FileSection::getType ( ) const

Get section type

Returns
Section type

◆ setCrc32()

void retdec::fileinfo::FileSection::setCrc32 ( std::string  sectionCrc32)

Set section CRC32

Parameters
sectionCrc32CRC32 of section content

◆ setEntropy()

void retdec::fileinfo::FileSection::setEntropy ( double  entr)

Set section data entropy

Parameters
entrData entropy of section

◆ setEntrySize()

void retdec::fileinfo::FileSection::setEntrySize ( unsigned long long  sizeOfOneEntry)

Set size of one entry in section

Parameters
sizeOfOneEntrySize of one entry in section

◆ setExtraInfo()

void retdec::fileinfo::FileSection::setExtraInfo ( unsigned long long  extraInformation)

Set section extra information

Parameters
extraInformationSection extra information

◆ setFlags()

void retdec::fileinfo::FileSection::setFlags ( unsigned long long  flagsValue)

Set section flags

Parameters
flagsValueSection flags

◆ setFlagsSize()

void retdec::fileinfo::FileSection::setFlagsSize ( unsigned long long  flagsSize)

Set number of section flags

Parameters
flagsSizeNumber of section flags

◆ setIndex()

void retdec::fileinfo::FileSection::setIndex ( unsigned long long  sectionIndex)

Set index of section

Parameters
sectionIndexIndex of section

◆ setLineNumbersOffset()

void retdec::fileinfo::FileSection::setLineNumbersOffset ( unsigned long long  lineNumOffset)

Set offset of line-number entries for section

Parameters
lineNumOffsetOffset of line-number entries for section

◆ setLineOffset()

void retdec::fileinfo::FileSection::setLineOffset ( unsigned long long  sectionOffset)

Set line offset

Parameters
sectionOffsetLine offset of section

◆ setLinkToAnotherSection()

void retdec::fileinfo::FileSection::setLinkToAnotherSection ( unsigned long long  link)

Set link to another section

Parameters
linkLink to another file section

◆ setMd5()

void retdec::fileinfo::FileSection::setMd5 ( std::string  sectionMd5)

Set section MD5

Parameters
sectionMd5MD5 of section content

◆ setMemoryAlignment()

void retdec::fileinfo::FileSection::setMemoryAlignment ( unsigned long long  alignment)

Set section memory alignment

Parameters
alignmentSection nemory alignment

◆ setName()

void retdec::fileinfo::FileSection::setName ( const std::string &  name)

Set section name

Parameters
nameSection name

◆ setNumberOfLineNumbers()

void retdec::fileinfo::FileSection::setNumberOfLineNumbers ( unsigned long long  lineNumbers)

Set number of line-number entries for section

Parameters
lineNumbersNumber of line-number entries for section

◆ setNumberOfRelocations()

void retdec::fileinfo::FileSection::setNumberOfRelocations ( unsigned long long  relocations)

Set number of relocation entries for section

Parameters
relocationsNumber of relocation entries for section

◆ setOffset()

void retdec::fileinfo::FileSection::setOffset ( unsigned long long  sectionOffset)

Set section offset

Parameters
sectionOffsetSection offset

◆ setRelocationsLineOffset()

void retdec::fileinfo::FileSection::setRelocationsLineOffset ( unsigned long long  relocOffset)

Set relocations line offset

Parameters
relocOffsetRelocations line offset for this section

◆ setRelocationsOffset()

void retdec::fileinfo::FileSection::setRelocationsOffset ( unsigned long long  relocOffset)

Set offset of relocation entries for section

Parameters
relocOffsetOffset of relocation entries for section

◆ setSha256()

void retdec::fileinfo::FileSection::setSha256 ( std::string  sectionSha256)

Set section SHA256

Parameters
sectionSha256SHA256 of section content

◆ setSizeInFile()

void retdec::fileinfo::FileSection::setSizeInFile ( unsigned long long  size)

Set section size in file

Parameters
sizeSection size in file

◆ setSizeInMemory()

void retdec::fileinfo::FileSection::setSizeInMemory ( unsigned long long  size)

Set size of section in memory

Parameters
sizeSize of section in memory

◆ setStartAddress()

void retdec::fileinfo::FileSection::setStartAddress ( unsigned long long  memoryAddress)

Set section memory address

Parameters
memoryAddressStart address of section in memory

◆ setType()

void retdec::fileinfo::FileSection::setType ( std::string  type)

Set section type

Parameters
typeSection type

Member Data Documentation

◆ crc32

std::string retdec::fileinfo::FileSection::crc32
private

CRC32 of section content.

◆ entropy

double retdec::fileinfo::FileSection::entropy = std::numeric_limits<double>::min()
private

section data entropy

◆ entrySize

unsigned long long retdec::fileinfo::FileSection::entrySize = std::numeric_limits<unsigned long long>::max()
private

size of one entry in section

◆ extraInfo

unsigned long long retdec::fileinfo::FileSection::extraInfo = std::numeric_limits<unsigned long long>::max()
private

extra information about section

◆ flags

Flags retdec::fileinfo::FileSection::flags
private

section flags

◆ index

unsigned long long retdec::fileinfo::FileSection::index = std::numeric_limits<unsigned long long>::max()
private

index of section

◆ lineNumbersOffset

unsigned long long retdec::fileinfo::FileSection::lineNumbersOffset = std::numeric_limits<unsigned long long>::max()
private

offset of line-number entries for this section

◆ lineOffset

unsigned long long retdec::fileinfo::FileSection::lineOffset = std::numeric_limits<unsigned long long>::max()
private

start line in file

◆ linkToSection

unsigned long long retdec::fileinfo::FileSection::linkToSection = std::numeric_limits<unsigned long long>::max()
private

link to another section

◆ md5

std::string retdec::fileinfo::FileSection::md5
private

MD5 of section content.

◆ memoryAlignment

unsigned long long retdec::fileinfo::FileSection::memoryAlignment = std::numeric_limits<unsigned long long>::max()
private

alignment in memory

◆ numberOfLineNumbers

unsigned long long retdec::fileinfo::FileSection::numberOfLineNumbers = std::numeric_limits<unsigned long long>::max()
private

number of line-number entries for this section

◆ numberOfRelocations

unsigned long long retdec::fileinfo::FileSection::numberOfRelocations = std::numeric_limits<unsigned long long>::max()
private

number of relocation entries for this section

◆ offset

unsigned long long retdec::fileinfo::FileSection::offset = std::numeric_limits<unsigned long long>::max()
private

offset in file

◆ relocationsLineOffset

unsigned long long retdec::fileinfo::FileSection::relocationsLineOffset = std::numeric_limits<unsigned long long>::max()
private

start line of relocation entries for this section

◆ relocationsOffset

unsigned long long retdec::fileinfo::FileSection::relocationsOffset = std::numeric_limits<unsigned long long>::max()
private

offset of relocation entries for this section

◆ sectionName

std::string retdec::fileinfo::FileSection::sectionName
private

name of section

◆ sectionType

std::string retdec::fileinfo::FileSection::sectionType
private

type of section

◆ sha256

std::string retdec::fileinfo::FileSection::sha256
private

SHA256 of section content.

◆ sizeInFile

unsigned long long retdec::fileinfo::FileSection::sizeInFile = std::numeric_limits<unsigned long long>::max()
private

size of section in file

◆ sizeInMemory

unsigned long long retdec::fileinfo::FileSection::sizeInMemory = std::numeric_limits<unsigned long long>::max()
private

size of section in memory

◆ startAddress

unsigned long long retdec::fileinfo::FileSection::startAddress = std::numeric_limits<unsigned long long>::max()
private

start address in memory


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