IAddressSpace Type
Represents the address space of a binary file: it maps an address to the raw content, and answers validity and file-mapping queries for addresses.
Instance members
| Instance member |
Description
|
Full Usage:
this.GetBoundedPointer
Parameters:
Addr
Returns: BinFilePointer
Modifiers: abstract |
Retrieves a file pointer that has its boundary aligned to the regions defined by file structures. Specifically, we split four types of regions in a binary file: (1) VM and file-mapped regions, (2) VM-only regions, (3) file-only regions, and (4) unmapped regions. A returned pointer will exclusively point to one of the first two regions, or it will be a null pointer for the remaining cases. To retrieve a pointer for (3), use format-specific member functions. Case (1) is the most common case, where the address is mapped to a file offset. Case (2) is a region that has its virtual address but not mapped to the file. For example, segments in ELF files often have such a region that is only available in the VMA.
|
Full Usage:
this.IsAddrMappedToFile
Parameters:
Addr
Returns: bool
Returns true if the address is within a mapped address range, false
otherwise.
Modifiers: abstract |
Checks if the given address is valid and there is an actual mapping from the associated binary file to the corresponding memory. Unlike IsValidAddr, this function checks if we can decide the actual value of the given address from the binary. For example, a program header of an ELF file may contain 100 bytes in size, but when it is mapped to a segment in memory, the size of the segment can be larger than the size of the program header. This function checks if the given address is in the range of the segment that has a direct mapping to the file's program header.
|
Full Usage:
this.IsExecutableAddr
Parameters:
Addr
Returns: bool
Returns true if the address is executable, false otherwise.
Modifiers: abstract |
Checks if the given address is executable address for this binary. We say a given address is executable if the address is within an executable segment. Note we consider the addresses of known read-only sections (such as .rodata) as non-executable, even though those sections are within an executable segment. For object files, we simply consider a .text section's address range as executable.
|
Full Usage:
this.IsRangeMappedToFile
Parameters:
AddrRange
Returns: bool
Returns true if the whole range of addresses is within a valid range,
false otherwise.
Modifiers: abstract |
Checks if the given address range is valid and there exists a corresponding region in the actual binary file. This function returns true only if the whole range of the addresses are valid (for every address in the range, IsAddrMappedToFile should return true).
|
Full Usage:
this.IsValidAddr
Parameters:
Addr
Returns: bool
Returns true if the address is within a valid range, false otherwise.
Modifiers: abstract |
Checks if the given address is valid for the associated binary. We say a given address is valid for the binary if the address is within the range of statically computable segment ranges.
|
Full Usage:
this.IsValidRange
Parameters:
AddrRange
Returns: bool
Returns true if the whole range of addresses is within a valid range,
false otherwise.
Modifiers: abstract |
Checks if the given address range is valid. This function returns true only if the whole range of the addresses are valid (for every address in the range, IsValidAddr should return true).
|
Full Usage:
this.Slice
Parameters:
Addr
len : int
Returns: ReadOnlySpan<byte>
Returns a read-only span of bytes starting from the specified virtual
address.
Modifiers: abstract |
Slices the raw binary content into a read-only span of bytes of the specified length starting from the specified virtual address. The address must be backed by the file content for the whole requested length; callers should ensure this with IsRangeMappedToFile beforehand. Raises InvalidAddrReadException when the requested region falls outside the file content (e.g., an unmapped address or a length that runs past the end of the file).
|
B2R2