Function at 0x140016c50
Capabilities:
Convert ip address from string
Resolve dns

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xd8
movaps xmmword [rsp + 0xc0], xmm6
mov r14, rdx
mov rdi, rcx
mov rcx, rdx
call fcn.1400179f0
test al, al
je 0x140016d61
mov qword [rsp + 0xa0], 0
mov qword [rsp + 0x58], 0
mov ecx, 1
mov edx, 0xa0
call sub.msvcrt.dll_calloc
mov qword [rdi], rax
test rax, rax
je 0x140016e02
mov r12, rax
mov rcx, r14
call fcn.140017b20
test rax, rax
je 0x140016e13
mov rsi, rax
mov qword [rsp + 0x98], rdi
lea rdx, str.get1_n_n
mov rcx, rax
call fcn.140017c50
mov rcx, rsi
call sub.msvcrt.dll_fflush
mov r8d, 0x3f
mov rcx, r12
mov rdx, r14
call sub.msvcrt.dll_strncpy
mov byte [r12 + 0x3f], 0
lea rcx, [rsp + 0x58]
lea rdx, [rsp + 0xa0]
mov r8, rsi
call fcn.140009170
test rax, rax
jle 0x140016ea5
lea rbx, [r12 + 0x68]
mov rax, r12
add rax, 0x48
mov qword [rsp + 0xa8], rax
mov r14d, 0xffffff7a
xor eax, eax
mov qword [rsp + 0x50], rax
xorps xmm6, xmm6
xor eax, eax
mov qword [rsp + 0x90], rax
mov qword [rsp + 0x48], rsi
mov qword [rsp + 0xb0], rbx
mov edi, 0xffffff7a
jmp 0x140016eee
mov dword [rsp + 0x60], 0
mov rcx, r14
call fcn.140017c80
mov qword [rdi], 0
test rax, rax
je 0x140016df4
mov r12, rax
mov qword [rsp + 0x98], rdi
xor esi, esi
lea r15, [rsp + 0x60]
mov rbp, qword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov rdi, qword [sym.imp.KERNEL32.dll_GetLastError]
xor ebx, ebx
nop
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], esi
mov qword [rsp + 0x20], rbx
mov qword [rsp + 0x38], 0
mov rcx, r12
mov edx, 0xb098c506
xor r8d, r8d
xor r9d, r9d
call rbp
test eax, eax
jne 0x140016e33
mov rcx, rbx
call sub.msvcrt.dll_free
call rdi
cmp eax, 0xea
jne 0x140016e8c
mov esi, dword [rsp + 0x60]
mov rcx, rsi
call sub.msvcrt.dll_malloc
mov rbx, rax
test rax, rax
jne 0x140016da0
call qword [sym.imp.msvcrt.dll__errno]
mov r14d, dword [rax]
jmp 0x1400178eb
call qword [sym.imp.msvcrt.dll__errno]
xor r14d, r14d
sub r14d, dword [rax]
jmp 0x140017962
call qword [sym.imp.msvcrt.dll__errno]
xor r14d, r14d
sub r14d, dword [rax]
mov rcx, r12
call sub.msvcrt.dll_free
mov qword [rdi], 0
jmp 0x140017962
mov ecx, 1
mov edx, 0xa0
call sub.msvcrt.dll_calloc
test rax, rax
je 0x1400178d1
mov rsi, rax
mov r8d, 0x40
mov rcx, rax
mov rdx, r14
call sub.msvcrt.dll_strncpy
mov byte [rsi + 0x3f], 0
mov eax, dword [rbx]
test al, 4
jne 0x140017679
test al, 1
jne 0x140017690
test al, 2
jne 0x1400176ae
cmp dword [rbx + 0x48], 0
jne 0x1400176ce
jmp 0x1400178ba
mov rsi, qword [sym.imp.msvcrt.dll__errno]
call rsi
mov dword [rax], 0xd
call rsi
mov r14d, dword [rax]
jmp 0x1400178eb
mov edi, 0xffffff7a
jmp 0x14001791c
mov word [r12 + 0x8c], ax
or byte [r12 + 0x44], 8
xor eax, eax
mov qword [rsp + 0x50], rax
nop word cs:[rax + rax]
nop
lea rcx, [rsp + 0x58]
lea rdx, [rsp + 0xa0]
mov r8, rsi
call fcn.140009170
test rax, rax
jle 0x14001791c
mov rbp, qword [rsp + 0x58]
mov rcx, rbp
call sub.msvcrt.dll_strlen
mov rbx, rax
cmp rax, 1
jne 0x140016f0e
cmp byte [rbp], 0xa
je 0x1400178f0
mov rcx, rbp
mov edx, 0x3d
call sub.msvcrt.dll_strchr
test rbx, rbx
je 0x14001791c
mov r13, rax
test rax, rax
je 0x14001791c
cmp byte [rbx + rbp - 1], 0xa
jne 0x14001791c
mov byte [rbp + rbx - 1], 0
lea r15, [r13 + 1]
mov byte [r13], 0
mov rbx, qword [rsp + 0x50]
mov rcx, rbp
test rbx, rbx
je 0x140017070
lea rdx, [0x14001dfdc]
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x1400170ea
mov rcx, rbp
lea rdx, str.preshared_key
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x14001713d
mov rcx, rbp
lea rdx, str.endpoint
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x1400171b8
mov rcx, rbp
lea rdx, str.persistent_keepalive_interval
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x14001727d
mov rcx, rbp
lea rdx, str.allowed_ip
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x1400173df
mov rcx, rbp
lea rdx, str.last_handshake_time_sec
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x140017510
mov rcx, rbp
lea rdx, str.last_handshake_time_nsec
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x14001755e
mov rcx, rbp
lea rdx, str.rx_bytes
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x140017634
mov rcx, rbp
lea rdx, str.tx_bytes
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x1400170c9
movsx eax, byte [r15]
mov ecx, 0x2f
sub ecx, eax
add eax, 0xffffffc6
test ecx, eax
jns 0x140017917
mov rcx, r15
lea rdx, [rsp + 0x60]
mov r8d, 0xa
call fcn.140002010
mov rcx, qword [rsp + 0x60]
cmp byte [rcx], 0
jne 0x140017917
mov qword [rbx + 0x78], rax
mov rsi, qword [rsp + 0x48]
jmp 0x140016ed0
lea rdx, [0x14001dfc4]
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x140017176
mov rcx, rbp
lea rdx, [0x14001dfd0]
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x140017230
mov rcx, rbp
lea rdx, str.fwmark
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x1400172d4
mov rcx, rbp
lea rdx, [0x14001dfdc]
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x140017495
mov rcx, rbp
lea rdx, str.errno
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x1400174bd
mov rsi, qword [rsp + 0x48]
jmp 0x140016ed0
mov ecx, 1
mov edx, 0xa0
call sub.msvcrt.dll_calloc
test rax, rax
je 0x140017902
mov rbp, rax
mov qword [rbx + 0x98], rax
lea rcx, [rbp + 4]
mov rdx, r15
call fcn.140016170
test al, al
je 0x140017917
or byte [rbp], 4
xor eax, eax
mov qword [rsp + 0x90], rax
mov qword [rsp + 0x50], rbp
mov rsi, qword [rsp + 0x48]
jmp 0x140016ed0
add rbx, 0x24
mov rcx, rbx
mov rdx, r15
call fcn.140016170
test al, al
je 0x140017917
mov rcx, rbx
call fcn.140016270
test al, al
mov rsi, qword [rsp + 0x48]
jne 0x140016ed0
mov rax, qword [rsp + 0x50]
or byte [rax], 8
jmp 0x140016ed0
mov rbx, qword [rsp + 0xb0]
mov rcx, rbx
mov rdx, r15
call fcn.140016170
test al, al
je 0x140017917
mov rcx, qword [rsp + 0xa8]
mov rdx, rbx
call fcn.140009dd0
or byte [r12 + 0x44], 6
xor eax, eax
mov qword [rsp + 0x50], rax
mov rsi, qword [rsp + 0x48]
jmp 0x140016ed0
movaps xmmword [rsp + 0x60], xmm6
movaps xmmword [rsp + 0x80], xmm6
movaps xmmword [rsp + 0x70], xmm6
movabs rax, 0x1100000002
mov qword [rsp + 0x68], rax
mov rcx, r15
call sub.msvcrt.dll_strlen
test rax, rax
je 0x140017917
cmp byte [r15], 0x5b
jne 0x140017330
mov rcx, r15
mov edx, 0x5d
call sub.msvcrt.dll_strchr
test rax, rax
je 0x140017917
mov byte [rax], 0
cmp byte [rax + 1], 0x3a
jne 0x140017917
add rax, 2
cmp byte [rax], 0
je 0x140017917
add r13, 2
mov r15, r13
jmp 0x14001735d
movsx eax, byte [r15]
mov ecx, 0x2f
sub ecx, eax
add eax, 0xffffffc6
test ecx, eax
jns 0x140017917
mov rcx, r15
lea rdx, [rsp + 0x60]
mov r8d, 0xa
call fcn.140002010
cmp rax, 0xffff
ja 0x140017917
mov rcx, qword [rsp + 0x60]
cmp byte [rcx], 0
mov rsi, qword [rsp + 0x48]
je 0x140016eaf
jmp 0x14001791c
movsx eax, byte [r15]
mov ecx, 0x2f
sub ecx, eax
add eax, 0xffffffc6
test ecx, eax
jns 0x140017917
mov rcx, r15
lea rdx, [rsp + 0x60]
mov r8d, 0xa
call fcn.140002010
cmp rax, 0xffff
ja 0x140017917
mov rcx, qword [rsp + 0x60]
cmp byte [rcx], 0
mov rsi, qword [rsp + 0x48]
jne 0x14001791c
mov word [rbx + 0x80], ax
or byte [rbx], 0x10
jmp 0x140016ed0
movsx eax, byte [r15]
mov ecx, 0x2f
sub ecx, eax
add eax, 0xffffffc6
test ecx, eax
jns 0x140017917
mov rcx, r15
lea rdx, [rsp + 0x60]
mov r8d, 0xa
call fcn.140002010
mov rcx, rax
shr rcx, 0x20
jne 0x140017917
mov rcx, qword [rsp + 0x60]
cmp byte [rcx], 0
mov rsi, qword [rsp + 0x48]
jne 0x14001791c
mov dword [r12 + 0x88], eax
or byte [r12 + 0x44], 0x10
jmp 0x140016ebe
mov rcx, r15
mov edx, 0x3a
call sub.msvcrt.dll_strrchr
test rax, rax
je 0x140017917
mov rcx, rax
cmp byte [rax + 1], 0
je 0x140017917
mov rax, rcx
add rax, 1
mov byte [rcx], 0
mov rcx, r15
mov rdx, rax
lea r8, [rsp + 0x60]
lea r9, [rsp + 0xb8]
call qword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
jne 0x1400179d3
mov rbp, qword [rsp + 0xb8]
mov eax, dword [rbp + 4]
cmp eax, 0x17
je 0x1400173ae
cmp eax, 2
mov rsi, qword [rsp + 0x48]
jne 0x14001790e
mov r8d, 0x10
cmp qword [rbp + 0x10], 0x10
je 0x1400173c4
jmp 0x14001790e
mov r8d, 0x1c
cmp qword [rbp + 0x10], 0x1c
mov rsi, qword [rsp + 0x48]
jne 0x14001790e
lea rcx, [rbx + 0x44]
mov rdx, qword [rbp + 0x20]
call sub.msvcrt.dll_memcpy
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x140016ed0
mov rcx, r15
lea rdx, [0x14001e027]
call sub.msvcrt.dll_strcspn
cmp byte [r15 + rax], 0
je 0x140017917
mov rbp, rax
add rbp, r15
mov byte [rbp], 0
movsx eax, byte [rbp + 1]
mov ecx, 0x2f
sub ecx, eax
add eax, 0xffffffc6
test ecx, eax
jns 0x140017917
mov ecx, 1
mov edx, 0x20
call sub.msvcrt.dll_calloc
test rax, rax
je 0x140017902
mov r13, rax
add rbp, 1
lea rax, [rbx + 0x88]
mov rdx, qword [rsp + 0x90]
lea rcx, [rdx + 0x18]
test rdx, rdx
cmove rcx, rax
mov qword [rcx], r13
mov rcx, r15
mov edx, 0x3a
call sub.msvcrt.dll_strchr
mov r8, r13
add r8, 4
test rax, rax
je 0x1400175b1
mov ecx, 0x17
mov rdx, r15
call qword [sym.imp.WS2_32.dll_inet_pton]
cmp eax, 1
jne 0x1400175cb
mov word [r13], 0x17
jmp 0x1400175cb
mov ecx, 1
mov edx, 0xa0
call sub.msvcrt.dll_calloc
test rax, rax
je 0x140017902
mov rbp, rax
mov qword [r12 + 0x90], rax
jmp 0x14001710c
movsx eax, byte [r15]
mov ecx, 0x2f
sub ecx, eax
add eax, 0xffffffc6
test ecx, eax
jns 0x140017917
mov rcx, r15
lea rdx, [rsp + 0x60]
mov r8d, 0xa
call fcn.140002010
cmp rax, 0x7fffffff
ja 0x140017917
mov r14, rax
mov rax, qword [rsp + 0x60]
cmp byte [rax], 0
mov rsi, qword [rsp + 0x48]
jne 0x14001791c
neg r14d
jmp 0x140016ed0
movsx eax, byte [r15]
mov ecx, 0x2f
sub ecx, eax
add eax, 0xffffffc6
test ecx, eax
jns 0x140017917
mov rcx, r15
lea rdx, [rsp + 0x60]
mov r8d, 0xa
call fcn.140002010
test rax, rax
js 0x140017917
mov rcx, qword [rsp + 0x60]
cmp byte [rcx], 0
mov rsi, qword [rsp + 0x48]
jne 0x14001791c
mov qword [rbx + 0x60], rax
jmp 0x140016ed0
movsx eax, byte [r15]
mov ecx, 0x2f
sub ecx, eax
add eax, 0xffffffc6
test ecx, eax
jns 0x140017917
mov rcx, r15
lea rdx, [rsp + 0x60]
mov r8d, 0xa
call fcn.140002010
test rax, rax
js 0x140017917
mov rcx, qword [rsp + 0x60]
cmp byte [rcx], 0
mov rsi, qword [rsp + 0x48]
jne 0x14001791c
mov rcx, qword [rsp + 0x50]
mov qword [rcx + 0x68], rax
jmp 0x140016ed0
mov ecx, 2
mov rdx, r15
call qword [sym.imp.WS2_32.dll_inet_pton]
cmp eax, 1
jne 0x1400175cb
mov word [r13], 2
mov rcx, rbp
lea rdx, [rsp + 0x60]
mov r8d, 0xa
call sub.msvcrt.dll_strtoul
mov byte [r13 + 0x14], al
mov rcx, qword [rsp + 0x60]
cmp byte [rcx], 0
jne 0x140017917
movzx ecx, word [r13]
cmp cx, 2
je 0x14001760b
cmp cx, 0x17
je 0x140017614
test cx, cx
jne 0x140017622
jmp 0x140017917
cmp al, 0x20
jbe 0x140017622
jmp 0x140017917
movzx eax, al
cmp eax, 0x80
ja 0x140017917
mov qword [rsp + 0x90], r13
mov rsi, qword [rsp + 0x48]
jmp 0x140016ed0
movsx eax, byte [r15]
mov ecx, 0x2f
sub ecx, eax
add eax, 0xffffffc6
test ecx, eax
jns 0x140017917
mov rcx, r15
lea rdx, [rsp + 0x60]
mov r8d, 0xa
call fcn.140002010
mov rcx, qword [rsp + 0x60]
cmp byte [rcx], 0
jne 0x140017917
mov qword [rbx + 0x70], rax
mov rsi, qword [rsp + 0x48]
jmp 0x140016ed0
movzx ecx, word [rbx + 4]
mov word [rsi + 0x8c], cx
or byte [rsi + 0x44], 8
test al, 1
je 0x140016e75
movdqu xmm0, xmmword [rbx + 0x26]
movups xmm1, xmmword [rbx + 0x36]
movups xmmword [rsi + 0x58], xmm1
movdqu xmmword [rsi + 0x48], xmm0
or byte [rsi + 0x44], 4
test al, 2
je 0x140016e7d
movdqu xmm0, xmmword [rbx + 6]
movups xmm1, xmmword [rbx + 0x16]
movups xmmword [rsi + 0x78], xmm1
movdqu xmmword [rsi + 0x68], xmm0
or byte [rsi + 0x44], 2
cmp dword [rbx + 0x48], 0
je 0x1400178ba
lea rdi, [rbx + 0x50]
mov rax, rsi
add rax, 0x90
mov qword [rsp + 0x48], rax
xor eax, eax
jmp 0x1400176f7
mov eax, dword [rsp + 0x50]
add eax, 1
mov rdi, r13
cmp eax, dword [rbx + 0x48]
jae 0x1400178ba
mov dword [rsp + 0x50], eax
mov ecx, 1
mov edx, 0xa0
call sub.msvcrt.dll_calloc
test rax, rax
je 0x1400178d1
mov r14, rax
mov rax, qword [rsp + 0x48]
cmp qword [rax], 0
je 0x140017730
mov rax, qword [rsi + 0x98]
mov ecx, 0x98
add rax, rcx
mov qword [rax], r14
mov qword [rsi + 0x98], r14
mov eax, dword [rdi]
test al, 1
je 0x14001775d
movdqu xmm0, xmmword [rdi + 8]
movups xmm1, xmmword [rdi + 0x18]
movups xmmword [r14 + 0x14], xmm1
movdqu xmmword [r14 + 4], xmm0
mov dword [r14], 4
mov eax, dword [rdi]
test al, 2
je 0x140017786
lea rcx, [r14 + 0x24]
movdqu xmm0, xmmword [rdi + 0x28]
movups xmm1, xmmword [rdi + 0x38]
movups xmmword [r14 + 0x34], xmm1
movdqu xmmword [r14 + 0x24], xmm0
call fcn.140016270
test al, al
jne 0x140017786
or byte [r14], 8
mov eax, dword [rdi]
test al, 4
je 0x14001779c
movzx ecx, word [rdi + 0x48]
mov word [r14 + 0x80], cx
or byte [r14], 0x10
test al, 8
je 0x1400177cd
lea rax, [rdi + 0x4c]
movzx ecx, word [rdi + 0x4c]
cmp cx, 0x17
je 0x1400177ba
cmp cx, 2
jne 0x1400177cd
movdqu xmm0, xmmword [rax]
jmp 0x1400177c7
movdqu xmm0, xmmword [rax]
movups xmm1, xmmword [rax + 0xc]
movups xmmword [r14 + 0x50], xmm1
movdqu xmmword [r14 + 0x44], xmm0
movdqu xmm0, xmmword [rdi + 0x68]
pshufd xmm0, xmm0, 0x4e
movdqu xmmword [r14 + 0x70], xmm0
mov rcx, qword [rdi + 0x78]
test rcx, rcx
je 0x14001781d
mov rax, rcx
movabs rdx, 0xd6bf94d5e57a42bd
mul rdx
shr rdx, 0x17
movabs rax, 0xfffffffd49ef6f00
add rax, rdx
mov qword [r14 + 0x60], rax
imul rax, rdx, 0x989680
sub rcx, rax
imul rax, rcx, 0x64
mov qword [r14 + 0x68], rax
lea r13, [rdi + 0x88]
cmp dword [rdi + 0x80], 0
je 0x1400176e4
mov rbp, r14
add rbp, 0x88
xor r15d, r15d
jmp 0x140017868
movdqu xmm0, xmmword [r13]
movdqu xmmword [rax + 4], xmm0
movzx ecx, byte [r13 + 0x12]
mov byte [rax + 0x14], cl
add r13, 0x18
add r15d, 1
cmp r15d, dword [rdi + 0x80]
jae 0x1400176e4
mov ecx, 1
mov edx, 0x20
call sub.msvcrt.dll_calloc
test rax, rax
je 0x1400178d1
cmp qword [rbp], 0
je 0x140017890
mov rcx, qword [r14 + 0x90]
add rcx, 0x18
jmp 0x140017893
mov rcx, rbp
mov qword [rcx], rax
mov qword [r14 + 0x90], rax
movzx ecx, word [r13 + 0x10]
mov word [rax], cx
cmp cx, 0x17
je 0x140017840
cmp cx, 2
jne 0x140017853
mov ecx, dword [r13]
mov dword [rax + 4], ecx
jmp 0x14001784b
mov rax, qword [rsp + 0x98]
mov qword [rax], rsi
call qword [sym.imp.msvcrt.dll__errno]
mov dword [rax], 0
call qword [sym.imp.msvcrt.dll__errno]
mov r14d, dword [rax]
mov rcx, rbx
call sub.msvcrt.dll_free
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
neg r14d
jmp 0x140017962
mov rcx, rbp
call sub.msvcrt.dll_free
test r14d, r14d
jne 0x140017929
xor r14d, r14d
jmp 0x14001794d
mov edi, 0xfffffff4
mov rsi, qword [rsp + 0x48]
jmp 0x14001791c
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_freeaddrinfo]
mov rsi, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x58]
call sub.msvcrt.dll_free
mov r14d, edi
mov rbp, qword [r12 + 0x90]
test rbp, rbp
jne 0x1400179a0
mov rcx, r12
call sub.msvcrt.dll_free
mov rax, qword [rsp + 0x98]
mov qword [rax], 0
mov rcx, rsi
call sub.msvcrt.dll_fclose
mov edi, r14d
neg edi
call qword [sym.imp.msvcrt.dll__errno]
mov dword [rax], edi
mov eax, r14d
movaps xmm6, xmmword [rsp + 0xc0]
add rsp, 0xd8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, rbp
call sub.msvcrt.dll_free
mov rbp, rbx
test rbx, rbx
je 0x140017936
mov rcx, qword [rbp + 0x88]
mov rbx, qword [rbp + 0x98]
test rcx, rcx
je 0x140017990
nop word [rax + rax]
mov rdi, qword [rcx + 0x18]
call sub.msvcrt.dll_free
mov rcx, rdi
test rdi, rdi
jne 0x1400179c0
jmp 0x140017990
mov edi, 0x76
mov rsi, qword [rsp + 0x48]
jmp 0x14001791c