Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATIntercept::Intercept
CATResult CATIntercept::Intercept ( void *  targetFunc,
void *  hookFunc,
CATUInt32  stubLength,
CATHOOK *&  newHook,
void *  userParam = 0 
)

Intercept the targetFunc so that hookFunc gets called instead. See the docs above for the CATIntercept class and the CATHOOK_PROLOGUE, CATHOOK_CALLORIGINAL, and CATHOOK_EPILOGUE macros for additional information.

Parameters:
targetFunc Ptr to the function to hook.
hookFunc Ptr to hook function to receive calls
stubLength Number of bytes (minimum of 5) to save from the target function to be executed within our hook prior to calling the target. The length MUST specify full instructions, or it will crash. Relative addressing functions will also cause crashes.
newHook On success, this is set to point to the CATHOOK struct created for hook.
userParam Optional context that will be added to CATHOOK structure.
Returns:
CATResult CAT_SUCCESS on success.

Definition at line 45 of file CATIntercept.cpp.

References CAT_ERR_HOOK_PROTECT_FAILED, CAT_SUCCESS, CATRESULT, fHooks, CATHOOK::HookFunc, CATHOOK::HookJmp, CATHOOK::HookJmpLoc, CATHOOK::InterceptObj, CATHOOK::OrgInst, CATHOOK::OrgInstLen, CATHOOK::PostPatchJump, CATHOOK::PostPatchJumpLoc, CATHOOK::PrePushHook, CATHOOK::PrePushHookAddress, CATHOOK::StackSwap1, CATHOOK::StackSwap2, CATHOOK::Target, and CATHOOK::UserParam.

Referenced by InterceptCOMObject(), InterceptDLL(), and LoadAndHook().


Generated on Mon Feb 11 04:10:36 2008 for Game Accessibility Suite by doxygen 1.5.4