Function at 0x40c03e
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Receive data
Receive data on socket
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x208
push ebx
push esi
push edi
push dword [ebp + 0x10]
push str.OpenServerConnection_start__server_s
call fcn.00403cd5
mov esi, dword [ebp + 0xc]
or ebx, 0xffffffff
pop ecx
cmp dword [esi + 0x124], ebx
pop ecx
je 0x40c072
push esi
push dword [ebp + 8]
call fcn.0040bf9e
pop ecx
pop ecx
push 6
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
cmp eax, ebx
mov dword [esi + 0x124], eax
jne 0x40c092
push str.socket
jmp 0x40c16c
xor edi, edi
mov word [ebp - 0x10], 2
push edi
mov word [ebp - 0xe], di
call dword [sym.imp.WSOCK32.dll_htonl]
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x10]
push 0x10
push eax
push dword [esi + 0x124]
call dword [sym.imp.WSOCK32.dll_bind]
cmp eax, ebx
jne 0x40c0c8
push str.bind
jmp 0x40c16c
push dword [ebp + 0x10]
call dword [sym.imp.WSOCK32.dll_inet_addr]
cmp eax, ebx
mov dword [ebp - 0x14], eax
jne 0x40c11b
push dword [ebp + 0x10]
call dword [sym.imp.WSOCK32.dll_gethostbyname]
mov edi, eax
test edi, edi
jne 0x40c0ee
push str.gethostbyname
jmp 0x40c16c
push 0x10
lea eax, [ebp - 0x10]
push 0
push eax
call fcn.0040e090
movsx eax, word [edi + 0xa]
push eax
mov eax, dword [edi + 0xc]
push dword [eax]
lea eax, [ebp - 0xc]
push eax
call fcn.0040cbe0
mov ax, word [edi + 8]
add esp, 0x18
mov word [ebp - 0x10], ax
jmp 0x40c13f
push 0x10
lea eax, [ebp - 0x10]
push edi
push eax
call fcn.0040e090
lea eax, [ebp - 0x14]
push 4
push eax
lea eax, [ebp - 0xc]
push eax
call fcn.0040cbe0
add esp, 0x18
mov word [ebp - 0x10], 2
mov ax, word [esi + 0x1cc]
push eax
call dword [sym.imp.WSOCK32.dll_htons]
mov word [ebp - 0xe], ax
lea eax, [ebp - 0x10]
push 0x10
push eax
push dword [esi + 0x124]
call dword [sym.imp.WSOCK32.dll_connect]
cmp eax, ebx
jne 0x40c179
push str.connect
push esi
call fcn.0040b709
pop ecx
pop ecx
jmp 0x40c291
push str.Waiting_from_response_from_server
call fcn.00403cd5
pop ecx
lea eax, [ebp - 0x208]
push 0
push 0x1f4
push eax
push dword [esi + 0x124]
call dword [sym.imp.WSOCK32.dll_recv]
cmp eax, ebx
je 0x40c27a
test eax, eax
jle 0x40c27a
and byte [ebp + eax - 0x208], 0
lea eax, [ebp - 0x208]
push eax
push str.response_s
call fcn.00403cd5
lea eax, [ebp - 0x208]
push eax
call fcn.0040c9a0
add esp, 0xc
test eax, eax
jbe 0x40c22c
lea eax, [ebp - 0x208]
push eax
call fcn.0040c9a0
cmp byte [ebp + eax - 0x209], 0xa
pop ecx
je 0x40c208
lea eax, [ebp - 0x208]
push eax
call fcn.0040c9a0
cmp byte [ebp + eax - 0x209], 0xd
pop ecx
jne 0x40c22c
lea eax, [ebp - 0x208]
push eax
call fcn.0040c9a0
and byte [ebp + eax - 0x209], 0
lea eax, [ebp - 0x208]
push eax
call fcn.0040c9a0
pop ecx
pop ecx
jmp 0x40c1d6
lea eax, [ebp - 0x208]
push 0x20
push eax
call fcn.0040c8e0
mov esi, eax
pop ecx
test esi, esi
pop ecx
je 0x40c24d
and byte [esi], 0
inc esi
push esi
call fcn.00408244
pop ecx
cmp byte [ebp - 0x208], 0x32
jne 0x40c25a
xor eax, eax
jmp 0x40c293
cmp byte [ebp - 0x208], 0x35
jne 0x40c266
push esi
jmp 0x40c26b
push str.Unknown_response_received
push dword [ebp + 0x14]
call fcn.0040c700
pop ecx
pop ecx
push 0xfffffffffffffffe
pop eax
jmp 0x40c293
push str.recv
push esi
call fcn.0040b709
push esi
push dword [ebp + 8]
call fcn.0040bf9e
add esp, 0x10
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret