Don't unprotect the main process

This commit is contained in:
momo5502 2016-10-30 14:17:49 +01:00
parent 5fb4ba3d29
commit 18b2944d2e

View File

@ -56,11 +56,13 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l
return FALSE;
}
DWORD oldProtect;
std::uint8_t* module = reinterpret_cast<std::uint8_t*>(GetModuleHandle(NULL));
VirtualProtect(module, 0x6C73000, PAGE_EXECUTE_READWRITE, &oldProtect); // Unprotect the entire process
//VirtualProtect(module, 0x6C73000, PAGE_EXECUTE_READWRITE, &oldProtect); // Unprotect the entire process
VirtualProtect(module + 0x1000, 0x2D6000, PAGE_EXECUTE_READ, &oldProtect); // Protect the .text segment
Main::EntryPointHook.Initialize(0x6BAC0F, [] ()
{
__asm