Function at 0x413340
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 0x413364
mov eax, dword [ecx]
push 0x48d578
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.00413140
mov al, byte [ebp + 0x3c]
mov byte [esp + 0x1c], al
test al, al
je 0x4133ad
push 0
mov ecx, ebp
call fcn.0040d810
mov ecx, dword [ebp + 0x24]
push edi
mov edi, dword [esp + 0x24]
test ecx, ecx
je 0x4133ca
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 0x4133fc
mov ecx, dword [ebp + 0x24]
test ecx, ecx
je 0x413512
mov eax, dword [ecx]
push str.connected_n
push ecx
call dword [eax + 0x18]
add esp, 8
mov bl, 1
jmp 0x41357b
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
cmp eax, 0x2734
je 0x41344e
call esi
cmp eax, 0x2733
je 0x41344e
mov ebx, dword [ebp + 0x24]
test ebx, ebx
je 0x413577
mov ebx, dword [ebx]
add ebx, 0x18
call fcn.0046c419
mov esi, eax
call fcn.0046c419
push dword [esi]
mov edi, eax
call fcn.0046ad45
push eax
push dword [edi]
push str._d____s__n
push dword [ebp + 0x24]
call dword [ebx]
add esp, 0x14
jmp 0x413577
call fcn.00407550
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.0040c1d0
test al, al
jne 0x413577
nop dword [eax]
call fcn.00407550
cmp ebx, edx
jb 0x413562
ja 0x413497
cmp esi, eax
jb 0x413562
call fcn.00407550
mov ecx, esi
sub ecx, eax
mov eax, ebx
sbb eax, edx
test eax, eax
ja 0x4134bd
jb 0x4134b2
cmp ecx, 0x1f4
jae 0x4134bd
call fcn.00407550
mov ecx, esi
sub ecx, eax
jmp 0x4134c2
mov ecx, 0x1f4
push ecx
mov ecx, ebp
call fcn.0040da30
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 0x413516
test eax, eax
jne 0x41351a
mov ecx, dword [ebp + 0x24]
test ecx, ecx
je 0x413512
mov eax, dword [ecx]
push str.connected__n
push ecx
call dword [eax + 0x18]
add esp, 8
mov bl, 1
jmp 0x41357b
test eax, eax
je 0x413528
cmp eax, 0x2734
je 0x413528
cmp eax, 0x2733
jne 0x41353e
push 0
mov ecx, edi
call fcn.0040c1d0
test al, al
jne 0x413577
mov ebx, dword [esp + 0x14]
jmp 0x413480
mov esi, dword [ebp + 0x24]
test esi, esi
je 0x413577
mov esi, dword [esi]
push eax
call fcn.0046ad45
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 0x413577
mov ecx, dword [ebp + 0x24]
test ecx, ecx
je 0x413577
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 0x41358c
push 1
mov ecx, ebp
call fcn.0040d810
mov edx, dword [ebp + 0x24]
test edx, edx
je 0x4135a3
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