Function at 0x40134a
Capabilities:
Connect socket
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x268
cmp dword [ebp + 0x14], 0
jle 0x40136c
mov dword [esp + 4], 0
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00401aac
mov dword [ebp - 0x10], 0
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.DLL_connect
sub esp, 0xc
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jns 0x4013b9
cmp dword [ebp - 0xc], 0xffffffff
jne 0x4013b9
call sub.WS2_32.DLL_WSAGetLastError
cmp eax, 0x2733
je 0x4013b9
mov dword [ebp - 0x248], 0xffffffff
jmp 0x4015c4
cmp dword [ebp + 0x14], 0
je 0x401591
cmp dword [ebp - 0xc], 0
je 0x401591
mov dword [ebp - 0x128], 0
mov dword [ebp - 0x244], 0
mov eax, dword [ebp - 0x128]
cmp eax, dword [ebp - 0x244]
jbe 0x40140d
mov eax, dword [ebp - 0x244]
mov eax, dword [ebp + eax*4 - 0x124]
cmp eax, dword [ebp + 8]
jne 0x401403
jmp 0x40140d
lea eax, [ebp - 0x244]
inc dword [eax]
jmp 0x4013e1
mov eax, dword [ebp - 0x128]
cmp eax, dword [ebp - 0x244]
jne 0x40143c
cmp dword [ebp - 0x128], 0x3f
ja 0x40143c
mov edx, dword [ebp - 0x244]
mov eax, dword [ebp + 8]
mov dword [ebp + edx*4 - 0x124], eax
lea eax, [ebp - 0x128]
inc dword [eax]
lea ecx, [ebp - 0x238]
lea edx, [ebp - 0x128]
mov eax, 0x104
mov dword [esp + 8], eax
mov dword [esp + 4], edx
mov dword [esp], ecx
call sub.msvcrt.dll_memcpy
mov ecx, dword [ebp + 0x14]
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, ecx
sar eax, 0x1f
sub edx, eax
mov eax, edx
mov dword [ebp - 0x240], eax
mov ecx, dword [ebp + 0x14]
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, ecx
sar eax, 0x1f
sub edx, eax
mov eax, edx
imul eax, eax, 0x3e8
sub ecx, eax
mov eax, ecx
imul eax, eax, 0x3e8
mov dword [ebp - 0x23c], eax
lea eax, [ebp - 0x240]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
lea eax, [ebp - 0x238]
mov dword [esp + 8], eax
lea eax, [ebp - 0x128]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
inc eax
mov dword [esp], eax
call sub.WS2_32.DLL_select
sub esp, 0x14
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x401508
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00401337
call sub.msvcrt.dll__errno
mov dword [eax], 0xffffffec
mov dword [ebp - 0x248], 0xffffffff
jmp 0x4015c4
lea eax, [ebp - 0x128]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.DLL___WSAFDIsSet
sub esp, 8
test eax, eax
jne 0x401542
lea eax, [ebp - 0x238]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.DLL___WSAFDIsSet
sub esp, 8
test eax, eax
jne 0x401542
jmp 0x401585
mov dword [ebp - 0x14], 4
lea eax, [ebp - 0x14]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x10]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x1007
mov dword [esp + 4], 0xffff
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.DLL_getsockopt
sub esp, 0x14
test eax, eax
jns 0x401591
mov dword [ebp - 0x248], 0xffffffff
jmp 0x4015c4
mov dword [ebp - 0x248], 0xffffffff
jmp 0x4015c4
cmp dword [ebp - 0x10], 0
je 0x4015ba
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00401337
call sub.msvcrt.dll__errno
mov edx, eax
mov eax, dword [ebp - 0x10]
mov dword [edx], eax
mov dword [ebp - 0x248], 0xffffffff
jmp 0x4015c4
mov dword [ebp - 0x248], 0
mov eax, dword [ebp - 0x248]
leave
ret