PsComputeSha1Virtual

Calculates a SHA-1 hash of a data block referenced by a virtual address.

Syntax

PULSE_STATUS PsComputeSha1Virtual(
 [in] PPS_ENGINE pEngine,
 [in] uint64_t PageTableAddress,
 [in] uint16_t SelectorValue,
 [in] uint64_t Offset,
 [in] uint64_t cbToRead,
 [out] PPS_SHA1_HASH pSha1Hash,
 [out, optional] uint64_t* pcbRead
);

Parameters

PPS_ENGINE pEngine

An opaque handle to an engine created by the EngCreateEngine function.

uint64_t PageTableAddress

The target page table root address. This page table is used to perform the page walk for the given address. The currently loaded page table address is in the CR3 register.

uint16_t SelectorValue

The segment selector value used to convert the virtual address into a linear address.

uint64_t Offset

The segment offset value used to convert the virtual address into a linear address.

uint64_t cbToRead

Specifies how many bytes should be hashed.

PPS_SHA1_HASH pSha1Hash

The buffer that stores the hash data.

uint64_t* pcbRead

Returns the number of bytes that were actually hashed.

Return value

If the function succeeds, the return value is PULSE_STATUS_SUCCESS.

If it fails, it returns one of the PULSE_STATUS values. Possible return codes include, but are not limited to, the following:

PULSE_STATUS_PARTIAL_READ
0x00000001
Only a portion of memory was read. Check the *pcbRead parameter value to determine how many bytes were read.
PULSE_STATUS_INSUFFICIENT_RESOURCES
0xC0000002
One of the memory allocations failed during initialization.
PULSE_STATUS_READ_FAILED
0xC0000003
Transport communication failed during a read operation.
PULSE_STATUS_WRITE_FAILED
0xC0000004
Transport communication failed during a write operation.
PULSE_STATUS_TIMEOUT
0xC0000007
Might happen if
  • Transport I/O timed out.
  • No response was received from the debuggee within the request timeout period.
PULSE_STATUS_INVALID_PARAMETER
0xC0000010
Might happen if
  • The pEngine parameter is NULL.
  • The pSha1Hash parameter is NULL.
PULSE_STATUS_INVALID_PACKET
0xC0000031
An invalid or unexpected packet was received in response.
PULSE_STATUS_INVALID_TRANSLATION
0xC0000021
Virtual to linear address translation failed. Might happen if the effective address exceeds the segment limit.
PULSE_STATUS_DEVICE_CONNECTION_LOST
0xC0000308
The connection to the transport was lost. Try restarting the engine or the transport.

Remarks

Partial reads may occur when address translation is not available beyond a certain point.