int VtblHelper::hijack(void* pObject, int index, int newMethod)
{
int** vtbl = (int**)pObject;
DWORD oldProtect = 0;
int oldMethod = (*vtbl)[index];
VirtualProtect(*vtbl, 1024, PAGE_READWRITE, &oldProtect);
(*vtbl)[index] = newMethod;
VirtualProtect(*vtbl, 1024, oldProtect, &oldProtect);
return oldMethod;
}
hook虚表