Function at 0x414fd0
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.00414940
test eax, eax
jne 0x414ff2
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.00414ac0
add esp, 4
test eax, eax
jne 0x415064
push ebx
push str.Couldnt_resolve___s_.
push ebp
call fcn.00415ff0
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.00415ff0
add esp, 8
mov ecx, ebp
call fcn.004153a0
push edi
mov esi, 2
push 1
push esi
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [ebp], eax
jne 0x4150b2
mov ecx, ebp
call fcn.00415f80
push eax
push str.Couldnt_create_socket___d_.
push ebp
call fcn.00415ff0
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 0x4152e4
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 0x41511a
mov ecx, ebp
call fcn.00415f80
push eax
push str.Couldnt_bind_socket___d_.
jmp 0x4152f1
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 0x415301
mov ecx, ebp
call fcn.00415f80
cmp eax, 0x2733
jne 0x4152d5
mov ecx, dword [ebp + 0x1c]
mov eax, esi
cmp ecx, esi
jg 0x41518a
mov eax, ecx
mov esi, eax
mov dl, byte [0x4338b0]
test dl, dl
jne 0x4152c1
cmp esi, ecx
jg 0x4152c1
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 0x415214
mov eax, dword [ebp]
lea edx, [esp + 0x44]
push edx
push eax
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x41524b
mov edx, dword [ebp]
lea ecx, [esp + 0x148]
push ecx
push edx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x41521a
mov ebx, 1
jmp 0x41521a
jl 0x4152ab
mov ecx, dword [ebp + 0x1c]
mov eax, ecx
sub eax, esi
cmp eax, 2
jg 0x415230
cmp eax, 1
jle 0x415237
cmp eax, 2
jle 0x41523c
mov eax, 2
jmp 0x41523c
mov eax, 1
add esi, eax
cmp ebx, edi
je 0x41518c
jmp 0x415301
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 0x41528b
mov ecx, ebp
call fcn.00415f80
push eax
push str.CxSocket:_getsockopt_error___d_
jmp 0x4152b8
mov eax, dword [esp + 0x10]
cmp eax, edi
je 0x41529b
push eax
push str.Connect_error___d_
jmp 0x4152b8
push str.Unknown_error
push ebp
call fcn.00415ff0
add esp, 8
jmp 0x4152c1
mov ecx, ebp
call fcn.00415f80
push eax
push str.Select_error_connect____d_
push ebp
call fcn.00415ff0
add esp, 0xc
cmp ebx, edi
jne 0x415301
push str.Connect_timed_out.
push ebp
call fcn.00415ff0
add esp, 8
jmp 0x4152fa
mov ecx, ebp
call fcn.00415f80
push eax
push str.Couldnt_connect_socket___d_.
jmp 0x4152f1
mov ecx, ebp
call fcn.00415f80
push eax
push str.Couldnt_change_to_non_blocking_socket___d_.
push ebp
call fcn.00415ff0
add esp, 0xc
mov ecx, ebp
call fcn.004153a0
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