We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 736074f commit 4e4a132Copy full SHA for 4e4a132
src/Utilities/Patch.cpp
@@ -42,7 +42,9 @@ void Patch::Apply()
42
DWORD protect_flag;
43
VirtualProtect(pAddress, this->size, PAGE_EXECUTE_READWRITE, &protect_flag);
44
memcpy(pAddress, this->pData, this->size);
45
- VirtualProtect(pAddress, this->size, protect_flag, NULL);
+ VirtualProtect(pAddress, this->size, protect_flag, &protect_flag);
46
+ // NOTE: Instruction cache flush isn't required on x86. This is just to conform with Win32 API docs.
47
+ FlushInstructionCache(GetCurrentProcess(), pAddress, this->size);
48
}
49
50
void Patch::Apply_LJMP(DWORD offset, DWORD pointer)
0 commit comments