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

Disassembly:
push rbp
push rbx
push rsi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x170]
sub rsp, 0x270
mov rax, qword [0x140401d40]
xor rax, rsp
mov qword [rbp + 0x150], rax
mov r14, qword [rcx]
xor r13d, r13d
mov qword [rsp + 0x38], r13
mov r12d, r8d
mov dword [rsp + 0x30], r9d
mov qword [rsp + 0x48], rdx
mov rsi, qword [r14 + 0xc10]
movzx ebx, word [r14 + 0x6e0]
mov r15d, dword [r14 + 0x6e4]
mov qword [rsp + 0x40], rcx
test rsi, rsi
jne 0x1401655b0
test bx, bx
jne 0x1401655b0
xor eax, eax
jmp 0x140165a17
mov qword [rsp + 0x268], rdi
xorps xmm0, xmm0
movups xmmword [rsp + 0x50], xmm0
movups xmmword [rsp + 0x60], xmm0
movups xmmword [rsp + 0x70], xmm0
movups xmmword [rbp - 0x80], xmm0
movups xmmword [rbp - 0x70], xmm0
movups xmmword [rbp - 0x60], xmm0
movups xmmword [rbp - 0x50], xmm0
movups xmmword [rbp - 0x40], xmm0
test rsi, rsi
je 0x140165890
mov rdi, 0xffffffffffffffff
mov rax, rdi
inc rax
cmp byte [rsi + rax], r13b
jne 0x1401655f1
cmp rax, 0xff
jae 0x140165890
xor edx, edx
lea rcx, [rbp + 0x50]
mov r8d, 0x100
call fcn.14030c5e0
mov rcx, qword [0x1403fc980]
mov r8, rdi
inc r8
cmp byte [rcx + r8], r13b
jne 0x140165621
mov rdx, rsi
call fcn.1402e5fa0
test eax, eax
jne 0x140165654
mov rax, qword [0x1403fc980]
nop dword [rax]
inc rdi
cmp byte [rax + rdi], r13b
jne 0x140165640
add rsi, rdi
mov dil, 1
jmp 0x140165768
mov rcx, qword [str.host_]
mov r8, rdi
nop
inc r8
cmp byte [rcx + r8], r13b
jne 0x140165660
mov rdx, rsi
call fcn.1402e5fa0
test eax, eax
jne 0x140165765
mov rax, qword [str.host_]
inc rdi
cmp byte [rax + rdi], r13b
jne 0x140165680
add rsi, rdi
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx + 0x440]
mov dword [rsp + 0x30], eax
cmp r12d, 2
jne 0x140165854
mov dword [rcx + 0x440], 1
mov edi, 2
lea rax, [rsp + 0x38]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rax
mov rdx, rsi
call fcn.14016cab0
cmp eax, 1
jne 0x1401656e0
mov rcx, qword [rsp + 0x40]
lea rdx, [rsp + 0x38]
call fcn.140157190
mov rcx, qword [rsp + 0x40]
mov eax, dword [rsp + 0x30]
mov dword [rcx + 0x440], eax
mov rcx, qword [rsp + 0x38]
test rcx, rcx
je 0x1401657af
mov rcx, qword [rcx]
lea rdx, [rbp + 0x50]
mov r8d, 0x100
call fcn.14016ca70
mov rax, qword [rsp + 0x38]
lea rdx, str.Name__s_family__i_resolved_to__s_family__i_n
mov r9d, r12d
mov r8, rsi
mov rcx, qword [rax]
mov eax, dword [rcx + 4]
mov rcx, r14
mov dword [rsp + 0x28], eax
lea rax, [rbp + 0x50]
mov qword [rsp + 0x20], rax
call fcn.1401638b0
mov rdx, qword [rsp + 0x38]
mov rcx, r14
call fcn.14016cd30
mov rcx, qword [rsp + 0x38]
mov rdx, qword [rcx]
cmp r12d, dword [rdx + 4]
je 0x1401657f2
mov eax, 1
jmp 0x140165a0f
xor dil, dil
mov rcx, qword [rsp + 0x40]
lea rax, [rbp + 0x50]
mov edx, dword [rsp + 0x30]
mov r9, rsi
mov dword [rsp + 0x28], 0x100
mov qword [rsp + 0x20], rax
mov r8d, dword [rcx + 0xb8]
mov ecx, r12d
call fcn.140130460
test eax, eax
je 0x14016582f
sub eax, 1
je 0x14016575b
cmp eax, 1
je 0x1401657d2
test dil, dil
je 0x14016568c
mov r8, rsi
mov byte [r14 + 0x1528], r13b
lea rdx, str.Couldnt_bind_to__s
mov rcx, r14
call fcn.140163730
mov eax, reloc.WLDAP32.dll_Ordinal_45
jmp 0x140165a0f
lea r9, [rbp + 0x50]
mov dword [rsp + 0x20], r12d
mov r8, rsi
lea rdx, str.Local_Interface__s_is_ip__s_using_address_family__i_n
mov rcx, r14
call fcn.1401638b0
mov edi, 2
cmp r12d, 0x17
jne 0x14016586e
lea r8, [rsp + 0x58]
mov ecx, r12d
lea rdx, [rbp + 0x50]
mov edi, r12d
call qword [sym.imp.WS2_32.dll_inet_pton]
test eax, eax
jle 0x140165824
movzx ecx, bx
mov word [rsp + 0x50], di
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x52], ax
mov r13d, Ordinal_33
jmp 0x1401658d0
test dil, dil
je 0x14016568c
mov r8, rsi
lea rdx, str.Couldnt_bind_to_interface__s
mov rcx, r14
call fcn.140163730
mov eax, reloc.WLDAP32.dll_Ordinal_45
jmp 0x140165a0f
cmp r12d, 0x17
jne 0x1401656af
mov edi, 2
mov dword [rcx + 0x440], edi
jmp 0x1401656b4
cmp r12d, 2
jne 0x1401658d0
lea r8, [rsp + 0x54]
mov ecx, edi
lea rdx, [rbp + 0x50]
call qword [sym.imp.WS2_32.dll_inet_pton]
test eax, eax
jle 0x1401658d0
mov word [rsp + 0x50], di
jmp 0x1401658bc
cmp r12d, 0x17
jne 0x1401658ae
mov edi, r12d
movzx ecx, bx
mov word [rsp + 0x50], di
call qword [sym.imp.WS2_32.dll_htons]
lea r13d, [r12 + 5]
jmp 0x1401658cb
cmp r12d, 2
jne 0x1401658d0
mov eax, r12d
mov word [rsp + 0x50], ax
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_htons]
mov r13d, reloc.WS2_32.dll_recv
mov word [rsp + 0x52], ax
mov rdi, qword [rsp + 0x48]
lea rdx, [rsp + 0x50]
mov rcx, rdi
mov r8d, r13d
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
jns 0x140165935
nop word [rax + rax]
dec r15d
test r15d, r15d
jle 0x1401659b2
movzx r8d, bx
lea rdx, str.Bind_to_local_port__hu_failed__trying_next_n
mov rcx, r14
call fcn.1401638b0
inc bx
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_ntohs]
mov r8d, r13d
lea rdx, [rsp + 0x50]
mov rcx, rdi
mov word [rsp + 0x52], ax
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
js 0x1401658f0
xorps xmm0, xmm0
mov dword [rsp + 0x30], 0x80
lea r8, [rsp + 0x30]
mov rcx, rdi
lea rdx, [rbp - 0x30]
movups xmmword [rbp - 0x30], xmm0
movups xmmword [rbp - 0x20], xmm0
movups xmmword [rbp - 0x10], xmm0
movups xmmword [rbp], xmm0
movups xmmword [rbp + 0x10], xmm0
movups xmmword [rbp + 0x20], xmm0
movups xmmword [rbp + 0x30], xmm0
movups xmmword [rbp + 0x40], xmm0
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jns 0x1401659ee
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8d, 0x80
lea rdx, [rbp + 0x50]
mov ecx, eax
mov dword [r14 + 0x1138], eax
mov ebx, eax
call fcn.14014bf60
mov r9, rax
lea rdx, str.getsockname___failed_with_errno__d:__s
mov r8d, ebx
mov rcx, r14
call fcn.140163730
mov eax, reloc.WLDAP32.dll_Ordinal_45
jmp 0x140165a0f
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8d, 0x80
lea rdx, [rbp - 0x30]
mov ecx, eax
mov dword [r14 + 0x1138], eax
mov ebx, eax
call fcn.14014bf60
mov r9, rax
lea rdx, str.bind_failed_with_errno__d:__s
mov r8d, ebx
mov rcx, r14
call fcn.140163730
mov eax, reloc.WLDAP32.dll_Ordinal_45
jmp 0x140165a0f
movzx r8d, bx
lea rdx, str.Local_port:__hu_n
mov rcx, r14
call fcn.1401638b0
mov rax, qword [rsp + 0x40]
mov byte [rax + 0x405], 1
xor eax, eax
mov rdi, qword [rsp + 0x268]
mov rcx, qword [rbp + 0x150]
xor rcx, rsp
call fcn.1402c8f50
add rsp, 0x270
pop r15
pop r14
pop r13
pop r12
pop rsi
pop rbx
pop rbp
ret