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

#include <file_segment.h>

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

Public Member Functions

Getters
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 getVirtualAddressStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getPhysicalAddressStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getSizeInFileStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getSizeInMemoryStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getAlignmentStr (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 setType (std::string type)
 
void setCrc32 (std::string segmentCrc32)
 
void setMd5 (std::string segmentMd5)
 
void setSha256 (std::string segmentSha256)
 
void setIndex (unsigned long long segmentIndex)
 
void setOffset (unsigned long long fileOffset)
 
void setVirtualAddress (unsigned long long address)
 
void setPhysicalAddress (unsigned long long address)
 
void setSizeInFile (unsigned long long size)
 
void setSizeInMemory (unsigned long long size)
 
void setAlignment (unsigned long long segmentAlignment)
 
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 segmentType
 type of segment More...
 
std::string crc32
 CRC32 of segment content. More...
 
std::string md5
 MD5 of segment content. More...
 
std::string sha256
 SHA256 of segment content. More...
 
unsigned long long index = std::numeric_limits<unsigned long long>::max()
 index of segment More...
 
unsigned long long offset = std::numeric_limits<unsigned long long>::max()
 offset in file More...
 
unsigned long long virtualAddress = std::numeric_limits<unsigned long long>::max()
 virtual address in memory More...
 
unsigned long long physicalAddress = std::numeric_limits<unsigned long long>::max()
 physical address in memory More...
 
unsigned long long sizeInFile = std::numeric_limits<unsigned long long>::max()
 size of segment in file More...
 
unsigned long long sizeInMemory = std::numeric_limits<unsigned long long>::max()
 size of segment in memory More...
 
unsigned long long alignment = std::numeric_limits<unsigned long long>::max()
 alignment in memory and in file More...
 
Flags flags
 segment flags More...
 

Detailed Description

Class for save information about segment

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

Member Function Documentation

◆ addFlagsDescriptor()

void retdec::fileinfo::FileSegment::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::FileSegment::clearFlagsDescriptors ( )

Delete all flags descriptors

◆ getAlignmentStr()

std::string retdec::fileinfo::FileSegment::getAlignmentStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get alignment

Parameters
formatFormat of result (e.g. std::dec, std::hex)
Returns
Segment alignment

◆ getCrc32()

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

Get CRC32

Returns
CRC32 of segment content

◆ getFlags()

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

Get segment flags as number

Returns
Flags as number

◆ getFlagsDescriptors()

void retdec::fileinfo::FileSegment::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::FileSegment::getFlagsSize ( ) const

Get segment flags size

Returns
Size of segment flags

◆ getFlagsStr()

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

Get segment flags as string

Returns
Flags as string

◆ getIndexStr()

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

Get segment index

Returns
Segment index

◆ getMd5()

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

Get MD5

Returns
MD5 of segment content

◆ getNumberOfFlagsDescriptors()

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

Get number of flags descriptors

Returns
Number of flags descriptors

◆ getOffsetStr()

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

Get segment offset in file

Parameters
formatFormat of result (e.g. std::dec, std::hex)
Returns
Segment file offset

◆ getPhysicalAddressStr()

std::string retdec::fileinfo::FileSegment::getPhysicalAddressStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get physical address in memory

Parameters
formatFormat of result (e.g. std::dec, std::hex)
Returns
Physical address in memory

◆ getSha256()

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

Get SHA256

Returns
SHA256 of segment content

◆ getSizeInFileStr()

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

Get size of segment in file

Returns
Size of segment in file

◆ getSizeInMemoryStr()

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

Get size of segment in memory

Returns
Size of segment in memory

◆ getType()

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

Get segment type

Returns
Segment type

◆ getVirtualAddressStr()

std::string retdec::fileinfo::FileSegment::getVirtualAddressStr ( std::ios_base &(*)(std::ios_base &)  format) const

Get virtual address in memory

Parameters
formatFormat of result (e.g. std::dec, std::hex)
Returns
Virtual address in memory

◆ setAlignment()

void retdec::fileinfo::FileSegment::setAlignment ( unsigned long long  segmentAlignment)

Set segment alignment

Parameters
segmentAlignmentSegment alignment

◆ setCrc32()

void retdec::fileinfo::FileSegment::setCrc32 ( std::string  segmentCrc32)

Set segment CRC32

Parameters
segmentCrc32CRC32 of segment content

◆ setFlags()

void retdec::fileinfo::FileSegment::setFlags ( unsigned long long  flagsArray)

Set segment flags

Parameters
flagsArraySegment flags

◆ setFlagsSize()

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

Set segment flags size

Parameters
flagsSizeSegment flags size

◆ setIndex()

void retdec::fileinfo::FileSegment::setIndex ( unsigned long long  segmentIndex)

Set segment index

Parameters
segmentIndexSegment index

◆ setMd5()

void retdec::fileinfo::FileSegment::setMd5 ( std::string  segmentMd5)

Set segment MD5

Parameters
segmentMd5MD5 of segment content

◆ setOffset()

void retdec::fileinfo::FileSegment::setOffset ( unsigned long long  fileOffset)

Set segment offset in file

Parameters
fileOffsetSegment offset in file

◆ setPhysicalAddress()

void retdec::fileinfo::FileSegment::setPhysicalAddress ( unsigned long long  address)

Set segment physical address

Parameters
addressSegment physical address

◆ setSha256()

void retdec::fileinfo::FileSegment::setSha256 ( std::string  segmentSha256)

Set segment SHA256

Parameters
segmentSha256SHA256 of segment content

◆ setSizeInFile()

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

Set segment size in file

Parameters
sizeSegment size in file

◆ setSizeInMemory()

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

Set segment size in memory

Parameters
sizeSegment size in memory

◆ setType()

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

Set type of segment

Parameters
typeType of segment

◆ setVirtualAddress()

void retdec::fileinfo::FileSegment::setVirtualAddress ( unsigned long long  address)

Set segment virtual address

Parameters
addressSegment virtual address

Member Data Documentation

◆ alignment

unsigned long long retdec::fileinfo::FileSegment::alignment = std::numeric_limits<unsigned long long>::max()
private

alignment in memory and in file

◆ crc32

std::string retdec::fileinfo::FileSegment::crc32
private

CRC32 of segment content.

◆ flags

Flags retdec::fileinfo::FileSegment::flags
private

segment flags

◆ index

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

index of segment

◆ md5

std::string retdec::fileinfo::FileSegment::md5
private

MD5 of segment content.

◆ offset

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

offset in file

◆ physicalAddress

unsigned long long retdec::fileinfo::FileSegment::physicalAddress = std::numeric_limits<unsigned long long>::max()
private

physical address in memory

◆ segmentType

std::string retdec::fileinfo::FileSegment::segmentType
private

type of segment

◆ sha256

std::string retdec::fileinfo::FileSegment::sha256
private

SHA256 of segment content.

◆ sizeInFile

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

size of segment in file

◆ sizeInMemory

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

size of segment in memory

◆ virtualAddress

unsigned long long retdec::fileinfo::FileSegment::virtualAddress = std::numeric_limits<unsigned long long>::max()
private

virtual address in memory


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