mirror of
https://github.com/Microsoft/Detours
synced 2026-06-08 11:44:51 +00:00
Page:
DetourFindPayload
Pages
DetourAllocateRegionWithinJumpBounds
DetourAttach
DetourAttachEx
DetourBinaryBywayCallback
DetourBinaryClose
DetourBinaryCommitCallback
DetourBinaryDeletePayload
DetourBinaryEditImports
DetourBinaryEnumeratePayloads
DetourBinaryFileCallback
DetourBinaryFindPayload
DetourBinaryOpen
DetourBinaryPurgePayloads
DetourBinaryResetImports
DetourBinarySetPayload
DetourBinarySymbolCallback
DetourBinaryWrite
DetourCodeFromPointer
DetourCopyPayloadToProcess
DetourCopyPayloadToProcessEx
DetourCreateProcessWithDll
DetourCreateProcessWithDllEx
DetourCreateProcessWithDlls
DetourDetach
DetourEnumerateExportCallback
DetourEnumerateExports
DetourEnumerateImports
DetourEnumerateImportsEx
DetourEnumerateModules
DetourFindFunction
DetourFindPayload
DetourFindPayloadEx
DetourFindRemotePayload
DetourFinishHelperProcess
DetourGetContainingModule
DetourGetEntryPoint
DetourGetModuleSize
DetourGetSizeOfPayloads
DetourImportFileCallback
DetourImportFuncCallback
DetourImportFuncCallbackEx
DetourIsHelperProcess
DetourRestoreAfterWith
DetourSetIgnoreTooSmall
DetourSetRetainRegions
DetourSetSystemRegionLowerBound
DetourSetSystemRegionUpperBound
DetourTransactionAbort
DetourTransactionBegin
DetourTransactionCommit
DetourTransactionCommitEx
DetourUpdateThread
FAQ
Home
OverviewHelpers
OverviewInterception
OverviewPayloads
Reference
SampleCommem
SampleCping
SampleDisas
SampleDtest
SampleDumpe
SampleDumpi
SampleDynamicAlloc
SampleEinst
SampleExcep
SampleFindFunc
SampleImpmunge
SampleMember
SamplePayload
SampleRegion
SampleSetdll
SampleSimple
SampleSlept
SampleSyelog
SampleTraceapi
SampleTracebld
SampleTracelnk
SampleTracemem
SampleTracereg
SampleTraceser
SampleTracetcp
SampleTryman
SampleWithdll
Samples
Using Detours
Clone
8
DetourFindPayload
Brian Gianforcaro edited this page 2021-03-06 00:51:42 -08:00
Table of Contents
DetourFindPayload
Return the address of the specified payload within a module.
Definition
_Writable_bytes_(*pcbData)
_Readable_bytes_(*pcbData)
_Success_(return != NULL)
PVOID DetourFindPayload(
_In_opt_ HMODULE hModule,
_In_ REFGUID rguid,
_Out_opt_ DWORD *pcbData
);
Parameters
- hModule
- Module holding the specified payload.
- rguid
GUIDof the specified payload.- pcbData
- Variable to receive the size in bytes of the specified payload.
Return value
Pointer to the specified payload or NULL if the payload doesn't exist.
Error codes
The function sets one of the following error codes if it was unable to
search the module for the target payload. The error code may be retrieved
after the function has returned by calling
GetLastError.
- ERROR_BAD_EXE_FORMAT
- The MZ header of specified module is invalid.
- ERROR_EXE_MARKED_INVALID
- The NT COFF header of the specified module is invalid.
- ERROR_INVALID_EXE_SIGNATURE
- The NT COFF header of the specified module has an invalid signature.
Remarks
DetourFindPayload returns the address of the specified payload within
a module. Payloads can either be created at compile link time, see the
Einst, or can be inserted it an existing binary using
the DetourBinarySetPayload API.
For more information on binary editing with Detours and payloads, see Payloads and DLL Import Editing in the Detours Overview.