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

Disassembly:
push ebp
lea ebp, [esp - 0x298]
sub esp, 0x318
mov eax, dword [0x486be4]
xor eax, ebp
mov dword [ebp + 0x294], eax
xor eax, eax
push esi
mov esi, dword [ebx]
mov dword [ebp - 0x74], eax
movzx ecx, word [esi + 0x140]
push edi
mov edi, dword [esi + 0x344]
mov dword [ebp - 0x70], ecx
mov ecx, dword [esi + 0x144]
push 0xff
push eax
mov dword [ebp - 0x78], eax
mov byte [ebp + 0x194], al
lea eax, [ebp + 0x195]
push eax
mov dword [ebp - 0x7c], ecx
call fcn.0043fc10
add esp, 0xc
test edi, edi
jne 0x421956
cmp word [ebp - 0x70], di
jne 0x421956
xor eax, eax
jmp 0x421baa
push 0x100
lea eax, [ebp + 0x94]
push 0
push eax
call fcn.0043fc10
add esp, 0xc
test edi, edi
je 0x421a8e
push edi
call fcn.0043faa0
pop ecx
cmp eax, 0xff
jae 0x421a8e
push 0x100
lea eax, [ebp + 0x194]
push eax
push edi
push dword [ebp + 0x2a4]
call fcn.0041bac6
add esp, 0x10
test eax, eax
je 0x4219c6
push dword [ebp + 0x2a4]
lea eax, [ebp + 0x194]
push eax
push edi
push str.Local_Interface__s_is_ip__s_using_address_family__i_n
push esi
call fcn.0042140e
add esp, 0x14
jmp 0x421a53
cmp dword [ebp + 0x2a4], 2
mov eax, dword [ebx + 0x20c]
mov dword [ebp - 0x80], eax
jne 0x4219e2
mov dword [ebx + 0x20c], 1
lea eax, [ebp - 0x74]
push eax
push 0
push edi
push ebx
call fcn.00419cbf
add esp, 0x10
cmp eax, 1
jne 0x421a03
lea eax, [ebp - 0x74]
push eax
push ebx
call fcn.00423624
pop ecx
pop ecx
mov eax, dword [ebp - 0x80]
mov dword [ebx + 0x20c], eax
mov eax, dword [ebp - 0x74]
test eax, eax
je 0x421a7a
push 0x100
lea ecx, [ebp + 0x194]
push ecx
push dword [eax]
call fcn.00419ad4
mov eax, dword [ebp - 0x74]
mov eax, dword [eax]
push dword [eax + 4]
lea eax, [ebp + 0x194]
push eax
push dword [ebp + 0x2a4]
push edi
push str.Name__s_family__i_resolved_to__s_family__i_n
push esi
call fcn.0042140e
push dword [ebp - 0x74]
push esi
call fcn.00419e39
add esp, 0x2c
cmp dword [ebp + 0x2a4], 2
jne 0x421ab8
lea eax, [ebp + 0x98]
push eax
lea eax, [ebp + 0x194]
push eax
push 2
call fcn.0042e027
add esp, 0xc
test eax, eax
jle 0x421ab8
jmp 0x421a97
push edi
push str.Couldnt_bind_to__s
push esi
call fcn.00421478
add esp, 0xc
jmp 0x421ba7
cmp dword [ebp + 0x2a4], 2
jne 0x421ab8
push 2
pop eax
push dword [ebp - 0x70]
mov word [ebp + 0x94], ax
call dword [sym.imp.WS2_32.dll_htons]
mov dword [ebp - 0x78], 0x10
mov word [ebp + 0x96], ax
mov edi, dword [sym.imp.WS2_32.dll_bind]
jmp 0x421afd
dec dword [ebp - 0x7c]
cmp dword [ebp - 0x7c], 0
jle 0x421b82
movzx eax, word [ebp - 0x70]
push eax
push str.Bind_to_local_port__hu_failed__trying_next_n
push esi
call fcn.0042140e
add esp, 0xc
inc dword [ebp - 0x70]
cmp word [ebp + 0x94], 2
jne 0x421afd
push dword [ebp - 0x70]
call dword [sym.imp.WS2_32.dll_ntohs]
mov word [ebp + 0x96], ax
push dword [ebp - 0x78]
lea eax, [ebp + 0x94]
push eax
push dword [ebp + 0x2a0]
call edi
test eax, eax
jl 0x421ac0
mov eax, 0x100
push eax
mov dword [ebp - 0x80], eax
lea eax, [ebp - 0x6c]
push 0
push eax
call fcn.0043fc10
add esp, 0xc
lea eax, [ebp - 0x80]
push eax
lea eax, [ebp - 0x6c]
push eax
push dword [ebp + 0x2a0]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jge 0x421b60
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
push edi
push ebx
mov dword [esi + 0x855c], edi
call fcn.0042d843
push eax
push edi
push str.getsockname___failed_with_errno__d:__s
jmp 0x421b9e
movzx eax, word [ebp - 0x70]
push eax
push str.Local_port:__hu_n
push esi
call fcn.0042140e
add esp, 0xc
mov dword [ebx + 0x1f0], 1
jmp 0x42194f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
push edi
push ebx
mov dword [esi + 0x855c], edi
call fcn.0042d843
push eax
push edi
push str.bind_failed_with_errno__d:__s
push esi
call fcn.00421478
add esp, 0x18
push 0x2d
pop eax
mov ecx, dword [ebp + 0x294]
pop edi
xor ecx, ebp
pop esi
call fcn.0043f928
add ebp, 0x298
leave
ret