Function at 0x401460
Capabilities:
Connect socket
Initialize winsock library
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push esi
push ebx
push ecx
mov eax, 0x176c
call fcn.004025c8
sub esp, eax
mov ebx, ecx
call sym.___main
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x1c0], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x24], 0x200
cmp dword [ebx], 2
je 0x4014c6
mov eax, dword [ebx + 4]
mov eax, dword [eax]
mov dword [esp + 4], eax
mov dword [esp], str.usage:__s_server_name_n
call sym._printf
mov eax, 1
jmp 0x401921
lea eax, [ebp - 0x1bc]
mov dword [esp + 4], eax
mov dword [esp], 0x202
call sym._WSAStartup_8
sub esp, 8
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x401505
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], eax
mov dword [esp], str.WSAStartup_failed_with_error:__d_n
call sym._printf
mov eax, 1
jmp 0x401921
mov dword [esp + 4], str.WSAStartup_succeeded
mov dword [esp], sym.imp.libstdc_6.dll_std::cout
call sym.std::basic_ostream_char__std::char_traits_char____std::operator____std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
mov dword [esp], sym.std::basic_ostream_char__std::char_traits_char____std::endl_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char____
mov ecx, eax
call sym.std::ostream::operator___std::ostream____std::ostream__
sub esp, 4
mov dword [esp + 8], 0x20
mov dword [esp + 4], 0
lea eax, [ebp - 0x1e0]
mov dword [esp], eax
call sym._memset
mov dword [ebp - 0x1dc], 0
mov dword [ebp - 0x1d8], 1
mov dword [ebp - 0x1d4], 6
mov eax, dword [ebx + 4]
add eax, 4
mov eax, dword [eax]
lea edx, [ebp - 0x1c0]
mov dword [esp + 0xc], edx
lea edx, [ebp - 0x1e0]
mov dword [esp + 8], edx
mov dword [esp + 4], str.55555
mov dword [esp], eax
call sym._getaddrinfo_16
sub esp, 0x10
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x4015c0
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], eax
mov dword [esp], str.getaddrinfo_failed_with_error:__d_n
call sym._printf
call sym._WSACleanup_0
mov eax, 1
jmp 0x401921
mov eax, dword [ebp - 0x1c0]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x401677
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax + 0xc]
mov eax, dword [ebp - 0x20]
mov edx, dword [eax + 8]
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 4]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._socket_12
sub esp, 0xc
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x401625
call sym._WSAGetLastError_0
mov dword [esp + 4], eax
mov dword [esp], str.socket_failed_with_error:__ld_n
call sym._printf
call sym._WSACleanup_0
mov eax, 1
jmp 0x401921
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x10]
mov edx, eax
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x18]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._connect_12
sub esp, 0xc
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0xffffffff
jne 0x401676
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov dword [ebp - 0x1c], 0xffffffff
nop
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x1c]
mov dword [ebp - 0x20], eax
jmp 0x4015c9
nop
mov eax, dword [ebp - 0x1c0]
mov dword [esp], eax
call sym._freeaddrinfo_4
sub esp, 4
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x4016a9
mov dword [esp], str.Unable_to_connect_to_server_
call sym._puts
call sym._WSACleanup_0
mov eax, 1
jmp 0x401921
mov dword [esp + 4], str.Connected_
mov dword [esp], sym.imp.libstdc_6.dll_std::cout
call sym.std::basic_ostream_char__std::char_traits_char____std::operator____std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
mov dword [esp], sym.std::basic_ostream_char__std::char_traits_char____std::endl_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char____
mov ecx, eax
call sym.std::ostream::operator___std::ostream____std::ostream__
sub esp, 4
mov dword [esp + 4], str.input_message_to_send:
mov dword [esp], sym.imp.libstdc_6.dll_std::cout
call sym.std::basic_ostream_char__std::char_traits_char____std::operator____std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
mov dword [esp], sym.std::basic_ostream_char__std::char_traits_char____std::endl_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char____
mov ecx, eax
call sym.std::ostream::operator___std::ostream____std::ostream__
sub esp, 4
mov dword [esp + 4], 0x1388
lea eax, [ebp - 0x1568]
mov dword [esp], eax
mov ecx, sym.imp.libstdc_6.dll_std::cin
call sym.std::istream::getline_char__int_
sub esp, 8
lea eax, [ebp - 0x1568]
mov dword [esp], eax
call sym._strlen
lea esi, [eax + 1]
mov dword [esp], esi
call sym.operator_new___unsigned_int_
mov ebx, eax
mov edx, ebx
lea eax, [esi - 1]
test eax, eax
jns 0x40173a
call sym.___cxa_throw_bad_array_new_length
mov byte [edx], 0
add edx, 1
sub eax, 1
test eax, eax
js 0x401752
mov byte [edx], 0
add edx, 1
sub eax, 1
jmp 0x401743
mov dword [ebp - 0x2c], ebx
lea eax, [ebp - 0x1568]
mov dword [esp], eax
call sym._strlen
mov dword [esp + 8], eax
lea eax, [ebp - 0x1568]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._strncpy
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._strlen
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._send_16
sub esp, 0x10
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0xffffffff
jne 0x4017e3
call sym._WSAGetLastError_0
mov dword [esp + 4], eax
mov dword [esp], str.send_failed_with_error:__d_n
call sym._printf
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
call sym._WSACleanup_0
mov eax, 1
jmp 0x401921
mov dword [esp + 4], str.Message_successfully_sent_
mov dword [esp], sym.imp.libstdc_6.dll_std::cout
call sym.std::basic_ostream_char__std::char_traits_char____std::operator____std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
mov dword [esp], sym.std::basic_ostream_char__std::char_traits_char____std::endl_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char____
mov ecx, eax
call sym.std::ostream::operator___std::ostream____std::ostream__
sub esp, 4
cmp dword [ebp - 0x2c], 0
je 0x401819
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym.operator_delete___void_
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], eax
mov dword [esp], str.Bytes_Sent:__ld_n
call sym._printf
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._shutdown_8
sub esp, 8
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0xffffffff
jne 0x40187d
call sym._WSAGetLastError_0
mov dword [esp + 4], eax
mov dword [esp], str.shutdown_failed_with_error:__d_n
call sym._printf
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
call sym._WSACleanup_0
mov eax, 1
jmp 0x401921
mov dword [esp + 0xc], 0
mov eax, dword [ebp - 0x24]
mov dword [esp + 8], eax
lea eax, [ebp - 0x1768]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._recv_16
sub esp, 0x10
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jle 0x4018c2
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], eax
mov dword [esp], str.Bytes_received:__d_n
call sym._printf
jmp 0x4018eb
cmp dword [ebp - 0x28], 0
jne 0x4018d6
mov dword [esp], str.Connection_closed
call sym._puts
jmp 0x4018eb
call sym._WSAGetLastError_0
mov dword [esp + 4], eax
mov dword [esp], str.recv_failed_with_error:__d_n
call sym._printf
cmp dword [ebp - 0x28], 0
jle 0x4018f3
jmp 0x40187d
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
call sym._WSACleanup_0
mov eax, 0
jmp 0x401921
lea esp, [ebp - 0xc]
pop ecx
pop ebx
pop esi
pop ebp
lea esp, [ecx - 4]
ret