Practical Tips Take the Winsocket Fuzhou University Automation Research Institute Lin Yi ---- TCP / IP protocol is currently the main communication protocol of all network operating systems, and also the communication protocol of the Internet, the Win95 / NT platform provides TCP / IP protocol implementation function library Winsocket (WSocket.dll) Dynamic library, so you can use Winsocket to write an application system based on TCP / IP protocol. (UNIX platform provides BSD-socket) ---- In practical application development, we always want to advance special treatment when calling the normal Winsocket interface function, such as the development of VPN client software based on Win95 / NT platform When we want to apply information to encrypt the information before the sending is called before the send is called. Another application system calls the Connect function to connect requests, we need to intercept this call and insert our own authentication. Modules, only legal identities can only call the normal Connect function, rather than the Connect call. Therefore, it is necessary to develop a method of intercepting the Winsocket function call, so that before the WINSOCK normal function call, make it first adjust our identity authentication module, add the encryption module. Since the Win95 / NT platform Winsocket is provided in the Dynamic Library (DLL), it is necessary to make a variety of application systems when performing TCP / IP protocol communication, and then call our application module to implement the application. Transparency. ---- Generally intercept Dynamic Library (DLL) call, you can use HOOK (hook technology), or outsourcing DLL technology, will be renamed the original DLL library (such as a Winsock library wsock32.dll to a.dll), new A DLL library, wsocket32.dll, calls an old DLL library in the new DLL library. ---- The source code for intercepting Winsock applications implemented by Visual C is given. ZIP 4KB ---- First Winsock Library WSOCK32.DLL This name is AAA.DLL, WSOCK32.AAA ---- Use Visual C to create a DLL item WSOCK32.DLL ---- The currently added module is a log processing.