Clone
8
DetourBinaryOpen
Brian Gianforcaro edited this page 2020-08-21 18:12:48 -07:00

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.

Dumpi, Impmunge, Setdll.