the following returns a packet of zero bytes if it's bigger than 1024:
Code:
#include <stdlib.h>
#include <string.h>
#include <winsock.h>
#include <windows.h>
int __cdecl myrecvfrom(SOCKET s, u_char *buf, int len, int flags, struct sockaddr *from, int *fromlen) {
if(len > 1024) len = 0;
return(len);
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
if(fdwReason == DLL_PROCESS_ATTACH) DisableThreadLibraryCalls(hinstDLL);
return(TRUE);
}