Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <Windows.h>
- void Overwrite(DWORD Target, DWORD New)
- {
- DWORD old;
- VirtualProtect(Target, 7, PAGE_EXECUTE_READWRITE, &old);
- unsigned char* oldfunc = (unsigned char*)Target;
- oldfunc[0] = 0xb8;
- oldfunc[1] = New & 0xff;
- oldfunc[2] = (New >> 8) & 0xff;
- oldfunc[3] = (New >> 16) & 0xff;
- oldfunc[4] = (New >> 24) & 0xff;
- oldfunc[5] = 0xff;
- oldfunc[6] = 0xe0;
- }
- void main() {
- puts("Is deadbeef?");
- Overwrite(&puts, 0xDEADBEEF);
- puts("YES!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement