remove VirtualQuery
This commit is contained in:
parent
74cfb94717
commit
95fdd19b01
2 changed files with 8 additions and 15 deletions
10
src/mouse.c
10
src/mouse.c
|
@ -180,15 +180,11 @@ void HookIAT(HMODULE hMod, char *moduleName, char *functionName, PROC newFunctio
|
|||
_stricmp((const char *)pImport->Name, functionName) == 0)
|
||||
{
|
||||
DWORD oldProtect;
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
|
||||
if (VirtualQuery(&pFirstThunk->u1.Function, &mbi, sizeof(MEMORY_BASIC_INFORMATION)))
|
||||
if (VirtualProtect(&pFirstThunk->u1.Function, sizeof(DWORD), PAGE_READWRITE, &oldProtect))
|
||||
{
|
||||
if (VirtualProtect(mbi.BaseAddress, mbi.RegionSize, PAGE_READWRITE, &oldProtect))
|
||||
{
|
||||
pFirstThunk->u1.Function = (DWORD)newFunction;
|
||||
VirtualProtect(mbi.BaseAddress, mbi.RegionSize, oldProtect, &oldProtect);
|
||||
}
|
||||
pFirstThunk->u1.Function = (DWORD)newFunction;
|
||||
VirtualProtect(&pFirstThunk->u1.Function, sizeof(DWORD), oldProtect, &oldProtect);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue