Crashpad
|
Accesses information about mapped memory in another process. More...
#include "util/linux/memory_map.h"
Classes | |
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::vector< const Mapping * > | FindFilePossibleMmapStarts (const Mapping &mapping) const |
Find Mappings that share a Mapping's file, mapped from offset 0. More... | |
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::vector< const MemoryMap::Mapping * > crashpad::MemoryMap::FindFilePossibleMmapStarts | ( | const Mapping & | mapping | ) | const |
Find Mappings that share a Mapping's file, mapped from offset 0.
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.
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.