Header menu logo B2R2

IContentAddressable Type

Represents an interface for accessing the raw binary content of a file via a virtual address.

Instance members

Instance member Description

this.GetBoundedPointer

Full Usage: this.GetBoundedPointer

Parameters:
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, and (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 rest 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.

addr : Addr
Returns: BinFilePointer

this.GetVMMappedRegions

Full Usage: this.GetVMMappedRegions

Parameters:
Returns: AddrRange[]
Modifiers: abstract

Returns an array of VM-mapped regions that have the given permission. By a VM-mapped region, we mean a region that has a corresponding mapping in the virtual memory. For example, an entire segment of an ELF file is considered a VM-mapped region.

perm : Permission
Returns: AddrRange[]

this.GetVMMappedRegions

Full Usage: this.GetVMMappedRegions

Returns: AddrRange[]
Modifiers: abstract

Returns an array of VM-mapped regions. By a VM-mapped region, we mean a consecutive region that has a corresponding mapping in the virtual memory. For example, an entire segment of an ELF file is considered a VM-mapped region.

Returns: AddrRange[]

this.IsAddrMappedToFile

Full Usage: this.IsAddrMappedToFile

Parameters:
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.

arg0 : Addr
Returns: bool

Returns true if the address is within a mapped address range, false otherwise.

this.IsExecutableAddr

Full Usage: this.IsExecutableAddr

Parameters:
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.

arg0 : Addr
Returns: bool

Returns true if the address is executable, false otherwise.

this.IsRangeMappedToFile

Full Usage: this.IsRangeMappedToFile

Parameters:
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 addressess are valid (for every address in the range, IsAddrMappedToFile should return true).

arg0 : AddrRange
Returns: bool

Returns true if the whole range of addresses is within a valid range, false otherwise.

this.IsValidAddr

Full Usage: this.IsValidAddr

Parameters:
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.

arg0 : Addr
Returns: bool

Returns true if the address is within a valid range, false otherwise.

this.IsValidRange

Full Usage: this.IsValidRange

Parameters:
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 addressess are valid (for every address in the range, IsValidAddr should return true).

arg0 : AddrRange
Returns: bool

Returns true if the whole range of addresses is within a valid range, false otherwise.

this.Slice

Full Usage: this.Slice

Parameters:
    addr : Addr
    len : int

Returns: ReadOnlySpan<byte> Returns a read-only span of bytes starting from the specified address.
Modifiers: abstract

Slices the raw binary content into a read-only span of bytes of the specified length starting from the specified address.

addr : Addr
len : int
Returns: ReadOnlySpan<byte>

Returns a read-only span of bytes starting from the specified address.

Type something to start searching.