Capture WINSOCKET source code

Source: Internet
Author: User

 

 

WSOCK32.CPP

 

# Include <windows. h>

 

# Include <stdio. h>

 

Void abc (char * p) {FILE * fp = fopen ("c: z.txt", "a +"); fprintf (fp, "% s", p ); fclose (fp );}

 

// Log File

 

// The same function as the original WSOCK32.DLL library must be output.

 

 

 

HMODULE I; char aa [1000]; FARPROC a; DWORD d;

 

 

 

Int (_ stdcall * getsockopt1) (SOCKET, int, int, char *, int *);

 

U_short (_ stdcall * ntohs1) (u_short );

 

Struct hostent * (_ stdcall * gethostbyname1) (const char FAR *);

 

Int (_ stdcall * getsockname1) (SOCKET, struct sockaddr *, int *);

 

Int (_ stdcall * bind1) (SOCKET, const struct sockaddr *, int );

 

U_long (_ stdcall * htonl1) (u_long );

 

Char * (_ stdcall * inet_ntoa1) (struct in_addr );

 

Int (_ stdcall * WsControl1) (int, int );

 

Unsigned long (_ stdcall * inet_addr1) (const char FAR *);

 

Int (_ stdcall * _ WSAFDIsSet1) (SOCKET, fd_set FAR *);

 

Int (_ stdcall * WSAGetLastError1 )();

 

Int (_ stdcall * recv1) (SOCKET, char FAR *, int, int );

 

Int (_ stdcall * send1) (SOCKET, const char *, int, int );

 

Int (_ stdcall * connect1) (SOCKET, const struct sockaddr *, int );

 

Int (_ stdcall * closesockinfo1) (int );

 

Int (_ stdcall * NPLoadNameSpaces1) (int, int, int );

 

Int (_ stdcall * closesocket1) (SOCKET );

 

Int (_ stdcall * select1) (int, fd_set FAR *, const struct timeval FAR *);

 

HANDLE (_ stdcall * WSAAsyncGetHostByName1) (HWND, u_int, const char FAR *, char FAR *, int );

 

Int (_ stdcall * ioctlsocket1) (SOCKET, long, u_long FAR *);

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.