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

Disassembly:
sub esp, 0x23c
push ebx
push ebp
push esi
push edi
mov ebp, ecx
call fcn.004138a0
test eax, eax
jne 0x413ec2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x23c
ret 8
mov edi, dword [esp + 0x250]
push 0xff
lea eax, [ebp + 0x127]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea ebx, [ebp + 0x28]
mov edx, ecx
mov esi, edi
mov edi, ebx
mov eax, dword [esp + 0x254]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebp + 0x228], eax
call fcn.004139c0
add esp, 4
test eax, eax
jne 0x413f34
push ebx
push str.Couldnt_resolve___s_.
push ebp
call fcn.00414ec0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x23c
ret 8
xor edi, edi
push edi
push ebp
call fcn.00414ec0
add esp, 8
mov ecx, ebp
call fcn.00414270
push edi
mov esi, 2
push 1
push esi
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [ebp], eax
jne 0x413f82
mov ecx, ebp
call fcn.00414e50
push eax
push str.Couldnt_create_socket___d_.
push ebp
call fcn.00414ec0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x23c
ret 8
lea ecx, [esp + 0x24]
mov dword [esp + 0x24], 1
push ecx
push 0x8004667e
push eax
call sub.WSOCK32.dll_ioctlsocket
cmp eax, 0xffffffff
je 0x4141b4
mov ecx, dword [ebp]
xor edx, edx
mov dword [esp + 0x2c], edx
lea eax, [esp + 0x2c]
mov dword [esp + 0x30], edx
push 0x10
mov dword [esp + 0x38], edx
push eax
push ecx
mov dword [esp + 0x44], edx
mov word [esp + 0x38], si
mov dword [esp + 0x3c], edi
mov word [esp + 0x3a], di
call sub.WSOCK32.dll_bind
cmp eax, 0xffffffff
jne 0x413fea
mov ecx, ebp
call fcn.00414e50
push eax
push str.Couldnt_bind_socket___d_.
jmp 0x4141c1
xor edx, edx
push ebx
mov dword [esp + 0x18], edx
mov word [esp + 0x18], si
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], edx
call sub.WSOCK32.dll_inet_addr
mov dword [esp + 0x18], eax
mov ax, word [ebp + 0x228]
push eax
call sub.WSOCK32.dll_htons
mov edx, dword [ebp]
lea ecx, [esp + 0x14]
push 0x10
push ecx
push edx
mov word [esp + 0x22], ax
call sub.WSOCK32.dll_connect
xor ebx, ebx
cmp eax, 0xffffffff
setne bl
cmp ebx, edi
jne 0x4141d1
mov ecx, ebp
call fcn.00414e50
cmp eax, 0x2733
jne 0x4141a5
mov ecx, dword [ebp + 0x1c]
mov eax, esi
cmp ecx, esi
jg 0x41405a
mov eax, ecx
mov esi, eax
mov dl, byte [0x4344b0]
test dl, dl
jne 0x414191
cmp esi, ecx
jg 0x414191
mov ecx, 1
mov dword [esp + 0x3c], eax
mov eax, dword [ebp]
mov dword [esp + 0x148], ecx
mov dword [esp + 0x44], ecx
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x48]
lea ecx, [esp + 0x14c]
mov dword [esp + 0x150], eax
mov dword [esp + 0x4c], eax
push edx
push ecx
inc eax
push edi
push eax
mov dword [esp + 0x54], edi
call sub.WSOCK32.dll_select
cmp eax, edi
jle 0x4140e4
mov eax, dword [ebp]
lea edx, [esp + 0x44]
push edx
push eax
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x41411b
mov edx, dword [ebp]
lea ecx, [esp + 0x148]
push ecx
push edx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x4140ea
mov ebx, 1
jmp 0x4140ea
jl 0x41417b
mov ecx, dword [ebp + 0x1c]
mov eax, ecx
sub eax, esi
cmp eax, 2
jg 0x414100
cmp eax, 1
jle 0x414107
cmp eax, 2
jle 0x41410c
mov eax, 2
jmp 0x41410c
mov eax, 1
add esi, eax
cmp ebx, edi
je 0x41405c
jmp 0x4141d1
push edi
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp]
lea eax, [esp + 0x28]
lea ecx, [esp + 0x10]
push eax
push ecx
push 0x1007
push 0xffff
push edx
mov dword [esp + 0x3c], 4
call sub.WSOCK32.dll_getsockopt
cmp eax, 0xffffffff
jne 0x41415b
mov ecx, ebp
call fcn.00414e50
push eax
push str.CxSocket:_getsockopt_error___d_
jmp 0x414188
mov eax, dword [esp + 0x10]
cmp eax, edi
je 0x41416b
push eax
push str.Connect_error___d_
jmp 0x414188
push str.Unknown_error
push ebp
call fcn.00414ec0
add esp, 8
jmp 0x414191
mov ecx, ebp
call fcn.00414e50
push eax
push str.Select_error_connect____d_
push ebp
call fcn.00414ec0
add esp, 0xc
cmp ebx, edi
jne 0x4141d1
push str.Connect_timed_out.
push ebp
call fcn.00414ec0
add esp, 8
jmp 0x4141ca
mov ecx, ebp
call fcn.00414e50
push eax
push str.Couldnt_connect_socket___d_.
jmp 0x4141c1
mov ecx, ebp
call fcn.00414e50
push eax
push str.Couldnt_change_to_non_blocking_socket___d_.
push ebp
call fcn.00414ec0
add esp, 0xc
mov ecx, ebp
call fcn.00414270
mov ecx, dword [ebp]
xor eax, eax
pop edi
cmp ecx, 0xffffffff
pop esi
pop ebp
setne al
pop ebx
add esp, 0x23c
ret 8