GetCursorPos hook the code checks to see if this call has in fact been made by CL_CreateMove and if so it changes the return address of the CL_CreateMove call so that it returns to our post hook gateway, and then back to hw.dll.
Substitute my detours for whatever hook method you prefer. But be aware that VAC2 can "see" simple jmp call and int3 detours on imports. hook_CL_CreateMove has the same prototype as the actual CL_CreateMove from the client and is __cdecl.
code:
DWORD g_dwHW_Base = 0x01D00000;
DWORD g_dwHW_Len = 0x01100000;
DWORD g_dwClient_Base = 0x01900000;
DWORD g_dwClient_Len = 0x000AA000;
BOOL (WINAPI *tramp_GetCursorPos)(LPPOINT lpPoint);
void install_hooks(void)
{
detour *pdtgcp = new detour(GetCursorPos, detour_GetCursorPos, 5);
pdtgcp->install();
tramp_GetCursorPos = (BOOL(WINAPI*)(LPPOINT lpPoint))pdtgcp->gettrampoline();
}
size_t g_saved_cl_createmove_ra;
BOOL WINAPI detour_GetCursorPos(LPPOINT lpPoint)
{
BOOL ret = FALSE;