DWORD GHL::GetPointer(LPVOID lpAddress, const DWORD *dwOffsetArray, const unsigned int uiArraySize)
{
DWORD dwOldProtect, dwTemp;
for (unsigned int i = 0; i<uiArraySize; i++)
{
VirtualProtect(lpAddress, uiArraySize, PAGE_EXECUTE_READWRITE, &dwOldProtect);
__try
{
dwTemp = *(DWORD*)(lpAddress);
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
dwTemp = NULL;
lpAddress = NULL;
return 0;
}
VirtualProtect(lpAddress, uiArraySize, dwOldProtect, &dwOldProtect);
lpAddress = (LPVOID)(dwTemp + dwOffsetArray[i]);
}
return (DWORD)lpAddress;
}
Author: PoZHx