The server
In Chapter 6, RE in Linux Platforms, we learned about using socket APIs to control network communication between a client and a server. The same code can be implemented for the Windows operating system. For Windows, the socket library needs to be initiated by using the WSAStartup API before using socket APIs. In comparison to Linux functions, instead of using write, send is used to send data back to the client. Also, regarding close, the equivalent of this is closesocket, which is used to free up the socket handle.
Here's a graphical representation of how a server and a client generally communicate with the use of socket APIs. Take note that the functions shown in the following diagram are Windows API functions:
The socket function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access