Function at 0x140037d88
Capabilities:
Check if file exists
Create directory
Get file attributes
Query or enumerate registry value

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r14
push r15
lea rbp, [rsp - 0x370]
sub rsp, 0x470
mov rax, qword [0x1400592a0]
xor rax, rsp
mov qword [rbp + 0x360], rax
xor r15d, r15d
mov r14d, edx
mov qword [rsp + 0x38], r15
mov rsi, rcx
mov ebx, 0x80004005
test rcx, rcx
jne 0x140037dd4
lea eax, [rbx - 2]
jmp 0x140038047
lea rax, [rsp + 0x38]
mov r9d, 1
xor r8d, r8d
mov qword [rsp + 0x20], rax
lea rdx, str.SoftwareMicrosoftWindowsCurrentVersion
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
nop dword [rax + rax]
test eax, eax
jne 0x140038045
mov ecx, 0x208
mov dword [rsp + 0x30], 1
cmp r14d, ecx
lea r9, [rsp + 0x30]
mov eax, r14d
lea rdx, str.CommonFilesDir
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]
nop dword [rax + rax]
or rdi, 0xffffffffffffffff
test eax, eax
jne 0x140037fd7
cmp dword [rsp + 0x30], 1
jne 0x140037fd7
mov ebx, 0x104
lea r8, [rbp + 0x150]
lea rax, [rsp + 0x40]
mov edx, ebx
sub r8, rax
lea rcx, [rsp + 0x40]
lea rax, [rdx + 0x7ffffefa]
test rax, rax
je 0x140037eae
movzx eax, word [r8 + rcx]
test ax, ax
je 0x140037eae
mov word [rcx], ax
add rcx, 2
sub rdx, 1
jne 0x140037e8b
test rdx, rdx
lea rax, [rcx - 2]
cmovne rax, rcx
mov word [rax], r15w
je 0x140037f1f
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x140037ec7
test rax, rax
je 0x140037efd
cmp word [rsp + rax*2 + 0x3e], 0x5c
jne 0x140037efd
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x140037ee6
test rax, rax
je 0x140037efd
mov word [rsp + rax*2 + 0x3e], r15w
jmp 0x140037ebf
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
nop dword [rax + rax]
cmp eax, 0xffffffff
je 0x140037f1f
test al, 0x10
je 0x140037f1f
mov ebx, r15d
jmp 0x140037fee
xor edx, edx
lea rcx, [rbp + 0x150]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
nop dword [rax + rax]
lea rdx, [rbp + 0x150]
lea rax, [rsp + 0x40]
sub rdx, rax
lea rcx, [rsp + 0x40]
lea rax, [rbx + 0x7ffffefa]
test rax, rax
je 0x140037f6a
movzx eax, word [rdx + rcx]
test ax, ax
je 0x140037f6a
mov word [rcx], ax
add rcx, 2
sub rbx, 1
jne 0x140037f48
test rbx, rbx
lea rax, [rcx - 2]
cmovne rax, rcx
mov word [rax], r15w
je 0x140037fd7
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x140037f83
test rax, rax
je 0x140037fb9
cmp word [rsp + rax*2 + 0x3e], 0x5c
jne 0x140037fb9
lea rcx, [rsp + 0x40]
mov rax, rdi
inc rax
cmp word [rcx + rax*2], r15w
jne 0x140037fa2
test rax, rax
je 0x140037fb9
mov word [rsp + rax*2 + 0x3e], r15w
jmp 0x140037f7b
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
nop dword [rax + rax]
cmp eax, 0xffffffff
je 0x140037fd7
test al, 0x10
jne 0x140037f17
mov edx, 0x208
lea rcx, [rbp + 0x150]
call fcn.140038074
mov ebx, eax
test eax, eax
jne 0x140038034
mov rdx, r14
lea rax, [rbp + 0x150]
shr rdx, 1
inc rdi
cmp word [rax + rdi*2], r15w
jne 0x140037ffb
inc rdi
cmp rdx, rdi
jbe 0x14003801e
lea r8, [rbp + 0x150]
mov rcx, rsi
call fcn.140010dd0
jmp 0x140038034
mov ecx, 0x8007007a
mov ebx, 0x8007007a
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop dword [rax + rax]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
nop dword [rax + rax]
mov eax, ebx
mov rcx, qword [rbp + 0x360]
xor rcx, rsp
call fcn.1400017f0
mov rbx, qword [rsp + 0x4b0]
add rsp, 0x470
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret