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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x214
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [eax]
xor eax, eax
mov dword [esp + 8], eax
mov ecx, dword [esi + 0x13c]
mov ebx, dword [esi + 0x338]
push edi
xor edx, edx
test ebx, ebx
mov dx, word [esi + 0x138]
mov dword [esp + 0x1c], ecx
mov byte [esp + 0xa0], al
mov dword [esp + 0x10], eax
mov ecx, 0x3f
lea edi, [esp + 0xa1]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [esp + 0x14], edx
stosb byte es:[edi], al
jne 0x403af0
test dx, dx
je 0x403d3b
xor eax, eax
test ebx, ebx
mov ecx, 0x20
lea edi, [esp + 0x20]
rep stosd dword es:[edi], eax
je 0x403c3b
mov eax, ebx
lea edi, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403b10
sub eax, edi
cmp eax, 0xff
jae 0x403c3b
mov edi, dword [ebp + 0x10]
push pe_nt_image_headers32
lea edx, [esp + 0xa4]
push edx
push ebx
push edi
call fcn.00419460
add esp, 0x10
test eax, eax
je 0x403b5f
push edi
lea eax, [esp + 0xa4]
push eax
push ebx
push str.Local_Interface__s_is_ip__s_using_address_family__i_n
push esi
call fcn.004033d0
add esp, 0x14
jmp 0x403bfa
mov edi, dword [ebp + 8]
cmp dword [ebp + 0x10], 2
mov ecx, dword [edi + 0x20c]
mov dword [esp + 0x18], ecx
jne 0x403b7c
mov dword [edi + 0x20c], 1
lea edx, [esp + 0xc]
push edx
push 0
push ebx
push edi
call fcn.00402260
add esp, 0x10
cmp eax, 1
jne 0x403ba0
lea eax, [esp + 0xc]
push eax
push edi
call fcn.00406a20
add esp, 8
mov eax, dword [esp + 0xc]
test eax, eax
mov ecx, dword [esp + 0x18]
mov dword [edi + 0x20c], ecx
je 0x403c20
mov eax, dword [eax]
push pe_nt_image_headers32
lea edx, [esp + 0xa4]
push edx
push eax
call fcn.004020e0
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
mov edx, dword [ebp + 0x10]
push eax
lea ecx, [esp + 0xb0]
push ecx
push edx
push ebx
push str.Name__s_family__i_resolved_to__s_family__i_n
push esi
call fcn.004033d0
mov eax, dword [esp + 0x30]
push eax
push esi
call fcn.00402430
mov edi, dword [ebp + 0x10]
add esp, 0x2c
cmp edi, 2
jne 0x403c5c
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0xa4]
push edx
push edi
call fcn.00419430
add esp, 0xc
test eax, eax
jle 0x403c5c
mov eax, dword [esp + 0x14]
push eax
jmp 0x403c42
push ebx
push str.Couldnt_bind_to__s
push esi
call fcn.00403490
add esp, 0xc
mov eax, 0x2d
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x10], 2
jne 0x403c5c
push edx
mov word [esp + 0x24], 2
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x22], ax
mov dword [esp + 0x10], 0x10
mov ecx, dword [esp + 0x10]
mov ebx, dword [ebp + 0xc]
push ecx
lea edx, [esp + 0x24]
push edx
push ebx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jge 0x403cc9
mov eax, dword [esp + 0x1c]
dec eax
test eax, eax
mov dword [esp + 0x1c], eax
jle 0x403d44
mov edi, dword [esp + 0x14]
movzx eax, di
push eax
push str.Bind_to_local_port__hu_failed__trying_next_n
push esi
call fcn.004033d0
add esp, 0xc
inc edi
cmp word [esp + 0x20], 2
mov dword [esp + 0x14], edi
jne 0x403cb4
push edi
call dword [sym.imp.WS2_32.dll_ntohs]
mov word [esp + 0x22], ax
mov ecx, dword [esp + 0x10]
push ecx
lea edx, [esp + 0x24]
push edx
push ebx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jl 0x403c74
xor eax, eax
mov ecx, 0x20
lea edi, [esp + 0x1a0]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x1a4]
push ecx
push ebx
mov dword [esp + 0x24], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jge 0x403d1a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [ebp + 8]
mov edi, eax
push edi
push edx
mov dword [esi + 0x8554], edi
call fcn.00418c70
push eax
push edi
push str.getsockname___failed_with_errno__d:__s
jmp 0x403d63
movzx eax, word [esp + 0x14]
push eax
push str.Local_port:__hu_n
push esi
call fcn.004033d0
mov ecx, dword [ebp + 8]
add esp, 0xc
mov dword [ecx + 0x1ec], 1
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [ebp + 8]
mov edi, eax
push edi
push edx
mov dword [esi + 0x8554], edi
call fcn.00418c70
push eax
push edi
push str.bind_failed_with_errno__d:__s
push esi
call fcn.00403490
add esp, 0x18
pop edi
pop esi
mov eax, 0x2d
pop ebx
mov esp, ebp
pop ebp
ret