Function at 0x401460
Capabilities:
Create tcp socket
Create udp socket
Get hostname
Get socket status
Initialize winsock library
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration
Start tcp server

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push ebx
push ecx
mov eax, 0x1d30
call fcn.00402680
sub esp, eax
mov ebx, ecx
call sym.___main
cmp dword [ebx], 1
jle 0x401499
mov eax, dword [ebx + 4]
add eax, 4
mov eax, dword [eax]
mov dword [esp], eax
call sym._atoi
jmp 0x40149e
mov eax, 0x22b8
mov dword [ebp - 0x18], eax
mov dword [esp], str._nInitialising_Winsock...
call sym._printf
lea eax, [ebp - 0x1f0]
mov dword [esp + 4], eax
mov dword [esp], 0x202
call sym._WSAStartup_8
sub esp, 8
test eax, eax
je 0x4014e9
call sym._WSAGetLastError_0
mov dword [esp + 4], eax
mov dword [esp], str.Failed._Error_Code_:__d
call sym._printf
mov eax, 1
jmp 0x401a59
mov dword [esp], str.Initialised.
call sym._puts
mov dword [ebp - 0x1f4], 1
mov dword [ebp - 0x1c], 0x1e
lea eax, [ebp - 0xd14]
mov dword [esp + 4], eax
mov dword [esp], 0x202
call sym._WSAStartup_8
sub esp, 8
test eax, eax
jne 0x401541
mov dword [esp + 4], 0x400
lea eax, [ebp - 0xb84]
mov dword [esp], eax
call sym._gethostname_8
sub esp, 8
call sym._WSACleanup_0
lea eax, [ebp - 0xb84]
mov dword [esp + 8], eax
mov dword [esp + 4], str.This_program_is_only_designed_for_testing_purpose_r_n_r_nWelcome_to__s_r_n_r_nEscape_Character_is_CTRL__r_n_r_n_
lea eax, [ebp - 0x1d14]
mov dword [esp], eax
call sym._sprintf
mov dword [ebp - 0x10], 0
jmp 0x40157c
mov eax, dword [ebp - 0x10]
mov dword [ebp + eax*4 - 0x26c], 0
add dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x1c]
jl 0x40156a
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call sym._socket_12
sub esp, 0xc
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0xffffffff
jne 0x4015c4
mov dword [esp], str.socket_failed
call sym._perror
mov dword [esp], 1
call sym._exit
mov dword [esp + 0x10], 4
lea eax, [ebp - 0x1f4]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 4
mov dword [esp + 4], 0xffff
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._setsockopt_20
sub esp, 0x14
test eax, eax
jns 0x401610
mov dword [esp], str.setsockopt
call sym._perror
mov dword [esp], 1
call sym._exit
mov word [ebp - 0x27c], 2
mov dword [ebp - 0x278], 0
mov eax, dword [ebp - 0x18]
movzx eax, ax
mov dword [esp], eax
call sym._htons_4
sub esp, 4
mov word [ebp - 0x27a], ax
mov dword [esp + 8], 0x10
lea eax, [ebp - 0x27c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._bind_12
sub esp, 0xc
cmp eax, 0xffffffff
jne 0x401678
mov dword [esp], str.bind_failed
call sym._perror
mov dword [esp], 1
call sym._exit
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], eax
mov dword [esp], str.Listener_on_port__d__n
call sym._printf
mov dword [esp + 4], 3
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._listen_8
sub esp, 8
test eax, eax
jns 0x4016bd
mov dword [esp], str.listen
call sym._perror
mov dword [esp], 1
call sym._exit
mov dword [ebp - 0x1d18], 0x10
mov dword [esp], str.Waiting_for_connections_...
call sym._puts
lea eax, [ebp - 0x784]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x40]
mov dword [eax], 0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x784]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
cmp eax, 0x3f
ja 0x40173a
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym.___WSAFDIsSet_8
sub esp, 8
test eax, eax
jne 0x40173a
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
lea ecx, [eax + 1]
mov edx, dword [ebp - 0x34]
mov dword [edx], ecx
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x30]
mov dword [edx + eax*4 + 4], ecx
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], 0
jmp 0x4017c3
mov eax, dword [ebp - 0x10]
mov eax, dword [ebp + eax*4 - 0x26c]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jle 0x4017b1
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x44], eax
lea eax, [ebp - 0x784]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x48]
mov eax, dword [eax]
cmp eax, 0x3f
ja 0x4017b1
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x48]
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x50]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call sym.___WSAFDIsSet_8
sub esp, 8
test eax, eax
jne 0x4017b1
mov eax, dword [ebp - 0x48]
mov eax, dword [eax]
lea ecx, [eax + 1]
mov edx, dword [ebp - 0x48]
mov dword [edx], ecx
mov edx, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x44]
mov dword [edx + eax*4 + 4], ecx
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x14]
jle 0x4017bf
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x14], eax
add dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x1c]
jl 0x401749
mov eax, dword [ebp - 0x14]
lea edx, [eax + 1]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
lea eax, [ebp - 0x784]
mov dword [esp + 4], eax
mov dword [esp], edx
call sym._select_20
sub esp, 0x14
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jns 0x401825
call sym.__errno
mov eax, dword [eax]
cmp eax, 0x2714
je 0x401825
mov dword [esp], str.select_error
call sym._printf
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x784]
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x54]
mov dword [esp], eax
call sym.___WSAFDIsSet_8
sub esp, 8
test eax, eax
je 0x4018ff
lea eax, [ebp - 0x1d18]
mov dword [esp + 8], eax
lea eax, [ebp - 0x27c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._accept_12
sub esp, 0xc
mov dword [ebp - 0xc], eax
movzx eax, word [ebp - 0x27a]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
movzx ebx, ax
mov eax, dword [ebp - 0x278]
mov dword [esp], eax
call sym._inet_ntoa_4
sub esp, 4
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0xc]
mov dword [esp + 4], eax
mov dword [esp], str.New_connection___socket_fd_is__d___ip_is_:__s___port_:__d__n
call sym._printf
mov dword [ebp - 0x10], 0
jmp 0x4018f7
mov eax, dword [ebp - 0x10]
mov eax, dword [ebp + eax*4 - 0x26c]
test eax, eax
jne 0x4018f3
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
mov dword [ebp + eax*4 - 0x26c], edx
mov eax, dword [ebp - 0x10]
mov dword [esp + 4], eax
mov dword [esp], str.Adding_to_list_of_sockets_as__d_n
call sym._printf
jmp 0x4018ff
add dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x1c]
jl 0x4018c3
mov dword [ebp - 0x10], 0
jmp 0x401a48
mov eax, dword [ebp - 0x10]
mov eax, dword [ebp + eax*4 - 0x26c]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x5c], eax
lea eax, [ebp - 0x784]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x60]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x5c]
mov dword [esp], eax
call sym.___WSAFDIsSet_8
sub esp, 8
test eax, eax
je 0x401a44
mov eax, dword [ebp - 0x28]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x400
lea edx, [ebp - 0x67d]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._recv_16
sub esp, 0x10
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x4019f2
mov eax, dword [ebp - 0x28]
lea edx, [ebp - 0x1d18]
mov dword [esp + 8], edx
lea edx, [ebp - 0x27c]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._getpeername_12
sub esp, 0xc
movzx eax, word [ebp - 0x27a]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
movzx ebx, ax
mov eax, dword [ebp - 0x278]
mov dword [esp], eax
call sym._inet_ntoa_4
sub esp, 4
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov dword [esp], str.Host_disconnected___ip__s___port__d__n
call sym._printf
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [ebp + eax*4 - 0x26c], 0
jmp 0x401a44
lea eax, [ebp - 0x1d14]
mov dword [esp], eax
call sym._strlen
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x1d14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._send_16
sub esp, 0x10
mov ebx, eax
lea eax, [ebp - 0x1d14]
mov dword [esp], eax
call sym._strlen
cmp ebx, eax
je 0x401a44
mov dword [esp], str.send
call sym._perror
add dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x1c]
jl 0x40190b
jmp 0x4016d3
lea esp, [ebp - 8]
pop ecx
pop ebx
pop ebp
lea esp, [ecx - 4]
ret