16#ifndef LIEF_RUNTIME_MEMORY_LAYOUT_H
17#define LIEF_RUNTIME_MEMORY_LAYOUT_H
45 name_(std::move(
name)),
102 :
public iterator_facade_base<Iterator, std::forward_iterator_tag, Region,
103 std::ptrdiff_t, const Region*, const Region&> {
106 using iterator_facade_base::operator++;
121 return !(LHS == RHS);
139 std::unique_ptr<
details::MemoryLayoutIt> impl_;
140 mutable std::unique_ptr<
Region> cached_;
151 if (region.contains(addr)) {
Definition iterators.hpp:595
Iterator(Iterator &&) noexcept
details::MemoryLayoutIt implementation
Definition MemoryLayout.hpp:105
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:41
uint64_t addr() const
Address at which the region starts.
Definition MemoryLayout.hpp:67
bool contains(uint64_t addr) const
Whether the given address is within this region.
Definition MemoryLayout.hpp:82
friend std::ostream & operator<<(std::ostream &os, const Region ®ion)
Definition MemoryLayout.hpp:88
uint64_t size() const
Size of the region.
Definition MemoryLayout.hpp:72
std::string_view name() const
Name associated with the region: name/path of the module mapped at this address (e....
Definition MemoryLayout.hpp:62
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:77
Region(const Region &)=default
Region(std::string name, uint64_t addr, uint64_t size)
Definition MemoryLayout.hpp:44
This class exposes the memory layout of the current process.
Definition MemoryLayout.hpp:38
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Definition MemoryLayout.hpp:33
Definition android/Host.hpp:24
iterator_range< MemoryLayout::Iterator > memory_layout_it
Definition MemoryLayout.hpp:144
std::optional< MemoryLayout::Region > find_region(uint64_t addr)
Definition MemoryLayout.hpp:149
memory_layout_it memory_layout()
Return an iterator over the memory layout of the current process.
#define LIEF_API
Definition visibility.h:45