#include <segment.h>
|
| Segment (const retdec::fileformat::SecSeg *secSeg, std::uint64_t address, std::uint64_t size, std::unique_ptr< SegmentDataSource > &&dataSource) |
|
| Segment (const Segment &segment) |
|
const retdec::fileformat::SecSeg * | getSecSeg () const |
|
bool | containsAddress (std::uint64_t address) const |
|
std::uint64_t | getAddress () const |
|
std::uint64_t | getEndAddress () const |
|
std::uint64_t | getPhysicalEndAddress () const |
|
std::uint64_t | getSize () const |
|
std::uint64_t | getPhysicalSize () const |
|
retdec::common::Range< std::uint64_t > | getAddressRange () const |
|
retdec::common::Range< std::uint64_t > | getPhysicalAddressRange () const |
|
const retdec::common::RangeContainer< std::uint64_t > & | getNonDecodableAddressRanges () const |
|
std::pair< const std::uint8_t *, std::uint64_t > | getRawData () const |
|
bool | hasName () const |
|
const std::string & | getName () const |
|
void | setName (const std::string &name) |
|
bool | getBytes (std::vector< unsigned char > &result) const |
|
bool | getBytes (std::vector< unsigned char > &result, std::uint64_t addressOffset, std::uint64_t size) const |
|
bool | getBits (std::string &result) const |
|
bool | getBits (std::string &result, std::uint64_t addressOffset, std::uint64_t bytesCount) const |
|
bool | setBytes (const std::vector< unsigned char > &value, std::uint64_t addressOffset) |
|
void | resize (std::uint64_t newSize) |
|
void | shrink (std::uint64_t shrinkOffset, std::uint64_t newSize) |
|
void | addNonDecodableRange (retdec::common::Range< std::uint64_t > range) |
|
◆ Segment() [1/2]
◆ Segment() [2/2]
retdec::loader::Segment::Segment |
( |
const Segment & |
segment | ) |
|
◆ addNonDecodableRange()
Adds address range which should be ignored during the instruction decoding.
- Parameters
-
◆ containsAddress()
bool retdec::loader::Segment::containsAddress |
( |
std::uint64_t |
address | ) |
const |
Returns whether the segment contains specified address.
- Parameters
-
address | The address to check. |
- Returns
- True if contains, otherwise false.
◆ getAddress()
std::uint64_t retdec::loader::Segment::getAddress |
( |
| ) |
const |
Returns an address the segment is loaded at.
- Returns
- Address of the segment.
◆ getAddressRange()
◆ getBits() [1/2]
bool retdec::loader::Segment::getBits |
( |
std::string & |
result | ) |
const |
Get content of segment as bits in string representation.
- Parameters
-
result | Bits in string representation. |
- Returns
- True if read was successful, otherwise false.
◆ getBits() [2/2]
bool retdec::loader::Segment::getBits |
( |
std::string & |
result, |
|
|
std::uint64_t |
addressOffset, |
|
|
std::uint64_t |
bytesCount |
|
) |
| const |
Get content of segment as bits in string representation.
- Parameters
-
result | Bits in string representation. |
addressOffset | First byte of the segment to be read (0 means first byte of segment). |
bytesCount | Number of bytes for read. |
- Returns
- True if read was successful, otherwise false.
◆ getBytes() [1/2]
bool retdec::loader::Segment::getBytes |
( |
std::vector< unsigned char > & |
result | ) |
const |
Get the whole content of segment as bytes.
- Parameters
-
result | Read bytes in integer representation. |
- Returns
- True if read was successful, otherwise false.
◆ getBytes() [2/2]
bool retdec::loader::Segment::getBytes |
( |
std::vector< unsigned char > & |
result, |
|
|
std::uint64_t |
addressOffset, |
|
|
std::uint64_t |
size |
|
) |
| const |
Get content of segment as bytes.
- Parameters
-
result | Read bytes in integer representation. |
addressOffset | First byte of the segment to be read (0 means first byte of segment). |
size | Number of bytes for read. |
- Returns
- True if read was successful, otherwise false.
◆ getEndAddress()
std::uint64_t retdec::loader::Segment::getEndAddress |
( |
| ) |
const |
Returns the last valid address of the segment.
- Returns
- End address of the segment.
◆ getName()
const std::string & retdec::loader::Segment::getName |
( |
| ) |
const |
Returns the name of the segment, if it has one.
- Returns
- Name of the segment.
◆ getNonDecodableAddressRanges()
Returns the list of address ranges which should be ignored during instruction decoding.
- Returns
- List of address ranges.
◆ getPhysicalAddressRange()
◆ getPhysicalEndAddress()
std::uint64_t retdec::loader::Segment::getPhysicalEndAddress |
( |
| ) |
const |
Returns the last address of the segment that contains physical data from the file.
- Returns
- End address of the physical data of the segment.
◆ getPhysicalSize()
std::uint64_t retdec::loader::Segment::getPhysicalSize |
( |
| ) |
const |
Returns the size of the physical data that is loaded for the file. If the physical size is greater than virtual, virtual is returned instead.
- Returns
- The physical size of the segment.
◆ getRawData()
std::pair< const std::uint8_t *, std::uint64_t > retdec::loader::Segment::getRawData |
( |
| ) |
const |
Returns the raw data of the segment in its size. Returns null pointer and 0 for segments without any source of phyiscal data.
- Returns
- Raw data pointer and size.
◆ getSecSeg()
Returns associated section or segment, which was used for loading of this segment.
- Returns
- Associated section or segment. If no section or segment is associated, returns nullptr.
◆ getSize()
std::uint64_t retdec::loader::Segment::getSize |
( |
| ) |
const |
Returns the loaded size of the segment.
- Returns
- The size of the segment.
◆ hasName()
bool retdec::loader::Segment::hasName |
( |
| ) |
const |
Returns whether the segment is named segment.
- Returns
- True if set, otherwise false.
◆ resize()
void retdec::loader::Segment::resize |
( |
std::uint64_t |
newSize | ) |
|
Resizes segment to a given size.
- Parameters
-
newSize | The new size of segment. |
◆ setBytes()
bool retdec::loader::Segment::setBytes |
( |
const std::vector< unsigned char > & |
value, |
|
|
std::uint64_t |
addressOffset |
|
) |
| |
◆ setName()
void retdec::loader::Segment::setName |
( |
const std::string & |
name | ) |
|
Sets the name to the segment.
- Parameters
-
name | New name of the segment. |
◆ shrink()
void retdec::loader::Segment::shrink |
( |
std::uint64_t |
newAddress, |
|
|
std::uint64_t |
newSize |
|
) |
| |
Shrinks the segment to start from the new given address and has new given size. The address must already be valid address in the segment and size cannot exceed the current upper bound of the segment.
- Parameters
-
newAddress | The new address of segment. |
newSize | The new size of segment. |
◆ _address
std::uint64_t retdec::loader::Segment::_address |
|
private |
◆ _dataSource
◆ _name
std::string retdec::loader::Segment::_name |
|
private |
◆ _nonDecodableRanges
◆ _secSeg
◆ _size
std::uint64_t retdec::loader::Segment::_size |
|
private |
The documentation for this class was generated from the following files:
- /var/cache/acbs/build/acbs.6bu6osb6/retdec/include/retdec/loader/loader/segment.h
- /var/cache/acbs/build/acbs.6bu6osb6/retdec/src/loader/loader/segment.cpp