LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
LIEF::runtime::MemoryLayout::Region Class Reference

A contiguous range of memory mapped in the current process. More...

#include <MemoryLayout.hpp>

Public Member Functions

 Region ()=default
 Region (std::string name, uint64_t addr, uint64_t size)
 Region (const Region &)=default
Regionoperator= (const Region &)=default
 Region (Region &&) noexcept=default
Regionoperator= (Region &&) noexcept=default
 ~Region ()=default
std::string_view name () const
 Name associated with the region: name/path of the module mapped at this address (e.g. libc.so.6) or the identifier of a region that is not backed by a file (e.g. [stack], [heap]).
uint64_t addr () const
 Address at which the region starts.
uint64_t size () const
 Size of the region.
uint64_t end_addr () const
 Address at which the region ends.
bool contains (uint64_t addr) const
 Whether the given address is within this region.
std::string to_string () const

Detailed Description

A contiguous range of memory mapped in the current process.

Constructor & Destructor Documentation

◆ Region() [1/4]

LIEF::runtime::MemoryLayout::Region::Region ( )
default

◆ Region() [2/4]

LIEF::runtime::MemoryLayout::Region::Region ( std::string name,
uint64_t addr,
uint64_t size )
inline

References addr(), name(), and size().

◆ Region() [3/4]

LIEF::runtime::MemoryLayout::Region::Region ( const Region & )
default

References Region().

◆ Region() [4/4]

LIEF::runtime::MemoryLayout::Region::Region ( Region && )
defaultnoexcept

References Region().

◆ ~Region()

LIEF::runtime::MemoryLayout::Region::~Region ( )
default

References Region().

Member Function Documentation

◆ addr()

uint64_t LIEF::runtime::MemoryLayout::Region::addr ( ) const
inline

Address at which the region starts.

Referenced by contains(), end_addr(), and Region().

◆ contains()

bool LIEF::runtime::MemoryLayout::Region::contains ( uint64_t addr) const
inline

Whether the given address is within this region.

References addr(), and end_addr().

◆ end_addr()

uint64_t LIEF::runtime::MemoryLayout::Region::end_addr ( ) const
inline

Address at which the region ends.

References addr(), and size().

Referenced by contains().

◆ name()

std::string_view LIEF::runtime::MemoryLayout::Region::name ( ) const
inline

Name associated with the region: name/path of the module mapped at this address (e.g. libc.so.6) or the identifier of a region that is not backed by a file (e.g. [stack], [heap]).

It can be empty for anonymous regions.

References LIEF_LIFETIMEBOUND, and name().

Referenced by name(), and Region().

◆ operator=() [1/2]

Region & LIEF::runtime::MemoryLayout::Region::operator= ( const Region & )
default

References Region().

◆ operator=() [2/2]

Region & LIEF::runtime::MemoryLayout::Region::operator= ( Region && )
defaultnoexcept

References Region().

◆ size()

uint64_t LIEF::runtime::MemoryLayout::Region::size ( ) const
inline

Size of the region.

Referenced by end_addr(), and Region().

◆ to_string()

std::string LIEF::runtime::MemoryLayout::Region::to_string ( ) const

Referenced by operator<<.


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