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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebx, dword [esp + 0x64]
mov ebp, dword [esp + 0x60]
mov esi, dword [esp + 0x68]
mov eax, dword [ebx + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebx + 8]
mov dword [esp + 4], eax
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.cygwin1.dll_socket
mov edi, eax
cmp eax, 0xffffffff
je 0x402d9a
test ebp, ebp
je 0x402ba1
lea eax, [esp + 0x38]
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], eax
mov dword [esp + 8], 4
mov dword [esp + 4], 0xffff
mov dword [esp], edi
mov dword [esp + 0x38], 1
call sub.cygwin1.dll_setsockopt
cmp eax, 0xffffffff
je 0x402d69
mov dword [esp + 8], 0x10
mov dword [esp + 4], ebp
mov dword [esp], edi
call sub.cygwin1.dll_bind
cmp eax, 0xffffffff
je 0x402de0
mov dword [esp], edi
call fcn.004019d0
cmp eax, 0xffffffff
je 0x402d1b
test edi, edi
lea eax, [edi + 0x1f]
mov edx, 1
mov ecx, edi
cmovns eax, edi
mov dword [esp + 0x3c], 0
shl edx, cl
mov dword [esp + 0x38], 0
sar eax, 5
or dword [esp + eax*4 + 0x38], edx
mov eax, esi
mov edx, 0x10624dd3
imul edx
mov eax, esi
sar eax, 0x1f
sar edx, 6
sub edx, eax
mov eax, dword [ebx + 0x10]
mov dword [esp + 0x30], edx
imul edx, edx, 0xfffffc18
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x18]
mov dword [esp], edi
add edx, esi
mov dword [esp + 4], eax
imul edx, edx, 0x3e8
mov dword [esp + 0x34], edx
call sub.cygwin1.dll_connect
test eax, eax
jne 0x402c30
add esp, 0x4c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [esp + 0x30]
mov dword [esp + 0xc], 0
mov dword [esp + 0x10], eax
lea eax, [esp + 0x38]
mov dword [esp + 8], eax
lea eax, [edi + 1]
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.cygwin1.dll_select
test eax, eax
je 0x402dce
cmp eax, 0xffffffff
je 0x402d00
lea eax, [esp + 0x2c]
mov dword [esp + 8], 0x1007
mov dword [esp + 0x10], eax
lea eax, [esp + 0x28]
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0xffff
mov dword [esp], edi
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], 4
call sub.cygwin1.dll_getsockopt
cmp eax, 0xffffffff
je 0x402d30
mov eax, dword [esp + 0x28]
test eax, eax
je 0x402c1d
call sub.cygwin1.dll___errno
mov edx, dword [esp + 0x28]
mov dword [eax], edx
mov dword [esp], edi
call sub.cygwin1.dll_close
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov dword [esp + 8], str.could_not_connect___s__n
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x1000
mov dword [esp], 0x40b020
call sub.cygwin1.dll_snprintf
jmp 0x402d1b
mov dword [esp], edi
mov edi, 0xfffffffd
call sub.cygwin1.dll_close
call sub.cygwin1.dll___errno
cmp dword [eax], 4
je 0x402c1d
add esp, 0x4c
mov edi, 0xffffffff
pop ebx
mov eax, edi
pop esi
pop edi
pop ebp
ret
call sub.cygwin1.dll___errno
mov edi, 0xffffffff
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov dword [esp + 8], str.getsockopt_failed___s__n
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x1000
mov dword [esp], 0x40b020
call sub.cygwin1.dll_snprintf
jmp 0x402c1d
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov dword [esp + 8], str.error_setting_sockopt_to_interface___s_
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x1000
mov dword [esp], 0x40b020
call sub.cygwin1.dll_snprintf
jmp 0x402d1b
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov dword [esp + 8], str.problem_creating_socket___s_
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x1000
mov dword [esp], 0x40b020
call sub.cygwin1.dll_snprintf
jmp 0x402c1d
mov dword [esp], edi
mov edi, 0xfffffffe
call sub.cygwin1.dll_close
jmp 0x402c1d
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov dword [esp + 8], str.error_binding_to_interface___s_
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x1000
mov dword [esp], 0x40b020
call sub.cygwin1.dll_snprintf
jmp 0x402d1b