Crashpad
Public Member Functions | Static Public Attributes | List of all members
crashpad::internal::MemorySnapshotSanitized Class Referencefinal

A MemorySnapshot which wraps and filters sensitive information from another MemorySnapshot. More...

#include "snapshot/sanitized/memory_snapshot_sanitized.h"

Inheritance diagram for crashpad::internal::MemorySnapshotSanitized:
crashpad::MemorySnapshot

Public Member Functions

 MemorySnapshotSanitized (const MemorySnapshot *snapshot, RangeSet *ranges, bool is_64_bit)
 Constructs this object. More...
 
uint64_t Address () const override
 The base address of the memory snapshot in the snapshot process’ address space.
 
size_t Size () const override
 The size of the memory snapshot.
 
bool Read (Delegate *delegate) const override
 Calls Delegate::MemorySnapshotDelegateRead(), providing it with the memory snapshot’s data. More...
 
const MemorySnapshotMergeWithOtherSnapshot (const MemorySnapshot *other) const override
 Creates a new MemorySnapshot based on merging this one with other. More...
 

Static Public Attributes

static constexpr uint64_t kDefaced = 0x0defaced0defaced
 Redacted data is replaced with this value, casted to the appropriate size for a pointer in the target process.
 
static constexpr uint64_t kSmallWordMax = 4096
 Pointer-aligned data smaller than this value is not redacted.
 

Detailed Description

A MemorySnapshot which wraps and filters sensitive information from another MemorySnapshot.

This class redacts all data from the wrapped MemorySnapshot unless:

  1. The data is pointer aligned and points into a whitelisted address range.
  2. The data is pointer aligned and is a small integer.

Constructor & Destructor Documentation

◆ MemorySnapshotSanitized()

crashpad::internal::MemorySnapshotSanitized::MemorySnapshotSanitized ( const MemorySnapshot snapshot,
RangeSet ranges,
bool  is_64_bit 
)

Constructs this object.

Parameters
[in]snapshotThe MemorySnapshot to sanitize.
[in]rangesA set of whitelisted address ranges.
[in]is_64_bittrue if this memory is for a 64-bit process.

Member Function Documentation

◆ MergeWithOtherSnapshot()

const MemorySnapshot* crashpad::internal::MemorySnapshotSanitized::MergeWithOtherSnapshot ( const MemorySnapshot other) const
inlineoverridevirtual

Creates a new MemorySnapshot based on merging this one with other.

The ranges described by the two snapshots must either overlap or abut, and must be of the same concrete type.

Returns
A newly allocated MemorySnapshot representing the merged range, or nullptr with an error logged.

Implements crashpad::MemorySnapshot.

◆ Read()

bool crashpad::internal::MemorySnapshotSanitized::Read ( Delegate delegate) const
overridevirtual

Calls Delegate::MemorySnapshotDelegateRead(), providing it with the memory snapshot’s data.

Implementations do not necessarily read the memory snapshot data prior to this method being called. Memory snapshot data may be loaded lazily and may be discarded after being passed to the delegate. This provides clean memory management without burdening a snapshot implementation with the requirement that it track all memory region data simultaneously.

Returns
false on failure, otherwise, the return value of Delegate::MemorySnapshotDelegateRead(), which should be true on success and false on failure.

Implements crashpad::MemorySnapshot.


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