16#ifndef LIEF_RUNTIME_MEMORY_LAYOUT_H
17#define LIEF_RUNTIME_MEMORY_LAYOUT_H
47 name_(std::move(
name)),
111 :
public iterator_facade_base<Iterator, std::forward_iterator_tag, Region,
112 std::ptrdiff_t, const Region*, const Region&> {
115 using iterator_facade_base::operator++;
130 return !(LHS == RHS);
148 std::unique_ptr<
details::MemoryLayoutIt> impl_;
149 mutable std::unique_ptr<
Region> cached_;
160 if (region.contains(addr)) {
Definition iterators.hpp:681
Iterator(Iterator &&) noexcept
details::MemoryLayoutIt implementation
Definition MemoryLayout.hpp:114
Iterator(const Iterator &)
Iterator & operator=(const Iterator &)
const Region & operator*() const
std::unique_ptr< Region > yield()
Transfer ownership of the region at the current position to the caller. Returns nullptr if the iterat...
A contiguous range of memory mapped in the current process.
Definition MemoryLayout.hpp:42
uint64_t addr() const
Address at which the region starts.
Definition MemoryLayout.hpp:70
bool contains(uint64_t addr) const
Whether the given address is within this region.
Definition MemoryLayout.hpp:90
friend std::ostream & operator<<(std::ostream &os, const Region ®ion)
Definition MemoryLayout.hpp:96
uint64_t size() const
Size of the region.
Definition MemoryLayout.hpp:75
uint32_t permissions() const
Permissions of the region as a combination of Memory::PERM.
Definition MemoryLayout.hpp:85
std::string_view name() const
Name associated with the region: name/path of the module mapped at this address (e....
Definition MemoryLayout.hpp:65
std::string to_string() const
Region & operator=(const Region &)=default
Region(Region &&) noexcept=default
uint64_t end_addr() const
Address at which the region ends.
Definition MemoryLayout.hpp:80
Region(const Region &)=default
Region(std::string name, uint64_t addr, uint64_t size, uint32_t permissions=Memory::P_NONE)
Definition MemoryLayout.hpp:45
This class exposes the memory layout of the current process.
Definition MemoryLayout.hpp:39
@ P_NONE
Definition runtime/Memory.hpp:60
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Definition MemoryLayout.hpp:34
Definition android/Host.hpp:24
iterator_range< MemoryLayout::Iterator > memory_layout_it
Definition MemoryLayout.hpp:153
std::optional< MemoryLayout::Region > find_region(uint64_t addr)
Definition MemoryLayout.hpp:158
memory_layout_it memory_layout()
Return an iterator over the memory layout of the current process.
#define LIEF_API
Definition visibility.h:45