Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <Windows.h>
- #include "Hook.h"
- #pragma comment(lib, "ws2_32.lib")
- int __stdcall _recvfrom(SOCKET s, char *buf, int len, int flags, sockaddr *from, int *fromlen)
- {
- printf("niggers\n");
- return 0;
- }
- int main()
- {
- FARPROC fp = GetProcAddress(LoadLibraryA("ws2_32.dll"), "recvfrom");
- HOOK_STUB stub;
- stub.Size = 5;
- ::CreateHook32(fp, _recvfrom, &stub);
- recvfrom(NULL, NULL, 0, 0, NULL, NULL); // <- invokes _recvfrom (our hook)
- printf("hi");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement