Then use asCode:DWORD *hookVFunc(DWORD *vtable, int index, DWORD *newFunction) { DWORD dwOldProt, *oldFunc; VirtualProtect(&vtable[index], 4, PAGE_EXECUTE_READWRITE, &dwOldProt); oldFunc=(DWORD*)vtable[index]; vtable[index]=(DWORD)newFunction; VirtualProtect(&vtable[index], 4, dwOldProt, &dwOldProt); return oldFunc; }
Code:pReset = (oReset)HookVFunc(vTable, 16, (DWORD*)myReset);