Function at 0x40f1aa
Capabilities:
Check for time delay via gettickcount

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
mov eax, dword [0x4a0590]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, ecx
mov ecx, dword [ebp + 8]
push esi
xor esi, esi
push edi
mov edi, dword [ebx]
lea ecx, [ebx + ecx*4 + 0x1ec]
mov dword [eax], esi
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x58], ecx
cmp dword [ecx], esi
je 0x40f1f2
mov dword [eax], 1
xor eax, eax
jmp 0x40f46d
call fcn.0042f5a7
mov dword [ebp - 0x4c], edx
push 1
lea edx, [ebp - 0x50]
mov dword [ebp - 0x50], eax
call fcn.0040eaf0
cmp eax, esi
pop ecx
mov dword [ebp - 0x44], eax
jge 0x40f224
push str.Connection_time_out
mov esi, edi
call fcn.00429149
pop ecx
push 0x1c
pop eax
jmp 0x40f46d
mov dword [ebp - 0x38], esi
mov eax, dword [ebp - 0x38]
lea edi, [ebx + eax*4 + 0x158]
mov eax, dword [edi]
or esi, 0xffffffff
cmp eax, esi
je 0x40f370
push 0
push eax
push esi
push esi
call fcn.00428bdb
add esp, 0x10
test eax, eax
jne 0x40f2c4
push dword [ebx + 0x230]
mov esi, dword [ebx + 0x238]
push dword [ebx + 0x22c]
push dword [ebp - 0x4c]
push dword [ebp - 0x50]
call fcn.0042f5bd
add esp, 0x10
cmp eax, esi
jl 0x40f28a
push esi
mov esi, dword [ebp - 0x40]
push str.After__ldms_connect_time__move_on__n
call fcn.004290d9
pop ecx
pop ecx
mov dword [ebp - 0x3c], 0x274c
cmp dword [ebp - 0x38], 0
jne 0x40f2fa
cmp dword [ebx + 0x54], 0
jne 0x40f2fa
push dword [ebx + 0x230]
push dword [ebx + 0x22c]
push dword [ebp - 0x4c]
push dword [ebp - 0x50]
call fcn.0042f5bd
add esp, 0x10
cmp eax, 0xc8
jl 0x40f2fa
push dword [ebp + 8]
xor eax, eax
inc eax
call fcn.0040ef3a
jmp 0x40f2f9
cmp eax, 2
jne 0x40f2eb
push dword [edi]
lea edi, [ebp - 0x3c]
call fcn.0040eeda
pop ecx
test eax, eax
jne 0x40f3b9
mov esi, dword [ebp - 0x40]
push str.Connection_failed_n
call fcn.004290d9
jmp 0x40f2f9
test al, 4
je 0x40f2fa
push dword [edi]
lea edi, [ebp - 0x3c]
call fcn.0040eeda
pop ecx
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x40f370
mov ecx, dword [ebp - 0x40]
push eax
mov dword [ecx + 0x85dc], eax
call dword [sym.imp.WS2_32.dll_WSASetLastError]
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebx + eax*4 + 0x50]
push 0x2e
lea esi, [ebp - 0x34]
call fcn.00419f91
mov edi, dword [ebp - 0x3c]
pop ecx
push ebx
call fcn.0042cb77
pop ecx
push eax
push dword [ebx + 0xb0]
mov eax, esi
mov esi, dword [ebp - 0x40]
push eax
push str.connect_to__s_port__ld_failed:__s_n
call fcn.004290d9
mov ecx, dword [ebp - 0x38]
mov eax, dword [ebx + ecx*4 + 0x50]
add esp, 0x10
cmp dword [eax + 0x1c], 0
mov eax, dword [ebp - 0x44]
je 0x40f35c
cdq
sub eax, edx
sar eax, 1
push dword [ebp + 8]
mov dword [ebx + 0x238], eax
mov eax, ecx
call fcn.0040ef3a
pop ecx
mov dword [ebp - 0x48], eax
inc dword [ebp - 0x38]
cmp dword [ebp - 0x38], 2
jl 0x40f227
cmp dword [ebp - 0x48], 0
je 0x40f46a
cmp dword [ebx + 0x54], 0
jne 0x40f3a1
push dword [ebp + 8]
xor eax, eax
inc eax
call fcn.0040ef3a
pop ecx
test eax, eax
je 0x40f1eb
cmp dword [ebx + 0x1d0], 0
je 0x40f442
mov esi, dword [ebx + 0xa8]
jmp 0x40f448
mov ecx, dword [ebp - 0x38]
mov edx, dword [ebp + 8]
mov eax, ecx
lea ecx, [ebx + ecx*4 + 0x158]
mov edi, dword [ecx]
lea edx, [ebx + edx*4 + 0x150]
mov dword [edx], edi
mov dword [ebp - 0x44], edx
mov edx, dword [ebp - 0x38]
mov edx, dword [ebx + edx*4 + 0x50]
xor eax, 1
mov dword [ebx + 0x4c], edx
lea edi, [ebx + eax*4 + 0x158]
mov dword [ecx], esi
mov eax, dword [edi]
cmp eax, esi
je 0x40f3fe
mov esi, eax
mov eax, ebx
call fcn.0040f97c
or dword [edi], 0xffffffff
push dword [ebp + 8]
mov eax, ebx
call fcn.004335de
pop ecx
test eax, eax
jne 0x40f46d
mov ecx, dword [ebp - 0x58]
inc eax
cmp dword [ebp + 8], 0
mov dword [ecx], eax
mov ecx, dword [ebp - 0x54]
mov dword [ecx], eax
jne 0x40f429
mov esi, dword [ebp - 0x40]
push 2
call fcn.004274f7
pop ecx
mov eax, dword [ebp - 0x44]
push dword [eax]
mov ecx, ebx
call fcn.0040f046
pop ecx
mov eax, ebx
call fcn.0043364e
jmp 0x40f1eb
mov esi, dword [ebx + 0x98]
mov edi, dword [ebp - 0x3c]
push ebx
call fcn.0042cb77
pop ecx
push eax
push dword [ebx + 0xb0]
push esi
mov esi, dword [ebp - 0x40]
push str.Failed_to_connect_to__s_port__ld:__s
call fcn.00429149
add esp, 0x10
mov eax, dword [ebp - 0x48]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00453655
leave
ret