crashpad::ProcessSubrangeReader Class Reference

A wrapper for ProcessReaderWin that only allows a specific subrange to be read from. More...

`#include "snapshot/win/process_subrange_reader.h"`

## Public Member Functions

bool | Initialize (ProcessReaderWin *process_reader, WinVMAddress base, WinVMSize size, const std::string &name)
| Initializes the object. More...
bool | InitializeSubrange (const ProcessSubrangeReader &that, WinVMAddress base, WinVMSize size, const std::string &sub_name)
| Initializes the object to a subrange of an existing ProcessSubrangeReader. More...
bool | Is64Bit () const
WinVMAddress | Base () const
WinVMAddress | Size () const
const std::string & | name () const
bool | ReadMemory (WinVMAddress address, WinVMSize size, void *into) const
| Reads memory from the remote process. More...

## Detailed Description

A wrapper for ProcessReaderWin that only allows a specific subrange to be read from.

This class is useful to restrict reads to a specific address range, such as the address range occupied by a loaded module, or a specific section within a module.

## Member Function Documentation

## Initialize()

bool crashpad::ProcessSubrangeReader::Initialize | ( | ProcessReaderWin * | process_reader,
|  | WinVMAddress | base,
|  | WinVMSize | size,
|  | const std::string & | name
| ) |  |

Initializes the object.

Parameters

  [in] | process_reader | A reader for a remote process.
  [in] | base | The base address for the range that reads should be restricted to.
  [in] | size | The size of the range that reads should be restricted to.
  [in] | name | The range’s name, a string to be used in logged messages. This string is for diagnostic purposes.

Returns
  `true` on success, `false` on failure with a message logged. The other methods in this class must not be called unless this method or InitializeSubrange() has returned true.

## InitializeSubrange()

bool crashpad::ProcessSubrangeReader::InitializeSubrange | ( | const ProcessSubrangeReader & | that,
|  | WinVMAddress | base,
|  | WinVMSize | size,
|  | const std::string & | sub_name
| ) |  |

Initializes the object to a subrange of an existing ProcessSubrangeReader.

The subrange identified by base and size must be contained within the subrange in that.

Parameters

  [in] | that | The existing ProcessSubrangeReader to base the new object on.
  [in] | base | The base address for the range that reads should be restricted to.
  [in] | size | The size of the range that reads should be restricted to.
  [in] | sub_name | A description of the subrange, which will be appended to the name in that and used in logged messages. This string is for diagnostic purposes.

Returns
  `true` on success, `false` on failure with a message logged. The other methods in this class must not be called unless this method or Initialize() has returned true.

## ReadMemory()

bool crashpad::ProcessSubrangeReader::ReadMemory | ( | WinVMAddress | address,
|  | WinVMSize | size,
|  | void * | into
| ) |  | const

Reads memory from the remote process.

The range specified by address and size must be contained within the range that this object is permitted to read.

Parameters

  [in] | address | The address to read from.
  [in] | size | The size of data to read, in bytes.
  [out] | into | The buffer to read data into.

Returns
  `true` on success, `false` on failure with a message logged.

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

- snapshot/win/process_subrange_reader.h
- snapshot/win/process_subrange_reader.cc