Function at 0x46f7c0
Capabilities:
Convert ip address from string
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x29c
mov eax, dword [0x4dbfb4]
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 - 0x298], eax
xor eax, eax
mov dword [ebp - 0x288], eax
movzx ebx, word [edi + 0x600]
mov esi, dword [edi + 0x9bc]
mov ecx, dword [edi + 0x604]
mov dword [ebp - 0x28c], eax
mov dword [ebp - 0x294], ebx
mov dword [ebp - 0x29c], ecx
cmp esi, eax
jne 0x46f81b
cmp bx, ax
je 0x46fc77
push 0x80
push eax
lea edx, [ebp - 0x284]
push edx
call fcn.0049e6e0
add esp, 0xc
test esi, esi
je 0x46fbfa
mov eax, esi
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x46f840
sub eax, edx
cmp eax, 0xff
jae 0x46fbfa
push 0xff
lea eax, [ebp - 0x103]
push 0
push eax
mov byte [ebp - 0x104], cl
call fcn.0049e6e0
mov edx, dword [0x4db938]
mov eax, edx
add esp, 0xc
mov dword [ebp - 0x290], 0
lea ebx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x46f885
sub eax, ebx
push eax
push esi
push edx
call fcn.004a1dcf
add esp, 0xc
test eax, eax
jne 0x46f913
mov eax, dword [0x4db938]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x46f8a5
sub eax, edx
add esi, eax
mov dword [ebp - 0x290], 1
mov edx, dword [ebp - 0x298]
mov eax, dword [edx + 0x2f4]
mov ebx, dword [ebp + 0x10]
push pe_nt_image_headers32
lea ecx, [ebp - 0x104]
push ecx
mov ecx, dword [ebp + 0x14]
push esi
push eax
push ecx
push ebx
call fcn.004950d0
add esp, 0x18
sub eax, 0
je 0x46f966
sub eax, 1
je 0x46f950
sub eax, 1
jne 0x46f983
push ebx
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.0046ae20
add esp, 0x14
jmp 0x46fa67
mov edx, dword [str.host_]
mov eax, edx
lea ebx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x46f920
sub eax, ebx
push eax
push esi
push edx
call fcn.004a1dcf
add esp, 0xc
test eax, eax
jne 0x46f8ba
mov eax, dword [str.host_]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x46f940
mov ebx, dword [ebp + 0x10]
sub eax, edx
add esi, eax
jmp 0x46f990
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x290], 0
je 0x46f990
push esi
push str.Couldnt_bind_to_interface__s
push edi
call fcn.0046af40
add esp, 0xc
jmp 0x46fcba
cmp dword [ebp - 0x290], 0
jne 0x46fbdc
mov eax, dword [ebp - 0x298]
mov ecx, dword [eax + 0x5b8]
mov dword [ebp - 0x290], ecx
cmp ebx, 2
jne 0x46f9b3
mov dword [eax + 0x5b8], 1
jmp 0x46f9c2
cmp ebx, 0x17
jne 0x46f9c2
mov dword [eax + 0x5b8], 2
lea edx, [ebp - 0x288]
push edx
push 0
push 0
push esi
push eax
call fcn.0048c390
add esp, 0x14
cmp eax, 1
jne 0x46f9f2
mov ecx, dword [ebp - 0x298]
lea eax, [ebp - 0x288]
push eax
push ecx
call fcn.00462cf0
add esp, 8
mov eax, dword [ebp - 0x298]
mov edx, dword [ebp - 0x290]
mov dword [eax + 0x5b8], edx
mov eax, dword [ebp - 0x288]
test eax, eax
je 0x46fbdc
mov edx, dword [eax]
push pe_nt_image_headers32
lea ecx, [ebp - 0x104]
push ecx
push edx
call fcn.0048b870
mov eax, dword [ebp - 0x288]
mov ecx, dword [eax]
mov edx, dword [ecx + 4]
push edx
lea eax, [ebp - 0x104]
push eax
push ebx
push esi
push str.Name__s_family__i_resolved_to__s_family__i_n
push edi
call fcn.0046ae20
mov ecx, dword [ebp - 0x288]
push ecx
push edi
call fcn.0048c610
mov edx, dword [ebp - 0x288]
mov eax, dword [edx]
add esp, 0x2c
cmp ebx, dword [eax + 4]
jne 0x46f950
cmp ebx, 0x17
jne 0x46fb8a
lea ecx, [ebp - 0x27c]
push ecx
lea edx, [ebp - 0x104]
push edx
push ebx
call dword [sym.imp.WS2_32.dll_inet_pton]
test eax, eax
jle 0x46faa6
mov ecx, dword [ebp - 0x294]
mov eax, ebx
push ecx
mov word [ebp - 0x284], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x282], ax
mov dword [ebp - 0x28c], 0x1c
mov ebx, dword [ebp - 0x294]
mov edx, dword [ebp - 0x28c]
mov esi, dword [ebp + 0xc]
push edx
lea eax, [ebp - 0x284]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jge 0x46fb21
mov eax, dword [ebp - 0x29c]
dec eax
mov dword [ebp - 0x29c], eax
test eax, eax
jle 0x46fc8a
movzx ecx, bx
push ecx
push str.Bind_to_local_port__hu_failed__trying_next_n
push edi
call fcn.0046ae20
add esp, 0xc
inc ebx
push ebx
call dword [sym.imp.WS2_32.dll_ntohs]
mov edx, dword [ebp - 0x28c]
mov word [ebp - 0x282], ax
push edx
lea eax, [ebp - 0x284]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jl 0x46fad2
push 0x80
lea ecx, [ebp - 0x84]
push 0
push ecx
mov dword [ebp - 0x29c], 0x80
call fcn.0049e6e0
add esp, 0xc
lea edx, [ebp - 0x29c]
push edx
lea eax, [ebp - 0x84]
push eax
push esi
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jge 0x46fc55
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push pe_nt_image_headers32
lea ecx, [ebp - 0x204]
mov esi, eax
push ecx
push esi
mov dword [edi + 0xe4c], esi
call fcn.00492ff0
push eax
push esi
push str.getsockname___failed_with_errno__d:__s
jmp 0x46fcb1
cmp ebx, 2
jne 0x46fab0
lea edx, [ebp - 0x280]
push edx
lea eax, [ebp - 0x104]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_inet_pton]
test eax, eax
jle 0x46fab0
mov edx, dword [ebp - 0x294]
mov ecx, ebx
push edx
mov word [ebp - 0x284], cx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x282], ax
mov dword [ebp - 0x28c], 0x10
jmp 0x46fab0
push esi
push str.Couldnt_bind_to__s
push edi
mov dword [edi + 0x1180], 0
call fcn.0046af40
add esp, 0xc
jmp 0x46fcba
mov eax, dword [ebp + 0x10]
cmp eax, 0x17
jne 0x46fc26
push ebx
mov word [ebp - 0x284], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x282], ax
mov dword [ebp - 0x28c], 0x1c
jmp 0x46fab6
cmp eax, 2
jne 0x46fab6
mov ecx, eax
push ebx
mov word [ebp - 0x284], cx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x282], ax
mov dword [ebp - 0x28c], 0x10
jmp 0x46fab6
movzx edx, bx
push edx
push str.Local_port:__hu_n
push edi
call fcn.0046ae20
mov eax, dword [ebp - 0x298]
add esp, 0xc
mov dword [eax + 0x570], 1
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push pe_nt_image_headers32
lea ecx, [ebp - 0x204]
mov esi, eax
push ecx
push esi
mov dword [edi + 0xe4c], esi
call fcn.00492ff0
push eax
push esi
push str.bind_failed_with_errno__d:__s
push edi
call fcn.0046af40
add esp, 0x1c
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov eax, 0x2d
pop ebx
call fcn.004a1682
mov esp, ebp
pop ebp
ret