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

Disassembly:
push ebp
mov ebp, esp
lea eax, [ebp - 0x198]
push esi
push ebx
sub esp, 0x1b0
mov dword [esp + 4], eax
mov dword [esp], 2
call sub.WS2_32.DLL_WSAStartup
sub esp, 8
inc eax
je 0x401901
mov dword [esp], 2
xor eax, eax
mov esi, 1
mov dword [esp + 4], esi
mov dword [esp + 8], eax
call sub.WS2_32.DLL_socket
movsx edx, byte [0x4050f0]
sub esp, 0xc
mov ebx, dword [sym.imp.msvcrt.dll___mb_cur_max]
mov esi, eax
cmp dword [ebx], 1
je 0x4018e2
mov dword [esp], edx
mov eax, 0x103
mov dword [esp + 4], eax
call sub.msvcrt.dll__isctype
test eax, eax
jne 0x4018b9
mov dword [esp], 0x4050f0
call sub.WS2_32.DLL_inet_addr
mov dword [ebp - 0x1a4], eax
sub esp, 4
mov edx, 2
mov dword [esp + 8], edx
mov eax, 4
lea ebx, [ebp - 0x1a4]
mov dword [esp + 4], eax
mov dword [esp], ebx
call sub.WS2_32.DLL_gethostbyaddr
sub esp, 0xc
test eax, eax
je 0x4019ab
movzx edx, word [0x4050d4]
mov ecx, 2
lea ebx, [ebp - 0x1a8]
mov word [ebp - 0x1a8], cx
mov dword [esp], edx
call sub.WS2_32.DLL_ntohs
mov word [ebp - 0x1a6], ax
sub esp, 4
mov eax, 0x10
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [esp], esi
call sub.WS2_32.DLL_connect
sub esp, 0xc
inc eax
je 0x40193c
call fcn.004013f0
mov dword [esp], esi
mov ecx, dword [0x405020]
xor ebx, ebx
mov dword [esp + 0xc], ebx
mov edx, dword [0x405024]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
call sub.WS2_32.DLL_send
sub esp, 0x10
inc eax
je 0x401975
mov edx, dword [0x405024]
mov dword [esp], edx
call sub.msvcrt.dll_free
mov ebx, dword [0x405020]
mov dword [esp], ebx
call sub.msvcrt.dll_malloc
mov ebx, eax
mov eax, dword [0x405020]
xor ecx, ecx
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
mov dword [esp], ebx
call sub.msvcrt.dll_memset
mov dword [esp + 4], ebx
mov eax, dword [0x405020]
xor edx, edx
mov dword [esp + 0xc], edx
mov dword [esp], esi
mov dword [esp + 8], eax
call sub.WS2_32.DLL_recv
sub esp, 0x10
inc eax
je 0x401992
mov byte [0x405028], 0x30
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
mov ecx, eax
xor edx, edx
jmp 0x40187f
movzx eax, byte [edx + ebx]
mov byte [edx + 0x405029], al
inc edx
cmp edx, ecx
jl 0x401874
mov dword [esp], 0x405028
call sub.msvcrt.dll_strlen
cmp byte [eax + 0x405027], 0x20
je 0x4018f8
mov dword [esp], ebx
call sub.msvcrt.dll_free
mov dword [esp], esi
call sub.WS2_32.DLL_closesocket
sub esp, 4
call sub.WS2_32.DLL_WSACleanup
xor eax, eax
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret
mov dword [esp], 0x4050f0
call sub.WS2_32.DLL_gethostbyname
sub esp, 4
test eax, eax
je 0x4019c7
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
mov dword [ebp - 0x1a4], eax
jmp 0x40178a
mov ebx, dword [sym.imp.msvcrt.dll__pctype]
mov ecx, dword [ebx]
movzx eax, word [ecx + edx*2]
and eax, 0x103
jmp 0x401742
mov byte [eax + 0x405027], 0
jmp 0x401898
mov ecx, 0x10
mov edx, str.X_FORCE
mov eax, str.WinSock_version_error__nPlease_review_your_installation_and_settings.
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov ebx, dword [0x40501c]
mov dword [esp], ebx
call sub.USER32.dll_MessageBoxA
sub esp, 0x10
call sub.WS2_32.DLL_WSACleanup
mov eax, 0xffffffff
jmp 0x4018b2
mov ebx, str.X_FORCE
mov eax, 0x10
mov dword [esp + 8], ebx
mov ebx, str.Error_while_connecting_to_socket__nMake_sure_the_DCPFLICS_server_is_running_and_properly_configured.
mov dword [esp + 0xc], eax
mov dword [esp + 4], ebx
mov ebx, dword [0x40501c]
mov dword [esp], ebx
call sub.USER32.dll_MessageBoxA
sub esp, 0x10
mov dword [esp], esi
call sub.WS2_32.DLL_closesocket
sub esp, 4
jmp 0x40192d
mov ecx, 0x10
mov edx, str.X_FORCE
mov eax, str.Error_while_sending_data_to_server__nMaybe_DCPFLICS_version_is_wrong.
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
jmp 0x401957
mov eax, 0x10
mov ecx, str.X_FORCE
mov ebx, str.Error_while_receiving_data_from_server__nPlease_review_your_installation_and_settings.
mov dword [esp + 0xc], eax
mov dword [esp + 8], ecx
jmp 0x401953
mov ecx, 0x10
mov esi, str.X_FORCE
mov eax, str.Error__host_not_found__nPlease_check_that_the_host_IP_is_correct.
mov dword [esp + 0xc], ecx
mov dword [esp + 8], esi
jmp 0x401918
mov ecx, 0x10
mov esi, str.X_FORCE
mov edx, str.Error__host_not_found__nPlease_check_that_the_host_name_is_correct.
mov dword [esp + 0xc], ecx
mov dword [esp + 8], esi
mov dword [esp + 4], edx
jmp 0x40191c