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

Disassembly:
sub esp, 0x214
mov eax, dword [0x704dd8]
xor eax, esp
mov dword [esp + 0x210], eax
push ebp
push esi
mov esi, dword [ebx]
push edi
xor eax, eax
mov dword [esp + 0xc], eax
mov ecx, dword [esi + 0x144]
movzx ebp, word [esi + 0x140]
mov edi, dword [esi + 0x350]
push 0xff
push eax
lea edx, [esp + 0x125]
push edx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x24], ecx
mov byte [esp + 0x128], al
call fcn.004e9ba0
add esp, 0xc
test edi, edi
jne 0x51b194
test bp, bp
je 0x51b413
push 0x80
lea eax, [esp + 0x20]
push 0
push eax
call fcn.004e9ba0
add esp, 0xc
test edi, edi
je 0x51b306
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x51b1b5
sub eax, edx
cmp eax, 0xff
jae 0x51b306
mov edx, dword [esp + 0x228]
push 0x100
lea ecx, [esp + 0x120]
push ecx
push edi
push edx
call fcn.00416fe0
add esp, 0x10
test eax, eax
je 0x51b211
mov eax, dword [esp + 0x228]
push eax
lea ecx, [esp + 0x120]
push ecx
push edi
push str.Local_Interface__s_is_ip__s_using_address_family__i_n
push esi
call fcn.0051ab30
add esp, 0x14
jmp 0x51b2b2
cmp dword [esp + 0x228], 2
mov edx, dword [ebx + 0x218]
mov dword [esp + 0x14], edx
jne 0x51b22f
mov dword [ebx + 0x218], 1
lea eax, [esp + 0xc]
push eax
push 0
push edi
push ebx
call fcn.00510bc0
add esp, 0x10
cmp eax, 1
jne 0x51b253
lea ecx, [esp + 0xc]
push ecx
push ebx
call fcn.00510600
add esp, 8
mov eax, dword [esp + 0xc]
test eax, eax
mov edx, dword [esp + 0x14]
mov dword [ebx + 0x218], edx
je 0x51b2f2
mov edx, dword [eax]
push 0x100
lea ecx, [esp + 0x120]
push ecx
push edx
call fcn.00510980
mov eax, dword [esp + 0x18]
mov ecx, dword [eax]
mov edx, dword [ecx + 4]
mov ecx, dword [esp + 0x234]
push edx
lea eax, [esp + 0x12c]
push eax
push ecx
push edi
push str.Name__s_family__i_resolved_to__s_family__i_n
push esi
call fcn.0051ab30
mov edx, dword [esp + 0x30]
push edx
push esi
call fcn.00510db0
add esp, 0x2c
mov edi, 2
cmp dword [esp + 0x228], edi
jne 0x51b32b
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x120]
push ecx
push edi
call fcn.0051fa60
add esp, 0xc
test eax, eax
jle 0x51b32b
push ebp
mov word [esp + 0x20], di
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x1e], ax
mov edi, 0x10
jmp 0x51b32f
push edi
push str.Couldnt_bind_to__s
push esi
call fcn.0051abc0
add esp, 0xc
jmp 0x51b452
cmp dword [esp + 0x228], 2
jne 0x51b32b
push ebp
mov word [esp + 0x20], 2
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x1e], ax
mov dword [esp + 0x10], 0x10
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x224]
push edi
lea edx, [esp + 0x20]
push edx
push eax
call dword [sym.imp.WSOCK32.dll_bind]
test eax, eax
jge 0x51b39b
mov eax, dword [esp + 0x18]
sub eax, 1
test eax, eax
mov dword [esp + 0x18], eax
jle 0x51b42d
movzx ecx, bp
push ecx
push str.Bind_to_local_port__hu_failed__trying_next_n
push esi
call fcn.0051ab30
add esp, 0xc
add ebp, 1
cmp word [esp + 0x1c], 2
jne 0x51b383
push ebp
call dword [sym.imp.WSOCK32.dll_ntohs]
mov word [esp + 0x1e], ax
mov eax, dword [esp + 0x224]
push edi
lea edx, [esp + 0x20]
push edx
push eax
call dword [sym.imp.WSOCK32.dll_bind]
test eax, eax
jl 0x51b347
push 0x80
lea ecx, [esp + 0xa0]
push 0
push ecx
mov dword [esp + 0x20], 0x80
call fcn.004e9ba0
mov ecx, dword [esp + 0x230]
add esp, 0xc
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0xa0]
push eax
push ecx
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jge 0x51b3f7
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
mov edi, eax
push edi
push ebx
mov dword [esi + 0x856c], edi
call fcn.0051ec40
push eax
push edi
push str.getsockname___failed_with_errno__d:__s
jmp 0x51b449
movzx edx, bp
push edx
push str.Local_port:__hu_n
push esi
call fcn.0051ab30
add esp, 0xc
mov dword [ebx + 0x1f8], 1
pop edi
pop esi
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x210]
xor ecx, esp
call fcn.004e8c89
add esp, 0x214
ret
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
mov edi, eax
push edi
push ebx
mov dword [esi + 0x856c], edi
call fcn.0051ec40
push eax
push edi
push str.bind_failed_with_errno__d:__s
push esi
call fcn.0051abc0
add esp, 0x18
mov ecx, dword [esp + 0x21c]
pop edi
pop esi
pop ebp
xor ecx, esp
mov eax, 0x2d
call fcn.004e8c89
add esp, 0x214
ret