How do I patch a Windows API at runtime so that it to returns 0 in x64?
- by Jorge Vasquez
In x86, I get the function address using GetProcAddress() and write a simple XOR EAX,EAX; RET; in it. Simple and effective. How do I do the same in x64?
bool DisableSetUnhandledExceptionFilter()
{
const BYTE PatchBytes[5] = { 0x33, 0xC0, 0xC2, 0x04, 0x00 }; // XOR EAX,EAX; RET;
// Obtain the address of SetUnhandledExceptionFilter
HMODULE…