Function at 0x413200
Capabilities:
Connect socket

Disassembly:
sub esp, 8
push ebx
push ebp
mov ebp, ecx
mov byte [esp + 0xb], 0
push esi
mov ecx, dword [ebp + 0x24]
test ecx, ecx
je 0x413224
mov eax, dword [ecx]
push 0x4802e8
push 3
push ecx
call dword [eax + 0x14]
add esp, 0xc
mov eax, dword [ebp + 0x40]
mov ecx, 2
mov esi, dword [esp + 0x1c]
push esi
mov word [eax], cx
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [ebp + 0x40]
mov ebx, dword [esp + 0x18]
push ebx
mov word [ecx + 2], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov ecx, dword [ebp + 0x40]
mov dword [ecx + 4], eax
mov ecx, ebp
call fcn.00413000
mov al, byte [ebp + 0x3c]
mov byte [esp + 0x1c], al
test al, al
je 0x41326d
push 0
mov ecx, ebp
call fcn.00409dc0
mov ecx, dword [ebp + 0x24]
push edi
mov edi, dword [esp + 0x24]
test ecx, ecx
je 0x41328a
mov eax, dword [ecx]
push edi
push esi
push ebx
push str._connecting_to__s:_d__timeout__d_msec_...__n
push ecx
call dword [eax + 0x18]
add esp, 0x14
push 0x10
push dword [ebp + 0x40]
push dword [ebp + 0x38]
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jne 0x4132bc
mov ecx, dword [ebp + 0x24]
test ecx, ecx
je 0x4133d2
mov eax, dword [ecx]
push str.connected_n
push ecx
call dword [eax + 0x18]
add esp, 8
mov bl, 1
jmp 0x41343b
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
cmp eax, 0x2734
je 0x41330e
call esi
cmp eax, 0x2733
je 0x41330e
mov ebx, dword [ebp + 0x24]
test ebx, ebx
je 0x413437
mov ebx, dword [ebx]
add ebx, 0x18
call fcn.0045fca4
mov esi, eax
call fcn.0045fca4
push dword [esi]
mov edi, eax
call fcn.0045ea98
push eax
push dword [edi]
push str._d____s__n
push dword [ebp + 0x24]
call dword [ebx]
add esp, 0x14
jmp 0x413437
call fcn.0040ac70
mov esi, eax
mov dword [esp + 0x1c], 0
add esi, edi
mov ebx, edx
mov edi, dword [esp + 0x28]
mov ecx, edi
adc ebx, 0
push 0
mov dword [esp + 0x18], ebx
call fcn.00408780
test al, al
jne 0x413437
nop dword [eax]
call fcn.0040ac70
cmp ebx, edx
jb 0x413422
ja 0x413357
cmp esi, eax
jb 0x413422
call fcn.0040ac70
mov ecx, esi
sub ecx, eax
mov eax, ebx
sbb eax, edx
test eax, eax
ja 0x41337d
jb 0x413372
cmp ecx, 0x1f4
jae 0x41337d
call fcn.0040ac70
mov ecx, esi
sub ecx, eax
jmp 0x413382
mov ecx, 0x1f4
push ecx
mov ecx, ebp
call fcn.00409fe0
mov bl, al
mov dword [esp + 0x24], 4
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x20]
push eax
push 0x1007
push 0xffff
push dword [ebp + 0x38]
call dword [sym.imp.WS2_32.dll_getsockopt]
mov eax, dword [esp + 0x1c]
test bl, bl
je 0x4133d6
test eax, eax
jne 0x4133da
mov ecx, dword [ebp + 0x24]
test ecx, ecx
je 0x4133d2
mov eax, dword [ecx]
push str.connected__n
push ecx
call dword [eax + 0x18]
add esp, 8
mov bl, 1
jmp 0x41343b
test eax, eax
je 0x4133e8
cmp eax, 0x2734
je 0x4133e8
cmp eax, 0x2733
jne 0x4133fe
push 0
mov ecx, edi
call fcn.00408780
test al, al
jne 0x413437
mov ebx, dword [esp + 0x14]
jmp 0x413340
mov esi, dword [ebp + 0x24]
test esi, esi
je 0x413437
mov esi, dword [esi]
push eax
call fcn.0045ea98
push eax
push dword [esp + 0x24]
push str.connection_error:__d____s__n
push dword [ebp + 0x24]
call dword [esi + 0x18]
add esp, 0x14
jmp 0x413437
mov ecx, dword [ebp + 0x24]
test ecx, ecx
je 0x413437
mov eax, dword [ecx]
push str.connection_timeout_n
push ecx
call dword [eax + 0x18]
add esp, 8
mov bl, byte [esp + 0x13]
cmp byte [esp + 0x20], 0
pop edi
je 0x41344c
push 1
mov ecx, ebp
call fcn.00409dc0
mov edx, dword [ebp + 0x24]
test edx, edx
je 0x413463
mov ecx, dword [edx]
push str._asyncconnect_n
push 3
push edx
call dword [ecx + 0x14]
add esp, 0xc
pop esi
pop ebp
mov al, bl
pop ebx
add esp, 8
ret 0x10