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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x228
mov eax, dword [0x4f9b3c]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [eax]
movzx ecx, word [edi + 0x180]
mov ebx, dword [edi + 0x39c]
mov dword [ebp - 0x218], eax
xor eax, eax
mov esi, 0xff
mov dword [ebp - 0x210], ecx
mov ecx, dword [edi + 0x184]
push esi
push eax
mov dword [ebp - 0x220], eax
mov dword [ebp - 0x21c], eax
mov byte [ebp - 0x10c], al
lea eax, [ebp - 0x10b]
push eax
mov dword [ebp - 0x224], edi
mov dword [ebp - 0x228], ecx
call fcn.00492b40
xor eax, eax
add esp, 0xc
mov dword [ebp - 0x214], eax
cmp ebx, eax
jne 0x40ca7d
cmp word [ebp - 0x210], ax
jne 0x40ca7d
xor eax, eax
jmp 0x40cd73
push 0x80
push eax
lea eax, [ebp - 0x18c]
push eax
call fcn.00492b40
add esp, 0xc
test ebx, ebx
je 0x40cc29
push ebx
call fcn.00493670
pop ecx
cmp eax, esi
jae 0x40cc29
mov esi, 0x4de274
push esi
call fcn.00493670
pop ecx
push eax
push ebx
push esi
call fcn.0049894b
add esp, 0xc
test eax, eax
jne 0x40cb06
push esi
call fcn.00493670
pop ecx
add ebx, eax
mov dword [ebp - 0x214], 1
call fcn.004288a5
xor ecx, ecx
sub eax, ecx
je 0x40cb34
dec eax
je 0x40cb2c
dec eax
jne 0x40cb50
push dword [ebp + 0x10]
lea eax, [ebp - 0x10c]
push eax
push ebx
push str.Local_Interface__s_is_ip__s_using_address_family__i_n
push edi
call fcn.0040eb9d
add esp, 0x14
jmp 0x40cbfd
mov esi, str.host_
push esi
call fcn.00493670
pop ecx
push eax
push ebx
push esi
call fcn.0049894b
add esp, 0xc
test eax, eax
jne 0x40cad7
push esi
call fcn.00493670
pop ecx
add ebx, eax
jmp 0x40cb5c
xor eax, eax
inc eax
jmp 0x40cd73
cmp dword [ebp - 0x214], ecx
je 0x40cb5c
push ebx
push str.Couldnt_bind_to_interface__s
push edi
call fcn.0040ec0a
add esp, 0xc
jmp 0x40cd70
cmp dword [ebp - 0x214], ecx
jne 0x40cc1e
cmp dword [ebp + 0x10], 2
mov esi, dword [ebp - 0x218]
mov eax, dword [esi + 0x248]
mov dword [ebp - 0x214], eax
jne 0x40cb7e
mov dword [esi + 0x248], 1
lea eax, [ebp - 0x21c]
push eax
push 0
push ebx
push esi
call fcn.0040dc44
add esp, 0x10
cmp eax, 1
jne 0x40cba1
lea eax, [ebp - 0x21c]
call fcn.0040e2db
mov eax, dword [ebp - 0x214]
mov dword [esi + 0x248], eax
mov eax, dword [ebp - 0x21c]
test eax, eax
je 0x40cc1e
mov ecx, dword [eax]
push 0x100
lea esi, [ebp - 0x10c]
call fcn.0040d99d
mov esi, dword [ebp - 0x21c]
mov eax, dword [esi]
pop ecx
push dword [eax + 4]
lea eax, [ebp - 0x10c]
push eax
push dword [ebp + 0x10]
push ebx
push str.Name__s_family__i_resolved_to__s_family__i_n
push edi
call fcn.0040eb9d
mov edi, esi
mov esi, dword [ebp - 0x224]
add esp, 0x18
call fcn.0040dd9b
mov edi, esi
cmp dword [ebp + 0x10], 2
jne 0x40cc56
lea eax, [ebp - 0x188]
push eax
lea eax, [ebp - 0x10c]
push eax
call fcn.00429035
pop ecx
pop ecx
test eax, eax
jle 0x40cc56
jmp 0x40cc2f
push ebx
push str.Couldnt_bind_to__s
jmp 0x40cb42
cmp dword [ebp + 0x10], 2
jne 0x40cc56
push 2
pop eax
push dword [ebp - 0x210]
mov word [ebp - 0x18c], ax
call dword [sym.imp.WS2_32.dll_htons]
mov dword [ebp - 0x220], 0x10
mov word [ebp - 0x18a], ax
mov esi, dword [sym.imp.WS2_32.dll_bind]
jmp 0x40ccaa
dec dword [ebp - 0x228]
cmp dword [ebp - 0x228], 0
jle 0x40cd46
movzx eax, word [ebp - 0x210]
push eax
push str.Bind_to_local_port__hu_failed__trying_next_n
push edi
call fcn.0040eb9d
add esp, 0xc
inc dword [ebp - 0x210]
cmp word [ebp - 0x18c], 2
jne 0x40ccaa
push dword [ebp - 0x210]
call dword [sym.imp.WS2_32.dll_ntohs]
mov word [ebp - 0x18a], ax
push dword [ebp - 0x220]
lea eax, [ebp - 0x18c]
push eax
push dword [ebp + 0xc]
call esi
test eax, eax
js 0x40cc5e
mov eax, 0x80
push eax
mov dword [ebp - 0x224], eax
lea eax, [ebp - 0x20c]
push 0
push eax
call fcn.00492b40
add esp, 0xc
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x20c]
push eax
push dword [ebp + 0xc]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jns 0x40cd1b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push dword [ebp - 0x218]
mov ebx, eax
mov dword [edi + 0x85f4], ebx
call fcn.00428f6a
pop ecx
push eax
push ebx
push str.getsockname___failed_with_errno__d:__s
jmp 0x40cd67
movzx eax, word [ebp - 0x210]
push eax
push str.Local_port:__hu_n
push edi
call fcn.0040eb9d
mov eax, dword [ebp - 0x218]
add esp, 0xc
mov dword [eax + 0x228], 1
jmp 0x40ca76
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push dword [ebp - 0x218]
mov ebx, eax
mov dword [edi + 0x85f4], ebx
call fcn.00428f6a
pop ecx
push eax
push ebx
push str.bind_failed_with_errno__d:__s
push edi
call fcn.0040ec0a
add esp, 0x10
push 0x2d
pop eax
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004927bf
leave
ret