Function at 0x40c6c0
Capabilities:
Connect socket
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x48fe2b
mov eax, dword fs:[0]
push eax
sub esp, 0x144
mov eax, dword [0x4b9430]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov esi, ecx
mov dword [ebp - 0x130], eax
mov dword [ebp - 0x12c], esi
mov dword [ebp - 0x134], 0
jmp 0x40c712
mov esi, ebx
mov eax, dword [esi + 0x114]
mov ebx, dword [ebp + 0xc]
test eax, eax
je 0x40c732
push eax
call fcn.0045d483
add esp, 4
mov dword [esi + 0x114], 0
mov edi, dword [esi + 0xe4]
xor eax, eax
mov dword [ebp - 0x128], eax
mov dword [ebp - 0x124], eax
mov dword [ebp - 0x120], eax
mov dword [ebp - 0x11c], eax
test edi, edi
je 0x40c903
push 0x4c5cdc
mov dword [ebp - 0x150], 0x4c5cdc
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
xor esi, esi
mov dword [ebp - 4], esi
mov ecx, dword [0x4c5cfc]
mov eax, dword [ecx + 4]
cmp byte [eax + 0x25], 0
mov edx, ecx
jne 0x40c799
cmp dword [eax + 0xc], edi
jae 0x40c78f
mov eax, dword [eax + 8]
jmp 0x40c793
mov edx, eax
mov eax, dword [eax]
cmp byte [eax + 0x25], 0
je 0x40c785
mov dword [ebp - 0x13c], edx
cmp edx, ecx
je 0x40c7b0
cmp edi, dword [edx + 0xc]
jb 0x40c7b0
lea eax, [ebp - 0x13c]
jmp 0x40c7bc
mov dword [ebp - 0x140], ecx
lea eax, [ebp - 0x140]
mov edi, dword [eax]
cmp ecx, edi
je 0x40c7e9
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [edi + 0x20]
cmp eax, 0x927c0
jbe 0x40c7e6
push edi
lea ecx, [ebp - 0x14c]
push ecx
push 0x4c5cf8
call fcn.0041d2b0
jmp 0x40c7e9
lea esi, [edi + 0x10]
push 0x4c5cdc
mov dword [ebp - 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
je 0x40c8fd
movzx edx, word [esi + 0xc]
mov edi, dword [sym.imp.WS2_32.dll_htons]
push edx
call edi
movzx ebx, ax
mov eax, dword [esi]
mov esi, dword [esi + 8]
cmp esi, 0xffffffff
je 0x40c8fd
push ebx
cmp eax, 0x17
jne 0x40c8c1
mov ecx, dword [ebp - 0x130]
call fcn.0040ca40
add esp, 4
mov esi, eax
cmp esi, 0xffffffff
jne 0x40c8a3
call fcn.00460a98
cmp dword [eax], 0x16
je 0x40c8a3
mov ebx, dword [ebp - 0x12c]
mov eax, dword [ebx + 0x130]
test eax, eax
je 0x40c8a3
cmp dword [eax + 0x2c], 0
jne 0x40c866
cmp dword [eax + 0x20], 0
je 0x40c8a3
mov edi, dword [ebp - 0x134]
mov eax, dword [ebx]
mov eax, dword [eax + 0x6c]
inc edi
mov dword [ebp - 0x134], edi
test eax, eax
je 0x40c898
mov ecx, dword [ebp - 0x130]
push ecx
inc eax
push eax
push edi
push str.Attempt__d_of__d_to_connect_to__s_failed._Trying_again.
push 0x2000
call fcn.004090c0
add esp, 0x14
mov edx, dword [ebx]
cmp edi, dword [edx + 0x6c]
jl 0x40c710
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0045d3b4
mov esp, ebp
pop ebp
ret
mov eax, 2
mov dword [ebp - 0x124], esi
mov word [ebp - 0x128], ax
call edi
mov ecx, dword [ebp - 0x124]
push ecx
mov word [ebp - 0x126], ax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
call fcn.004734c7
mov edx, dword [ebp - 0x12c]
mov dword [edx + 0x114], eax
jmp 0x40c967
mov esi, dword [ebp - 0x12c]
mov edi, dword [ebp - 0x130]
call fcn.0040d5a0
cmp eax, 0xffffffff
jne 0x40c92e
push str.unknown
call fcn.004734c7
add esp, 4
mov dword [esi + 0x114], eax
or esi, 0xffffffff
jmp 0x40c840
mov dword [ebp - 0x124], eax
mov eax, 2
push ebx
mov word [ebp - 0x128], ax
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [ebp - 0x124]
push ecx
mov word [ebp - 0x126], ax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
call fcn.004734c7
mov dword [esi + 0x114], eax
movzx edx, word [ebp - 0x128]
add esp, 4
push 0
mov ebx, 1
push ebx
push edx
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40c98e
or esi, eax
jmp 0x40c840
push 4
lea eax, [ebp - 0x138]
push eax
push ebx
push 6
push esi
mov dword [ebp - 0x138], ebx
call dword [sym.imp.WS2_32.dll_setsockopt]
mov edi, dword [sym.imp.WS2_32.dll_connect]
push 0x10
lea ecx, [ebp - 0x128]
push ecx
push esi
call edi
cmp eax, 0xffffffff
jne 0x40c9e8
mov edi, edi
call fcn.00460a98
cmp dword [eax], 0x2734
je 0x40c9e8
call fcn.00460a98
cmp dword [eax], 4
jne 0x40ca2c
push 0x10
lea edx, [ebp - 0x128]
push edx
push esi
call edi
cmp eax, 0xffffffff
je 0x40c9c0
lea eax, [ebp - 0x148]
push eax
push 0
lea ecx, [ebp - 0x118]
push ecx
push 0
lea edx, [esi + 1]
push edx
mov dword [ebp - 0x114], esi
mov dword [ebp - 0x118], ebx
mov dword [ebp - 0x148], 0x1e
mov dword [ebp - 0x144], 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x40c83b
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
or esi, 0xffffffff
jmp 0x40c840