Function at 0x40e770
Capabilities:
Get local ipv4 addresses
Get socket information

Disassembly:
sub esp, 0x198
mov eax, dword [0x6c6f60]
xor eax, esp
mov dword [esp + 0x194], eax
mov eax, dword [esp + 0x19c]
push ebx
push ebp
push esi
xor ebp, ebp
push edi
mov edi, dword [eax]
mov dword [esp + 0x14], ebp
movzx ebx, word [edi + 0x180]
mov esi, dword [edi + 0x3a4]
mov dword [esp + 0x10], eax
mov eax, dword [edi + 0x184]
mov dword [esp + 0x18], ebp
mov dword [esp + 0x20], ebx
mov dword [esp + 0x1c], eax
cmp esi, ebp
jne 0x40e7c7
cmp bx, bp
je 0x40eb28
push 0x80
lea ecx, [esp + 0x28]
push ebp
push ecx
call fcn.005e3180
add esp, 0xc
cmp esi, ebp
je 0x40ead7
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40e7e7
sub eax, edx
cmp eax, 0xff
jae 0x40ead7
push 0xff
lea edx, [esp + 0xa9]
push ebp
push edx
mov byte [esp + 0xb0], cl
call fcn.005e3180
mov edx, dword [0x6be350]
mov eax, edx
add esp, 0xc
xor ebx, ebx
lea ebp, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40e825
sub eax, ebp
push eax
push esi
push edx
call fcn.005f7e40
add esp, 0xc
test eax, eax
jne 0x40e8b2
mov eax, dword [0x6be350]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40e845
sub eax, edx
add esi, eax
mov ebx, 1
mov ecx, dword [esp + 0x10]
mov edx, dword [ecx + 0x88]
mov ebp, dword [esp + 0x1b4]
push 0x100
lea eax, [esp + 0xa8]
push eax
mov eax, dword [esp + 0x1c0]
push esi
push edx
push eax
push ebp
call sym.Setup.exe_libssh2_trace
add esp, 0x18
sub eax, 0
je 0x40e8fb
sub eax, 1
je 0x40e8f1
sub eax, 1
jne 0x40e913
push ebp
lea ecx, [esp + 0xa8]
push ecx
push esi
push str.Local_Interface__s_is_ip__s_using_address_family__i_n
push edi
call fcn.0040c560
add esp, 0x14
jmp 0x40e9c1
mov edx, dword [str.host_]
mov eax, edx
lea ebp, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40e8c0
sub eax, ebp
push eax
push esi
push edx
call fcn.005f7e40
add esp, 0xc
test eax, eax
jne 0x40e855
mov eax, dword [str.host_]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40e8e4
sub eax, edx
add esi, eax
jmp 0x40e91b
mov eax, 1
jmp 0x40eb5a
test ebx, ebx
je 0x40e91b
push esi
push str.Couldnt_bind_to_interface__s
push edi
call fcn.0040c5f0
add esp, 0xc
jmp 0x40eb55
test ebx, ebx
jne 0x40eac6
cmp dword [esp + 0x1b4], 2
mov edx, dword [esp + 0x10]
mov ebp, dword [edx + 0x26c]
mov ebx, edx
jne 0x40e93b
mov dword [ebx + 0x26c], 1
lea eax, [esp + 0x14]
push eax
push 0
push esi
push ebx
call fcn.00403150
add esp, 0x10
cmp eax, 1
jne 0x40e95f
lea ecx, [esp + 0x14]
push ecx
push ebx
call fcn.00401ea0
add esp, 8
mov eax, dword [esp + 0x14]
mov dword [ebx + 0x26c], ebp
test eax, eax
je 0x40eac6
mov eax, dword [eax]
push 0x100
lea edx, [esp + 0xa8]
push edx
push eax
call fcn.00402e60
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
mov edx, dword [esp + 0x1c0]
push eax
lea ecx, [esp + 0xb4]
push ecx
push edx
push esi
push str.Name__s_family__i_resolved_to__s_family__i_n
push edi
call fcn.0040c560
mov eax, dword [esp + 0x38]
push eax
push edi
call fcn.00403300
mov ebp, dword [esp + 0x1e0]
add esp, 0x2c
cmp ebp, 2
jne 0x40e9ff
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0xa8]
push edx
push ebp
call fcn.00411d60
add esp, 0xc
test eax, eax
jle 0x40e9ff
mov ecx, dword [esp + 0x20]
mov eax, ebp
push ecx
mov word [esp + 0x28], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x26], ax
mov dword [esp + 0x18], 0x10
mov ebx, dword [esp + 0x20]
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x1b0]
mov esi, dword [sym.imp.WS2_32.dll_bind]
push eax
lea ecx, [esp + 0x28]
push ecx
push ebp
call esi
test eax, eax
jge 0x40ea6a
mov eax, dword [esp + 0x1c]
dec eax
mov dword [esp + 0x1c], eax
test eax, eax
jle 0x40eb2c
movzx edx, bx
push edx
push str.Bind_to_local_port__hu_failed__trying_next_n
push edi
call fcn.0040c560
add esp, 0xc
inc ebx
cmp word [esp + 0x24], 2
jne 0x40ea59
push ebx
call dword [sym.imp.WS2_32.dll_ntohs]
mov word [esp + 0x26], ax
mov eax, dword [esp + 0x18]
push eax
lea ecx, [esp + 0x28]
push ecx
push ebp
call esi
test eax, eax
jl 0x40ea21
push 0x80
lea edx, [esp + 0xa8]
push 0
push edx
mov dword [esp + 0x28], 0x80
call fcn.005e3180
add esp, 0xc
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0xa8]
push ecx
push ebp
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jge 0x40eb08
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [esp + 0x10]
mov esi, eax
push esi
push edx
mov dword [edi + 0x8614], esi
call fcn.00411bc0
push eax
push esi
push str.getsockname___failed_with_errno__d:__s
jmp 0x40eb4c
push esi
push str.Couldnt_bind_to__s
push edi
call fcn.0040c5f0
add esp, 0xc
jmp 0x40eb55
cmp dword [esp + 0x1b4], 2
jne 0x40ea03
mov edx, 2
push ebx
mov word [esp + 0x28], dx
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x26], ax
mov dword [esp + 0x18], 0x10
jmp 0x40ea03
movzx eax, bx
push eax
push str.Local_port:__hu_n
push edi
call fcn.0040c560
mov ecx, dword [esp + 0x1c]
add esp, 0xc
mov dword [ecx + 0x24c], 1
xor eax, eax
jmp 0x40eb5a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [esp + 0x10]
mov esi, eax
push esi
push edx
mov dword [edi + 0x8614], esi
call fcn.00411bc0
push eax
push esi
push str.bind_failed_with_errno__d:__s
push edi
call fcn.0040c5f0
add esp, 0x18
mov eax, 0x2d
mov ecx, dword [esp + 0x1a4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.005c978e
add esp, 0x198
ret