Clone
2
DetourCopyPayloadToProcessEx
Brian Gianforcaro edited this page 2021-03-06 01:00:23 -08:00

DetourCopyPayloadToProcessEx

Copy a payload into a target process.

Definition

_Success_(return != NULL)
PVOID DetourCopyPayloadToProcessEx(
    _In_                     HANDLE hProcess,
    _In_                     REFGUID rguid,
    _In_reads_bytes_(cbData) LPCVOID pvData,
    _In_                     DWORD cbData
);

Parameters

hProcess
Process into which payload should be copied.
rguid
GUID of the specified payload.
pvData
Pointer to payload data.
pcbData
Size in bytes of payload data.

Return value

Returns non-NULL pointer if the payload was successfully copied to the target process.

Error codes

On failure, DetourCopyPayloadToProcessEx will return NULL. Extended error code information may be retrieved by calling GetLastError.

Remarks

DetourCopyPayloadToProcessEx operates like DetourCopyPayloadToProcess but returns a pointer to the payload in the remote process, so that code may further read or write to the payload using ReadProcessMemory or WriteProcessMemory.

Tracebld, Payload, WithDll.