Advertisement
hejmus

Untitled

Jul 21st, 2011
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. int __stdcall recv(SOCKET s, char *buf, int len, int flags)
  2. {
  3.   struct _WSABUF Buffers; // [sp+0h] [bp-8h]@1
  4.  
  5.   Buffers.len = len;
  6.   Buffers.buf = buf;
  7.   buf = (char *)flags;
  8.   if ( WSARecv(s, &Buffers, 1u, (LPDWORD)&len, (LPDWORD)&buf, 0, 0) == -1 )
  9.   {
  10.     len = -1;
  11.   }
  12.   else
  13.   {
  14.     if ( (unsigned __int16)buf & 0x8000 )
  15.     {
  16.       len = -len;
  17.       SetLastError(0x2738u);
  18.     }
  19.   }
  20.   return len;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement