Function at 0x401318
Capabilities:
Create tcp socket
Create udp socket
Download and write a file
Initialize winsock library
Receive and write data from server to client
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration
Start tcp server
Write file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push ecx
sub esp, 0x324
call sym.___main
lea eax, [ebp - 0x1a8]
mov dword [esp + 4], eax
mov dword [esp], 0x101
call sym._WSAStartup_8
sub esp, 8
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x401387
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x19
mov dword [esp + 4], 1
mov dword [esp], str.simplex_talk:_WSA_error._n
call sym._fwrite
mov dword [esp], 1
call sym._exit
mov dword [esp + 8], 0x10
mov dword [esp + 4], 0
lea eax, [ebp - 0x1b8]
mov dword [esp], eax
call sym._memset
mov word [ebp - 0x1b8], 2
mov dword [ebp - 0x1b4], 0
mov dword [esp], 0x1538
call sym._htons_4
sub esp, 4
mov word [sin.sin_family], ax
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call sym._socket_12
sub esp, 0xc
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jns 0x40140e
mov dword [esp], str.simplex_talk:_socket_failed.
call sym._perror
mov dword [esp], 1
call sym._exit
lea edx, [ebp - 0x1b8]
mov eax, dword [ebp - 0x14]
mov dword [esp + 8], 0x10
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._bind_12
sub esp, 0xc
test eax, eax
jns 0x40144a
mov dword [esp], str.simplex_talk:_bind_failed.
call sym._perror
mov dword [esp], 1
call sym._exit
mov eax, dword [ebp - 0x14]
mov dword [esp + 4], 5
mov dword [esp], eax
call sym._listen_8
sub esp, 8
mov dword [esp], str._simplex_talk_server__server_is_ready_in_listening_...
call sym._puts
mov dword [ebp - 0xc], 0
cmp dword [ebp - 0xc], 2
jg 0x40185a
mov dword [ebp - 0x2f4], 0x10
lea edx, [ebp - 0x1e8]
mov eax, dword [ebp - 0x14]
lea ecx, [ebp - 0x2f4]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._accept_12
sub esp, 0xc
mov dword [ebp - 0x300], eax
mov eax, dword [ebp - 0x300]
test eax, eax
jns 0x4014d1
mov dword [esp], str.simplex_talk:_accept_failed.
call sym._perror
mov dword [esp], 1
call sym._exit
mov eax, dword [ebp - 0x1e4]
mov dword [esp], eax
call sym._inet_ntoa_4
sub esp, 4
mov dword [esp + 4], eax
mov dword [esp], 0x4030cc
call sym._printf
lea eax, [ebp - 0x1e8]
lea ecx, [eax + 0x10]
mov eax, dword [ebp - 0x14]
lea edx, [ebp - 0x2f4]
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sym._accept_12
sub esp, 0xc
mov dword [ebp - 0x2fc], eax
mov eax, dword [ebp - 0x2fc]
test eax, eax
jns 0x40153f
mov dword [esp], str.simplex_talk:_accept_failed.
call sym._perror
mov dword [esp], 1
call sym._exit
mov eax, dword [ebp - 0x1e4]
mov dword [esp], eax
call sym._inet_ntoa_4
sub esp, 4
mov dword [esp + 4], eax
mov dword [esp], 0x403110
call sym._printf
lea eax, [ebp - 0x1e8]
lea ecx, [eax + 0x20]
mov eax, dword [ebp - 0x14]
lea edx, [ebp - 0x2f4]
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sym._accept_12
sub esp, 0xc
mov dword [ebp - 0x2f8], eax
mov eax, dword [ebp - 0x2f8]
test eax, eax
jns 0x4015ad
mov dword [esp], str.simplex_talk:_accept_failed.
call sym._perror
mov dword [esp], 1
call sym._exit
mov eax, dword [ebp - 0x1c4]
mov dword [esp], eax
call sym._inet_ntoa_4
sub esp, 4
mov dword [esp + 4], eax
mov dword [esp], str._simplex_talk_server__received_a_connection_from
call sym._printf
mov dword [ebp - 0x304], 0x64
jmp 0x4015db
nop
lea edx, [ebp - 0x304]
mov eax, dword [ebp - 0x300]
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x1006
mov dword [esp + 4], 0xffff
mov dword [esp], eax
call sym._setsockopt_20
sub esp, 0x14
mov eax, dword [ebp - 0x300]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x108
lea edx, [ebp - 0x2f0]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._recv_16
sub esp, 0x10
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jle 0x4016ad
mov eax, dword [ebp - 0x1f0]
mov dword [esp + 4], eax
mov dword [esp], 0x403197
call sym._printf
lea eax, [ebp - 0x2f0]
mov dword [esp + 4], eax
mov dword [esp], str._s_n_n
call sym._printf
mov dword [ebp - 0x2f4], 0x108
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x1f0]
dec eax
mov eax, dword [ebp + eax*4 - 0x300]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
lea edx, [ebp - 0x2f0]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._send_16
sub esp, 0x10
lea edx, [ebp - 0x304]
mov eax, dword [ebp - 0x2fc]
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x1006
mov dword [esp + 4], 0xffff
mov dword [esp], eax
call sym._setsockopt_20
sub esp, 0x14
mov eax, dword [ebp - 0x2fc]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x108
lea edx, [ebp - 0x2f0]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._recv_16
sub esp, 0x10
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jle 0x40177f
mov eax, dword [ebp - 0x1f0]
mov dword [esp + 4], eax
mov dword [esp], 0x4031ba
call sym._printf
lea eax, [ebp - 0x2f0]
mov dword [esp + 4], eax
mov dword [esp], str._s_n_n
call sym._printf
mov dword [ebp - 0x2f4], 0x108
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x1f0]
dec eax
mov eax, dword [ebp + eax*4 - 0x300]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
lea edx, [ebp - 0x2f0]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._send_16
sub esp, 0x10
lea edx, [ebp - 0x304]
mov eax, dword [ebp - 0x2f8]
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x1006
mov dword [esp + 4], 0xffff
mov dword [esp], eax
call sym._setsockopt_20
sub esp, 0x14
mov eax, dword [ebp - 0x2f8]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x108
lea edx, [ebp - 0x2f0]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._recv_16
sub esp, 0x10
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jle 0x4015da
mov eax, dword [ebp - 0x1f0]
mov dword [esp + 4], eax
mov dword [esp], 0x4031d8
call sym._printf
lea eax, [ebp - 0x2f0]
mov dword [esp + 4], eax
mov dword [esp], str._s_n_n
call sym._printf
mov dword [ebp - 0x2f4], 0x108
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x1f0]
dec eax
mov eax, dword [ebp + eax*4 - 0x300]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
lea edx, [ebp - 0x2f0]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._send_16
sub esp, 0x10
jmp 0x4015db
mov dword [esp], str._douple_talk_server__max_connections_achieved__server_halt
call sym._puts
call sym._WSACleanup_0
mov eax, 1
mov ecx, dword [ebp - 4]
leave
lea esp, [ecx - 4]
ret