Table of Contents

Class PointerRequest

Namespace
CStructSharp.Memory
Assembly
CStructSharp.dll

Everything a pointer resolver may need to turn stored bits into a target region: the bits, where they were found, and what is expected at the target.

public sealed record PointerRequest : IEquatable<PointerRequest>
Inheritance
PointerRequest
Implements
Inherited Members

Remarks

A resolver is the application's rule for interpreting pointers, supplied to MemorySession at construction. The session calls it only when a path takes an explicit .value step, never merely because a record contains a pointer. Common rules are: absolute address in the same space (the default), displacement from the containing record (use Container), an address in another process (return a region in that other source), or an address with tag bits (mask the documented bits before using them).

The resolver must return a region of at least TargetSize bytes; the session slices that extent and continues the path. The returned source remains owned by the application, and the original StoredPointer in the record is never modified.

Constructors

PointerRequest(StoredPointer, MemoryRegion, MemoryRegion, string, int, string, int)

Everything a pointer resolver may need to turn stored bits into a target region: the bits, where they were found, and what is expected at the target.

public PointerRequest(StoredPointer Pointer, MemoryRegion Storage, MemoryRegion Container, string TargetTypeId, int TargetSize, string Path, int Depth)

Parameters

Pointer StoredPointer

Stored bits and byte width, exactly as read from memory.

Storage MemoryRegion

Region holding the pointer bytes; its source is the address space the pointer was read from.

Container MemoryRegion

Region of the record that contains the pointer, for relative encodings.

TargetTypeId string

ID of the pointed-to type.

TargetSize int

Minimum number of bytes the returned region must cover.

Path string

The full path being resolved, for diagnostics.

Depth int

Path depth at this step, counting member, index, and pointer steps.

Remarks

A resolver is the application's rule for interpreting pointers, supplied to MemorySession at construction. The session calls it only when a path takes an explicit .value step, never merely because a record contains a pointer. Common rules are: absolute address in the same space (the default), displacement from the containing record (use Container), an address in another process (return a region in that other source), or an address with tag bits (mask the documented bits before using them).

The resolver must return a region of at least TargetSize bytes; the session slices that extent and continues the path. The returned source remains owned by the application, and the original StoredPointer in the record is never modified.

Properties

Container

Region of the record that contains the pointer, for relative encodings.

public MemoryRegion Container { get; init; }

Property Value

MemoryRegion

Depth

Path depth at this step, counting member, index, and pointer steps.

public int Depth { get; init; }

Property Value

int

Path

The full path being resolved, for diagnostics.

public string Path { get; init; }

Property Value

string

Pointer

Stored bits and byte width, exactly as read from memory.

public StoredPointer Pointer { get; init; }

Property Value

StoredPointer

Storage

Region holding the pointer bytes; its source is the address space the pointer was read from.

public MemoryRegion Storage { get; init; }

Property Value

MemoryRegion

TargetSize

Minimum number of bytes the returned region must cover.

public int TargetSize { get; init; }

Property Value

int

TargetTypeId

ID of the pointed-to type.

public string TargetTypeId { get; init; }

Property Value

string

Methods

Deconstruct(out StoredPointer, out MemoryRegion, out MemoryRegion, out string, out int, out string, out int)

public void Deconstruct(out StoredPointer Pointer, out MemoryRegion Storage, out MemoryRegion Container, out string TargetTypeId, out int TargetSize, out string Path, out int Depth)

Parameters

Pointer StoredPointer
Storage MemoryRegion
Container MemoryRegion
TargetTypeId string
TargetSize int
Path string
Depth int

Equals(PointerRequest?)

public bool Equals(PointerRequest? other)

Parameters

other PointerRequest

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(PointerRequest?, PointerRequest?)

public static bool operator ==(PointerRequest? left, PointerRequest? right)

Parameters

left PointerRequest
right PointerRequest

Returns

bool

operator !=(PointerRequest?, PointerRequest?)

public static bool operator !=(PointerRequest? left, PointerRequest? right)

Parameters

left PointerRequest
right PointerRequest

Returns

bool