PAGE_GUARD VEH Hooking
Let's build the even stealthier VEH trick: PAGE_GUARD VEH Hooking 🚀
📚 What's the idea?
Instead of crashing (which can be noisy), we:
✅ Protect a memory page with PAGE_GUARD — a special memory protection that triggers an exception on first access.
✅ Set a VEH handler that catches the exception.
✅ Redirect execution silently — without crashing the process.
→ No crash, no error dialogs, nothing obvious!
🛠️ Full PAGE_GUARD VEH Hook Demo (C++)
#include <windows.h> #include <iostream> void MyShellcode() { MessageBoxA(NULL, "PAGE_GUARD VEH Hook triggered!", "Hello World", MB_OK); } LONG WINAPI MyVEH(EXCEPTION_POINTERS* ExceptionInfo) { if (ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION) { #ifdef _WIN64 ExceptionInfo->ContextRecord->Rip = (DWORD64)MyShellcode; #else ExceptionInfo->ContextRecord->Eip = (DWORD)MyShellcode;
Comments
Post a Comment