Function at 0x409360
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebx, dword [ebp + 8]
mov dword [0x419800], 0
mov dword [0x419804], 0
mov dword [0x419808], 0
mov dword [0x41980c], 0
mov dword [esp], ebx
call sub.cygwin1.dll_inet_addr
mov dword [0x419804], eax
add eax, 1
je 0x409530
mov word [0x419800], 2
xor esi, esi
mov dword [esp + 8], 0x50
mov dword [esp + 4], ebx
mov dword [esp], 0x419190
call sub.cygwin1.dll_strncpy
movzx eax, word [0x419800]
mov dword [0x419d48], 0x419190
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.cygwin1.dll_socket
test eax, eax
mov edi, eax
js 0x4094f6
movzx eax, word [ebp + 0xc]
mov word [0x419802], ax
lea esi, [esi]
mov dword [esp + 8], 0x10
mov dword [esp + 4], 0x419800
mov dword [esp], edi
call sub.cygwin1.dll_connect
test eax, eax
jns 0x4095c3
test esi, esi
je 0x409588
mov eax, dword [esi + 0xc]
mov ebx, dword [eax + 4]
test ebx, ebx
je 0x409588
call sub.cygwin1.dll___errno
mov ebx, dword [eax]
mov eax, dword [0x419804]
mov dword [esp], eax
call sub.cygwin1.dll_inet_ntoa
mov dword [esp + 4], ebx
mov dword [esp + 8], str.connect_to_address__s
mov dword [esp], 0
mov dword [esp + 0xc], eax
call fcn.0040c930
mov edx, dword [esi + 0xc]
lea eax, [edx + 4]
mov dword [esi + 0xc], eax
movsx eax, word [esi + 0xa]
mov dword [esp + 8], eax
mov eax, dword [edx + 4]
mov dword [esp], 0x419804
mov dword [esp + 4], eax
call sub.cygwin1.dll_memmove
mov eax, dword [0x419804]
mov dword [esp], eax
call sub.cygwin1.dll_inet_ntoa
mov ebx, eax
call sub.cygwin1.dll___getreent
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Trying__s..._n
mov eax, dword [eax + 8]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov dword [esp], edi
call sub.cygwin1.dll_close
movzx eax, word [0x419800]
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.cygwin1.dll_socket
test eax, eax
mov edi, eax
jns 0x409410
call sub.cygwin1.dll___errno
mov dword [esp + 8], str.socket
mov eax, dword [eax]
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.0040c930
xor eax, eax
mov dword [0x41b114], 0xffffffff
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], ebx
call sub.cygwin1.dll_gethostbyname
test eax, eax
mov esi, eax
je 0x409791
movzx eax, word [eax + 8]
mov word [0x419800], ax
movsx eax, word [esi + 0xa]
mov dword [esp + 8], eax
mov eax, dword [esi + 0xc]
mov eax, dword [eax]
mov dword [esp], 0x419804
mov dword [esp + 4], eax
call sub.cygwin1.dll_memmove
mov dword [esp + 8], 0x50
mov eax, dword [esi]
mov dword [esp], 0x419190
mov dword [esp + 4], eax
call sub.cygwin1.dll_strncpy
jmp 0x4093cd
call sub.cygwin1.dll___errno
mov dword [esp + 8], str.connect
mov eax, dword [eax]
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.0040c930
mov dword [esp], edi
mov dword [0x41b114], 0xffffffff
call sub.cygwin1.dll_close
add esp, 0x2c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x14], 0x10
lea eax, [ebp - 0x14]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x4197f0
mov dword [esp], edi
call sub.cygwin1.dll_getsockname
test eax, eax
js 0x409700
mov dword [ebp - 0x10], 0x10
lea eax, [ebp - 0x10]
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], eax
mov dword [esp + 8], 3
mov dword [esp + 4], 0
mov dword [esp], edi
call sub.cygwin1.dll_setsockopt
test eax, eax
js 0x409740
mov dword [esp + 4], 0x41643d
mov dword [esp], edi
call sub.cygwin1.dll__fdopen64
mov dword [esp], edi
mov dword [0x419700], eax
call sub.cygwin1.dll_dup
mov dword [esp + 4], 0x41643f
mov dword [esp], eax
call sub.cygwin1.dll__fdopen64
mov ecx, dword [0x419700]
test ecx, ecx
mov dword [0x419600], eax
je 0x409712
test eax, eax
je 0x409712
mov edx, dword [0x41adc4]
test edx, edx
jne 0x4096ad
mov dword [esp], 0
call fcn.004064d0
cmp eax, 2
jle 0x4096c4
mov eax, dword [0x419700]
test eax, eax
je 0x409693
mov dword [esp], eax
call sub.cygwin1.dll_fclose
mov eax, dword [0x419600]
test eax, eax
je 0x4095a7
mov dword [esp], eax
call sub.cygwin1.dll_fclose
jmp 0x4095a7
mov eax, dword [0x419d48]
mov dword [esp], str.Connected_to__s._n
mov dword [esp + 4], eax
call sub.cygwin1.dll_printf
jmp 0x409671
mov dword [ebp - 0x18], 1
lea eax, [ebp - 0x18]
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x100
mov dword [esp + 4], 0xffff
mov dword [esp], edi
call sub.cygwin1.dll_setsockopt
test eax, eax
js 0x409764
mov eax, dword [0x419d48]
jmp 0x409521
call sub.cygwin1.dll___errno
mov dword [esp + 8], str.getsockname
jmp 0x409595
mov dword [esp + 8], str.fdopen_failed.
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.0040c930
mov eax, dword [0x419700]
test eax, eax
jne 0x40968b
jmp 0x409693
call sub.cygwin1.dll___errno
mov dword [esp + 8], str.setsockopt_TOS__ignored_
mov eax, dword [eax]
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.0040c930
jmp 0x40961f
mov eax, dword [0x41ad98]
test eax, eax
je 0x4096f6
call sub.cygwin1.dll___errno
mov dword [esp + 8], str.setsockopt
mov eax, dword [eax]
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.0040c930
jmp 0x4096f6
mov eax, dword [sym.imp.cygwin1.dll_h_errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_hstrerror
mov dword [esp + 0xc], ebx
mov dword [esp + 8], str._s:__s
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [esp + 0x10], eax
call fcn.0040c930
xor eax, eax
mov dword [0x41b114], 0xffffffff
jmp 0x409521