Skip to content

DetourBinaryOpen

Brian Gianforcaro edited this page Aug 22, 2020 · 8 revisions

DetourBinaryOpen

Read the contents of a binary into memory for editing.

Definition

PDETOUR_BINARY DetourBinaryOpen(
    _In_ HANDLE hFile
);

Parameters

hFile : The handle of the binary to be opened for editing.

Return value

If successful, returns a pointer to the detours binary object; otherwise, returns NULL.

Error codes

The function sets the following error code, if appropriate. The error code may be retrieved after the function has returned by calling GetLastError.

ERROR_OUT_OF_MEMORY : Not enough memory to complete the operation.

Remarks

DetourBinaryOpen reads the contents of a Windows PE COFF binary into memory for editing.

For more information on binary editing with Detours, see Payloads and DLL Import Editing in the Detours Overview.

Related Samples

Dumpi, Impmunge, Setdll.

Clone this wiki locally