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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x21c
mov eax, dword [0x65bf90]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [eax]
mov dword [ebp - 0x20c], eax
xor eax, eax
mov dword [ebp - 0x210], eax
movzx ebx, word [edi + 0x180]
mov ecx, dword [edi + 0x184]
mov esi, dword [edi + 0x39c]
push 0xff
push eax
lea edx, [ebp - 0x103]
push edx
mov dword [ebp - 0x218], eax
mov dword [ebp - 0x21c], ebx
mov dword [ebp - 0x214], ecx
mov byte [ebp - 0x104], al
call fcn.005c2720
add esp, 0xc
mov dword [ebp - 0x208], 0
test esi, esi
jne 0x497090
test bx, bx
je 0x497422
push 0x80
lea eax, [ebp - 0x184]
push 0
push eax
call fcn.005c2720
add esp, 0xc
test esi, esi
je 0x4973cd
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4970b3
sub eax, edx
cmp eax, 0xff
jae 0x4973cd
mov edx, dword [0x657014]
mov eax, edx
lea ebx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4970d2
sub eax, ebx
push eax
push esi
push edx
call fcn.005c3446
add esp, 0xc
test eax, eax
jne 0x49715f
mov eax, dword [0x657014]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4970f2
sub eax, edx
add esi, eax
mov dword [ebp - 0x208], 1
mov ebx, dword [ebp - 0x20c]
mov edx, dword [ebx + 0x88]
mov eax, dword [ebp + 0x10]
push pe_nt_image_headers32
lea ecx, [ebp - 0x104]
push ecx
push esi
push edx
push eax
call fcn.00475750
add esp, 0x14
sub eax, 0
je 0x4971bd
dec eax
je 0x4971a7
dec eax
jne 0x4971da
mov ecx, dword [ebp + 0x10]
push ecx
lea edx, [ebp - 0x104]
push edx
push esi
push str.Local_Interface__s_is_ip__s_using_address_family__i_n
push edi
call fcn.00494d10
add esp, 0x14
jmp 0x49728c
mov edx, dword [str.host_]
mov eax, edx
lea ebx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x497170
sub eax, ebx
push eax
push esi
push edx
call fcn.005c3446
add esp, 0xc
test eax, eax
jne 0x497107
mov eax, dword [str.host_]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x497194
mov ebx, dword [ebp - 0x20c]
sub eax, edx
add esi, eax
jmp 0x4971e7
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005bdb17
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x208], 0
je 0x4971e7
push esi
push str.Couldnt_bind_to_interface__s
push edi
call fcn.00494d90
add esp, 0xc
jmp 0x497460
cmp dword [ebp - 0x208], 0
jne 0x4973b9
cmp dword [ebp + 0x10], 2
mov eax, dword [ebx + 0x248]
mov dword [ebp - 0x208], eax
jne 0x497203
mov dword [ebx + 0x248], 1
lea ecx, [ebp - 0x210]
push ecx
push 0
push esi
push ebx
call fcn.0048be10
add esp, 0x10
cmp eax, 1
jne 0x49722b
lea edx, [ebp - 0x210]
push edx
push ebx
call fcn.0048b7c0
add esp, 8
mov eax, dword [ebp - 0x208]
mov dword [ebx + 0x248], eax
mov eax, dword [ebp - 0x210]
test eax, eax
je 0x4973b9
mov edx, dword [eax]
push pe_nt_image_headers32
lea ecx, [ebp - 0x104]
push ecx
push edx
call fcn.0048bae0
mov eax, dword [ebp - 0x210]
mov ecx, dword [eax]
mov edx, dword [ecx + 4]
mov ecx, dword [ebp + 0x10]
push edx
lea eax, [ebp - 0x104]
push eax
push ecx
push esi
push str.Name__s_family__i_resolved_to__s_family__i_n
push edi
call fcn.00494d10
mov edx, dword [ebp - 0x210]
push edx
push edi
call fcn.0048bfd0
add esp, 0x2c
cmp dword [ebp + 0x10], 2
jne 0x4972d8
lea eax, [ebp - 0x180]
push eax
lea ecx, [ebp - 0x104]
push ecx
push 2
call fcn.0049a6e0
add esp, 0xc
test eax, eax
jle 0x4972d8
mov eax, dword [ebp - 0x21c]
mov edx, 2
push eax
mov word [ebp - 0x184], dx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x182], ax
mov dword [ebp - 0x218], 0x10
mov ebx, dword [ebp - 0x21c]
mov edx, dword [ebp - 0x218]
mov esi, dword [ebp + 0xc]
push edx
lea eax, [ebp - 0x184]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jns 0x497359
lea ebx, [ebx]
mov eax, dword [ebp - 0x214]
dec eax
mov dword [ebp - 0x214], eax
test eax, eax
jle 0x497435
movzx ecx, bx
push ecx
push str.Bind_to_local_port__hu_failed__trying_next_n
push edi
call fcn.00494d10
add esp, 0xc
inc ebx
cmp word [ebp - 0x184], 2
jne 0x497340
push ebx
call dword [sym.imp.WS2_32.dll_ntohs]
mov word [ebp - 0x182], ax
mov edx, dword [ebp - 0x218]
push edx
lea eax, [ebp - 0x184]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
js 0x497300
push 0x80
lea ecx, [ebp - 0x204]
push 0
push ecx
mov dword [ebp - 0x214], 0x80
call fcn.005c2720
add esp, 0xc
lea edx, [ebp - 0x214]
push edx
lea eax, [ebp - 0x204]
push eax
push esi
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jns 0x497400
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [ebp - 0x20c]
mov esi, eax
push esi
push ecx
mov dword [edi + 0x85f4], esi
call fcn.0049a540
push eax
push esi
push str.getsockname___failed_with_errno__d:__s
jmp 0x497457
push esi
push str.Couldnt_bind_to__s
push edi
call fcn.00494d90
add esp, 0xc
jmp 0x497460
cmp dword [ebp + 0x10], 2
jne 0x4972de
mov ecx, 2
push ebx
mov word [ebp - 0x184], cx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x182], ax
mov dword [ebp - 0x218], 0x10
jmp 0x4972de
movzx edx, bx
push edx
push str.Local_port:__hu_n
push edi
call fcn.00494d10
mov eax, dword [ebp - 0x20c]
add esp, 0xc
mov dword [eax + 0x228], 1
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005bdb17
mov esp, ebp
pop ebp
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [ebp - 0x20c]
mov esi, eax
push esi
push ecx
mov dword [edi + 0x85f4], esi
call fcn.0049a540
push eax
push esi
push str.bind_failed_with_errno__d:__s
push edi
call fcn.00494d90
add esp, 0x18
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov eax, 0x2d
pop ebx
call fcn.005bdb17
mov esp, ebp
pop ebp
ret