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

Disassembly:
mov eax, 0x45b32c
call fcn.0043baec
sub esp, 0x23c
push ebx
push esi
push edi
mov esi, ecx
call fcn.00407fea
test eax, eax
je 0x4088c8
push dword [ebp + 8]
lea edi, [esi + 0x28]
push edi
call fcn.0043c3a0
mov eax, dword [ebp + 0xc]
push edi
mov dword [esi + 0x128], eax
call fcn.004081da
add esp, 0xc
test eax, eax
jne 0x408849
push edi
push str.Couldnt_resolve___s_.
jmp 0x4088bf
mov eax, dword [0x47f440]
mov dword [ebp + 8], eax
push dword [esi + 0x128]
lea eax, [ebp + 8]
xor ebx, ebx
push edi
push str.CxSocket:_connect__s:_d
push eax
mov dword [ebp - 4], ebx
call fcn.0044ad19
lea eax, [ebp + 8]
push eax
push 2
push 0x30b
push str.D:Source_CodeLibrary_CodeeguardlibCxSocket.cpp
call fcn.0043304a
or dword [ebp - 4], 0xffffffff
add esp, 0x20
lea ecx, [ebp + 8]
call fcn.00450466
push ebx
push esi
call fcn.00409361
pop ecx
pop ecx
mov ecx, esi
call fcn.00408b64
push ebx
push 1
pop edi
push edi
push 2
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [esi], eax
jne 0x4088cf
mov ecx, esi
call fcn.00409315
push eax
push str.Couldnt_create_socket___d_.
push esi
call fcn.00409361
add esp, 0xc
xor eax, eax
jmp 0x408b03
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x14], edi
push ecx
push 0x8004667e
push eax
call sub.WSOCK32.dll_ioctlsocket
cmp eax, 0xffffffff
je 0x408ade
push 0x10
lea eax, [ebp - 0x40]
pop edi
push edi
push ebx
push eax
call fcn.0043bed0
add esp, 0xc
lea eax, [ebp - 0x40]
mov word [ebp - 0x40], 2
mov dword [ebp - 0x3c], ebx
push edi
push eax
push dword [esi]
mov word [ebp - 0x3e], bx
call sub.WSOCK32.dll_bind
cmp eax, 0xffffffff
jne 0x40892b
mov ecx, esi
call fcn.00409315
push eax
push str.Couldnt_bind_socket___d_.
jmp 0x408aeb
push edi
lea eax, [ebp - 0x30]
push ebx
push eax
call fcn.0043bed0
add esp, 0xc
lea eax, [esi + 0x28]
mov word [ebp - 0x30], 2
push eax
call sub.WSOCK32.dll_inet_addr
mov dword [ebp - 0x2c], eax
mov ax, word [esi + 0x128]
push eax
call sub.WSOCK32.dll_htons
mov word [ebp - 0x2e], ax
lea eax, [ebp - 0x30]
push edi
push eax
push dword [esi]
call sub.WSOCK32.dll_connect
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
cmp ecx, ebx
mov dword [ebp + 0xc], ecx
jne 0x408afb
mov ecx, esi
call fcn.00409315
cmp eax, 0x2733
jne 0x408acf
mov ecx, dword [esi + 0x1c]
push 2
pop eax
cmp ecx, eax
jg 0x408999
mov eax, ecx
mov dword [ebp + 8], eax
cmp byte [0x48124c], bl
jne 0x408abb
cmp dword [ebp + 8], ecx
jg 0x408abb
push 1
lea ecx, [ebp - 0x20]
pop edi
mov dword [ebp - 0x20], eax
mov eax, dword [esi]
push ecx
lea ecx, [ebp - 0x144]
mov dword [ebp - 0x244], eax
push ecx
lea ecx, [ebp - 0x248]
mov dword [ebp - 0x140], eax
push ecx
inc eax
push ebx
push eax
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x248], edi
mov dword [ebp - 0x144], edi
call sub.WSOCK32.dll_select
cmp eax, ebx
jle 0x408a1b
lea eax, [ebp - 0x144]
push eax
push dword [esi]
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x408a4c
lea eax, [ebp - 0x248]
push eax
push dword [esi]
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x408a21
mov dword [ebp + 0xc], edi
jmp 0x408a21
jl 0x408aa5
mov ecx, dword [esi + 0x1c]
mov eax, ecx
sub eax, dword [ebp + 8]
cmp eax, 2
jg 0x408a37
cmp eax, edi
jle 0x408a3c
cmp eax, 2
jle 0x408a3e
push 2
pop eax
jmp 0x408a3e
mov eax, edi
add dword [ebp + 8], eax
cmp dword [ebp + 0xc], ebx
je 0x40899c
jmp 0x408abb
push ebx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 4
push eax
lea eax, [ebp - 0x10]
push eax
push 0x1007
push 0xffff
push dword [esi]
call sub.WSOCK32.dll_getsockopt
cmp eax, 0xffffffff
jne 0x408a87
mov ecx, esi
call fcn.00409315
push eax
push str.CxSocket:_getsockopt_error___d_
jmp 0x408ab2
cmp dword [ebp - 0x10], ebx
je 0x408a96
push dword [ebp - 0x10]
push str.Connect_error___d_
jmp 0x408ab2
push str.Unknown_error
push esi
call fcn.00409361
pop ecx
pop ecx
jmp 0x408abb
mov ecx, esi
call fcn.00409315
push eax
push str.Select_error_connect____d_
push esi
call fcn.00409361
add esp, 0xc
cmp dword [ebp + 0xc], ebx
jne 0x408afb
push str.Connect_timed_out.
push esi
call fcn.00409361
pop ecx
pop ecx
jmp 0x408af4
mov ecx, esi
call fcn.00409315
push eax
push str.Couldnt_connect_socket___d_.
jmp 0x408aeb
mov ecx, esi
call fcn.00409315
push eax
push str.Couldnt_change_to_non_blocking_socket___d_.
push esi
call fcn.00409361
add esp, 0xc
mov ecx, esi
call fcn.00408b64
xor eax, eax
cmp dword [esi], 0xffffffff
setne al
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 8