Created
September 4, 2020 15:12
-
-
Save bats3c/1307605236dfd0f4b781042af75cb0fd to your computer and use it in GitHub Desktop.
Hook The ETW Callback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VOID HookEtwCallback() | |
{ | |
DWORD oldProtect, oldOldProtect; | |
unsigned char boing[] = { 0x49, 0xbb, 0xde, 0xad, 0xc0, 0xde, 0xde, 0xad, 0xc0, 0xde, 0x41, 0xff, 0xe3 }; | |
*(void **)(boing + 2) = &EtwCallbackHook; | |
VirtualProtect(lpCallbackOffset, 13, PAGE_EXECUTE_READWRITE, &oldProtect); | |
memcpy(lpCallbackOffset, boing, sizeof(boing)); | |
VirtualProtect(lpCallbackOffset, 13, oldProtect, &oldOldProtect); | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment