Guest User

Detours.h

a guest
Apr 8th, 2010
3,418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #pragma once
  2.  
  3. namespace Detours
  4. {
  5.     enum DETOUR_RESULT
  6.     {
  7.         DETOURED_OK,
  8.         ERROR_TRAMPOLINE_MISSING,
  9.         ERROR_INVALID_FUNCTION_BODY,
  10.         ERROR_INSUFFICIENT_MEMORY,
  11.         ERROR_UNEXPECTED_FAILURE,
  12.         ERROR_CODE_INJECTION_FAILED
  13.     };
  14.  
  15.     /* Set hook to function pointed with lpFunc, so all requests for it will be redirected to function pointed with lpDetour.
  16.      * To call original function should use functon pointer in lppOriginalFunctionTrampoline.
  17.      * T is hooked function type. */
  18.     DETOUR_RESULT HookFunction(void* lpFunc, void* lpDetour, void** lppOriginalFunctionTrampoline);
  19.  
  20.     /* Removes hook from the function pointed with lpFunc. This address is same that use in HookFunction
  21.      * T is Unhooked function type. */
  22.     void UnhookFunction(void* lpFunc);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment