Function at 0x14002f614
Capabilities:
Check if file exists
Create directory
Get common file path
Get file attributes
Query environment variable
Query or enumerate registry value

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x580]
sub rsp, 0x680
mov rax, qword [0x1400502a8]
xor rax, rsp
mov qword [rbp + 0x570], rax
xor r15d, r15d
mov esi, edx
mov r14, rcx
mov qword [rsp + 0x38], r15
lea rax, [rsp + 0x38]
mov r13d, 0x80004005
xor r8d, r8d
mov qword [rsp + 0x20], rax
lea r9d, [r15 + 1]
mov rcx, 0xffffffff80000002
lea rdx, str.SoftwareMicrosoftWindowsCurrentVersion
mov ebx, r13d
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x14002f989
mov ecx, 0x208
mov dword [rsp + 0x30], 1
cmp esi, ecx
lea r9, [rsp + 0x30]
mov eax, esi
lea rdx, [0x1400479d8]
cmova eax, ecx
mov rcx, qword [rsp + 0x38]
mov dword [rsp + 0x34], eax
xor r8d, r8d
lea rax, [rsp + 0x34]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x150]
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
or rdi, 0xffffffffffffffff
or ebx, 0xffffffff
mov r12d, 0x104
test eax, eax
jne 0x14002f819
mov ecx, dword [rsp + 0x30]
lea eax, [rcx - 1]
cmp eax, 1
ja 0x14002f819
cmp ecx, 2
jne 0x14002f730
mov r8d, r12d
lea rdx, [rbp + 0x360]
lea rcx, [rbp + 0x150]
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x14002f819
lea r8, [rbp + 0x360]
lea edx, [r12 - 1]
lea rcx, [rbp + 0x150]
call fcn.140001470
lea r8, [rbp + 0x150]
mov rdx, r12
lea rcx, [rsp + 0x40]
call fcn.140001470
test eax, eax
js 0x14002f79d
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f750
test rax, rax
je 0x14002f786
cmp word [rsp + rax*2 + 0x3e], 0x5c
jne 0x14002f786
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f76f
test rax, rax
je 0x14002f786
mov word [rsp + rax*2 + 0x3e], r15w
jmp 0x14002f748
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, ebx
je 0x14002f79d
test al, 0x10
jne 0x14002f93b
xor edx, edx
lea rcx, [rbp + 0x150]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea r8, [rbp + 0x150]
mov rdx, r12
lea rcx, [rsp + 0x40]
call fcn.140001470
test eax, eax
js 0x14002f819
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f7cc
test rax, rax
je 0x14002f802
cmp word [rsp + rax*2 + 0x3e], 0x5c
jne 0x14002f802
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f7eb
test rax, rax
je 0x14002f802
mov word [rsp + rax*2 + 0x3e], r15w
jmp 0x14002f7c4
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, ebx
je 0x14002f819
test al, 0x10
jne 0x14002f93b
mov edx, r12d
lea rcx, [rbp + 0x360]
mov ebx, r13d
call qword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x14002f97e
mov r8d, r12d
lea rdx, [rbp + 0x150]
lea rcx, [rbp + 0x360]
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea rdx, [0x140042138]
lea rcx, [rbp + 0x150]
call qword [sym.imp.msvcrt.dll_wcsstr]
test rax, rax
je 0x14002f97e
mov rcx, rdi
inc rcx
cmp word [rax + rcx*2], r15w
jne 0x14002f86b
cmp rcx, 4
jbe 0x14002f97e
mov rcx, qword [0x140050d10]
lea r8, [rbp + 0x360]
mov r9d, r12d
mov word [rax + 4], r15w
mov edx, 0x26fc
call qword [sym.imp.USER32.dll_LoadStringW]
test eax, eax
je 0x14002f97e
lea r8, [rbp + 0x360]
mov rdx, r12
lea rcx, [rbp + 0x150]
call fcn.140001584
xor edx, edx
lea rcx, [rbp + 0x150]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea r8, [rbp + 0x150]
mov rdx, r12
lea rcx, [rsp + 0x40]
call fcn.140001470
test eax, eax
js 0x14002f97e
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f8f1
test rax, rax
je 0x14002f927
cmp word [rsp + rax*2 + 0x3e], 0x5c
jne 0x14002f927
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f910
test rax, rax
je 0x14002f927
mov word [rsp + rax*2 + 0x3e], r15w
jmp 0x14002f8e9
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x14002f97e
test al, 0x10
je 0x14002f97e
mov rdx, rsi
lea rax, [rbp + 0x150]
shr rdx, 1
inc rdi
cmp word [rax + rdi*2], r15w
jne 0x14002f948
inc rdi
cmp rdx, rdi
jbe 0x14002f96e
lea r8, [rbp + 0x150]
mov rcx, r14
call fcn.140001470
mov ebx, r15d
jmp 0x14002f97e
mov ecx, 0x8007007a
mov ebx, 0x8007007a
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, ebx
mov rcx, qword [rbp + 0x570]
xor rcx, rsp
call fcn.14003c810
mov rbx, qword [rsp + 0x6d0]
add rsp, 0x680
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret