Function at 0x40b9d0
Capabilities:
Get local ipv4 addresses
Get socket information
Resolve dns
Set socket configuration
Write file on windows

Disassembly:
push edi
push esi
push ebx
sub esp, 0x20
mov eax, dword [sym.imp.cygwin1.dll___stack_chk_guard]
mov dword [esp + 0x1c], eax
xor eax, eax
mov ebx, dword [esp + 0x30]
mov ecx, dword [ebx + 0x24]
mov eax, dword [ebx + 0x18]
mov edx, dword [ebx + 0x10]
sub eax, dword [ebx + 0x1c]
sub edx, dword [ebx + 8]
sar eax, 2
sar edx, 2
add eax, edx
mov edx, ecx
sub edx, dword [ebx + 0x14]
sar edx, 2
cmp ecx, 1
adc edx, 0xffffffff
shl edx, 7
add eax, edx
cmp eax, 1
jbe 0x40baf0
call fcn.0041ea90
sub eax, dword [ebx + 0x140]
mov ecx, 0xea60
sbb edx, dword [ebx + 0x144]
mov esi, eax
xor eax, eax
cmp ecx, esi
sbb eax, edx
jb 0x40bb10
mov edx, dword [ebx + 0x10]
mov eax, dword [ebx + 8]
mov edi, dword [ebx + 0x24]
mov esi, dword [ebx + 0x18]
mov ecx, edx
sub esi, dword [ebx + 0x1c]
sub ecx, eax
sar esi, 2
sar ecx, 2
add esi, ecx
mov ecx, edi
sub ecx, dword [ebx + 0x14]
sar ecx, 2
cmp edi, 1
adc ecx, 0xffffffff
shl ecx, 7
add esi, ecx
lea ecx, [esi - 0xb]
cmp ecx, 0x7ffffffe
ja 0x40baf0
sub esi, 0xa
xor edi, edi
jmp 0x40baa0
call sub.cygwin1.dll_close
test eax, eax
jne 0x40bbe7
mov eax, dword [ebx + 8]
add edi, 1
add eax, 4
mov dword [ebx + 8], eax
cmp esi, edi
je 0x40baf0
mov edx, dword [ebx + 0x10]
mov ecx, dword [eax]
sub edx, 4
mov dword [esp], ecx
cmp eax, edx
jne 0x40ba80
call sub.cygwin1.dll_close
test eax, eax
jne 0x40bbe7
mov dword [esp + 4], 0x200
mov eax, dword [ebx + 0xc]
add edi, 1
mov dword [esp], eax
call sub.cygstdc_6.dll_operator_delete_void__unsigned_int_
mov eax, dword [ebx + 0x14]
lea edx, [eax + 4]
mov eax, dword [eax + 4]
mov dword [ebx + 0x14], edx
lea edx, [eax + 0x200]
mov dword [ebx + 0xc], eax
mov dword [ebx + 0x10], edx
mov dword [ebx + 8], eax
cmp esi, edi
jne 0x40ba9d
nop
mov eax, dword [esp + 0x1c]
sub eax, dword [sym.imp.cygwin1.dll___stack_chk_guard]
jne 0x40bbec
add esp, 0x20
pop ebx
pop esi
pop edi
ret
mov edx, dword [ebx + 0x10]
mov eax, dword [ebx + 8]
mov edi, dword [ebx + 0x24]
mov esi, dword [ebx + 0x18]
mov ecx, edx
sub esi, dword [ebx + 0x1c]
sub ecx, eax
sar esi, 2
sar ecx, 2
add esi, ecx
mov ecx, edi
sub ecx, dword [ebx + 0x14]
sar ecx, 2
cmp edi, 1
adc ecx, 0xffffffff
shl ecx, 7
add esi, ecx
lea edi, [esi - 1]
test edi, edi
jle 0x40ba6a
xor esi, esi
jmp 0x40bb70
call sub.cygwin1.dll_close
test eax, eax
jne 0x40bbe7
mov eax, dword [ebx + 8]
add esi, 1
mov edx, dword [ebx + 0x10]
add eax, 4
mov dword [ebx + 8], eax
cmp edi, esi
je 0x40bbba
mov ecx, dword [eax]
sub edx, 4
mov dword [esp], ecx
cmp eax, edx
jne 0x40bb50
call sub.cygwin1.dll_close
test eax, eax
jne 0x40bbe7
mov dword [esp + 4], 0x200
mov eax, dword [ebx + 0xc]
add esi, 1
mov dword [esp], eax
call sub.cygstdc_6.dll_operator_delete_void__unsigned_int_
mov eax, dword [ebx + 0x14]
lea edx, [eax + 4]
mov eax, dword [eax + 4]
mov dword [ebx + 0x14], edx
lea edx, [eax + 0x200]
mov dword [ebx + 0xc], eax
mov dword [ebx + 0x10], edx
mov dword [ebx + 8], eax
cmp edi, esi
jne 0x40bb70
mov ecx, dword [ebx + 0x24]
mov esi, ecx
sub esi, dword [ebx + 0x14]
sar esi, 2
cmp ecx, 1
mov ecx, dword [ebx + 0x18]
adc esi, 0xffffffff
sub ecx, dword [ebx + 0x1c]
sar ecx, 2
shl esi, 7
add esi, ecx
mov ecx, edx
sub ecx, eax
sar ecx, 2
add esi, ecx
jmp 0x40ba6a
call fcn.0040b630
call sub.cygwin1.dll___stack_chk_fail
nop
lea esi, [esi]
lea esi, [esi]
push ebx
sub esp, 0x18
mov eax, dword [sym.imp.cygwin1.dll___stack_chk_guard]
mov dword [esp + 0xc], eax
xor eax, eax
mov ebx, dword [esp + 0x20]
call fcn.0041ea90
mov dword [ebx + 0x140], eax
mov dword [ebx + 0x144], edx
mov eax, dword [esp + 0xc]
sub eax, dword [sym.imp.cygwin1.dll___stack_chk_guard]
jne 0x40bc35
add esp, 0x18
pop ebx
ret
call sub.cygwin1.dll___stack_chk_fail
lea esi, [esi]