Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Utilities/Patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ void Patch::Apply()
DWORD protect_flag;
VirtualProtect(pAddress, this->size, PAGE_EXECUTE_READWRITE, &protect_flag);
memcpy(pAddress, this->pData, this->size);
VirtualProtect(pAddress, this->size, protect_flag, NULL);
VirtualProtect(pAddress, this->size, protect_flag, &protect_flag);
// NOTE: Instruction cache flush isn't required on x86. This is just to conform with Win32 API docs.
FlushInstructionCache(GetCurrentProcess(), pAddress, this->size);
}

void Patch::Apply_LJMP(DWORD offset, DWORD pointer)
Expand Down