Function at 0x14002f524
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 0x14002f899
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 0x14002f729
mov ecx, dword [rsp + 0x30]
lea eax, [rcx - 1]
cmp eax, 1
ja 0x14002f729
cmp ecx, 2
jne 0x14002f640
mov r8d, r12d
lea rdx, [rbp + 0x360]
lea rcx, [rbp + 0x150]
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x14002f729
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 0x14002f6ad
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f660
test rax, rax
je 0x14002f696
cmp word [rsp + rax*2 + 0x3e], 0x5c
jne 0x14002f696
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f67f
test rax, rax
je 0x14002f696
mov word [rsp + rax*2 + 0x3e], r15w
jmp 0x14002f658
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, ebx
je 0x14002f6ad
test al, 0x10
jne 0x14002f84b
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 0x14002f729
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f6dc
test rax, rax
je 0x14002f712
cmp word [rsp + rax*2 + 0x3e], 0x5c
jne 0x14002f712
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f6fb
test rax, rax
je 0x14002f712
mov word [rsp + rax*2 + 0x3e], r15w
jmp 0x14002f6d4
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, ebx
je 0x14002f729
test al, 0x10
jne 0x14002f84b
mov edx, r12d
lea rcx, [rbp + 0x360]
mov ebx, r13d
call qword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x14002f88e
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 0x14002f88e
mov rcx, rdi
inc rcx
cmp word [rax + rcx*2], r15w
jne 0x14002f77b
cmp rcx, 4
jbe 0x14002f88e
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 0x14002f88e
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 0x14002f88e
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f801
test rax, rax
je 0x14002f837
cmp word [rsp + rax*2 + 0x3e], 0x5c
jne 0x14002f837
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x14002f820
test rax, rax
je 0x14002f837
mov word [rsp + rax*2 + 0x3e], r15w
jmp 0x14002f7f9
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x14002f88e
test al, 0x10
je 0x14002f88e
mov rdx, rsi
lea rax, [rbp + 0x150]
shr rdx, 1
inc rdi
cmp word [rax + rdi*2], r15w
jne 0x14002f858
inc rdi
cmp rdx, rdi
jbe 0x14002f87e
lea r8, [rbp + 0x150]
mov rcx, r14
call fcn.140001470
mov ebx, r15d
jmp 0x14002f88e
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.14003c6c0
mov rbx, qword [rsp + 0x6d0]
add rsp, 0x680
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret