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

Disassembly:
sub esp, 0x1a4
mov eax, dword [0x751f00]
xor eax, esp
mov dword [esp + 0x19c], eax
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov ebp, dword [edi]
movzx esi, word [ebp + 0x180]
mov ebx, dword [ebp + 0x434]
mov ecx, dword [ebp + 0x184]
xor eax, eax
mov dword [esp + 0x24], edi
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], esi
mov dword [esp + 0x18], ecx
cmp ebx, eax
jne 0x40c892
cmp si, ax
je 0x40cb2a
push 0x80
push eax
lea edx, [esp + 0x30]
push edx
call fcn.0055e5f0
add esp, 0xc
test ebx, ebx
je 0x40cadc
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40c8b2
sub eax, edx
cmp eax, 0xff
jae 0x40cadc
push 0xff
lea eax, [esp + 0xad]
push 0
push eax
mov byte [esp + 0xb4], cl
call fcn.0055e5f0
add esp, 0xc
push 3
push ebx
push 0x71f16c
call fcn.00562b1e
add esp, 0xc
test eax, eax
jne 0x40c910
add ebx, 3
push ebx
push str.Couldnt_bind_to_interface__s
mov eax, ebp
call fcn.0040f9d0
add esp, 8
jmp 0x40cb58
push 5
push ebx
push str.host_
call fcn.00562b1e
add esp, 0xc
test eax, eax
jne 0x40c927
add ebx, 5
cmp dword [esp + 0x1bc], 2
mov esi, dword [edi + 0x348]
jne 0x40c941
mov dword [edi + 0x348], 1
lea ecx, [esp + 0x1c]
push ecx
push 0
push ebx
push edi
call fcn.0040e140
add esp, 0x10
cmp eax, 1
jne 0x40c964
lea edx, [esp + 0x1c]
push edx
call fcn.0040eb50
add esp, 4
mov dword [edi + 0x348], esi
mov edi, dword [esp + 0x1c]
test edi, edi
je 0x40caca
mov ecx, dword [edi]
push 0x100
lea esi, [esp + 0xac]
call fcn.0040dda0
mov eax, dword [edi]
mov ecx, dword [eax + 4]
mov eax, dword [esp + 0x1c0]
add esp, 4
push ecx
mov edx, esi
push edx
push eax
push ebx
push str.Name__s_family__i_resolved_to__s_family__i_n
mov ecx, ebp
call fcn.0040f940
add esp, 0x14
mov esi, ebp
call fcn.0040e2e0
cmp dword [esp + 0x1bc], 2
jne 0x40c9f9
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0xac]
push edx
call fcn.00431cb0
add esp, 8
test eax, eax
jle 0x40c9f9
mov ecx, dword [esp + 0x20]
mov eax, 2
push ecx
mov word [esp + 0x2c], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x2a], ax
mov dword [esp + 0x14], 0x10
mov esi, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x1b8]
push eax
lea ecx, [esp + 0x2c]
push ecx
push ebx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jge 0x40ca6e
lea ecx, [ecx]
mov eax, dword [esp + 0x18]
dec eax
mov dword [esp + 0x18], eax
test eax, eax
jle 0x40cb2e
movzx edx, si
push edx
push str.Bind_to_local_port__hu_failed__trying_next_n
mov ecx, ebp
call fcn.0040f940
add esp, 8
inc esi
cmp word [esp + 0x28], 2
jne 0x40ca59
push esi
call dword [sym.imp.WS2_32.dll_ntohs]
mov word [esp + 0x2a], ax
mov eax, dword [esp + 0x14]
push eax
lea ecx, [esp + 0x2c]
push ecx
push ebx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jl 0x40ca20
push 0x80
lea edx, [esp + 0xac]
push 0
push edx
mov dword [esp + 0x24], 0x80
call fcn.0055e5f0
add esp, 0xc
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0xac]
push ecx
push ebx
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jge 0x40cb0d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push edi
mov edi, esi
mov dword [ebp + 0x8700], esi
call fcn.00431bd0
add esp, 4
push eax
push esi
push str.getsockname___failed_with_errno__d:__s
jmp 0x40cb4e
push ebx
push str.Couldnt_bind_to__s
mov eax, ebp
call fcn.0040f9d0
add esp, 8
jmp 0x40cb58
cmp dword [esp + 0x1bc], 2
jne 0x40ca01
mov edx, 2
push esi
mov word [esp + 0x2c], dx
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x2a], ax
mov dword [esp + 0x14], 0x10
jmp 0x40ca01
movzx edx, si
push edx
push str.Local_port:__hu_n
mov ecx, ebp
call fcn.0040f940
add esp, 8
mov dword [edi + 0x304], 1
xor eax, eax
jmp 0x40cb5d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push edi
mov edi, esi
mov dword [ebp + 0x8700], esi
call fcn.00431bd0
add esp, 4
push eax
push esi
push str.bind_failed_with_errno__d:__s
mov eax, ebp
call fcn.0040f9d0
add esp, 0xc
mov eax, 0x2d
mov ecx, dword [esp + 0x1ac]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0055e7fd
add esp, 0x1a4
ret