Crashpad
|
Accesses information about mapped memory in another process. More...
#include "util/linux/memory_map.h"
Classes | |
class | Iterator |
An abstract base class for iterating over ordered sets of mappings in a MemoryMap. More... | |
struct | Mapping |
Information about a mapped region of memory. More... | |
Public Member Functions | |
bool | Initialize (PtraceConnection *connection) |
Initializes this object with information about the mapped memory regions in the process connected via connection. More... | |
const Mapping * | FindMapping (LinuxVMAddress address) const |
const Mapping * | FindMappingWithName (const std::string &name) const |
std::unique_ptr< Iterator > | FindFilePossibleMmapStarts (const Mapping &mapping) const |
Find possible initial mappings of files mapped over several segments. More... | |
std::unique_ptr< Iterator > | ReverseIteratorFrom (const Mapping &mapping) const |
Accesses information about mapped memory in another process.
The target process must be stopped to guarantee correct mappings. If the target process is not stopped, mappings may be invalid after the return from Initialize(), and even mappings existing at the time Initialize() was called may not be found.
std::unique_ptr< MemoryMap::Iterator > crashpad::MemoryMap::FindFilePossibleMmapStarts | ( | const Mapping & | mapping | ) | const |
Find possible initial mappings of files mapped over several segments.
Executables and libaries are typically loaded into several mappings with varying permissions for different segments. Portions of an ELF file may be mapped multiple times as part of loading the file, for example, when initializing GNU_RELRO segments.
This method searches for mappings at or below mapping in memory that are mapped from the same file as mapping from offset 0.
On Android, ELF modules may be loaded from within a zipfile, so this method may return mappings whose offset is not 0.
This method is intended to help identify the possible base address for loaded modules, but it is the caller's responsibility to determine which returned mapping is correct.
If mapping does not refer to a valid mapping, an empty vector will be returned and a message will be logged. If mapping is found but does not map a file, mapping is returned in possible_starts.
[in] | mapping | A Mapping whose series to find the start of. |
const MemoryMap::Mapping * crashpad::MemoryMap::FindMapping | ( | LinuxVMAddress | address | ) | const |
const MemoryMap::Mapping * crashpad::MemoryMap::FindMappingWithName | ( | const std::string & | name | ) | const |
bool crashpad::MemoryMap::Initialize | ( | PtraceConnection * | connection | ) |
Initializes this object with information about the mapped memory regions in the process connected via connection.
This method must be called successfully prior to calling any other method in this class. This method may only be called once.
[in] | connection | A connection to the process create a map for. |
true
on success, false
on failure with a message logged. std::unique_ptr< MemoryMap::Iterator > crashpad::MemoryMap::ReverseIteratorFrom | ( | const Mapping & | mapping | ) | const |