Function at 0x180027240
Capabilities:
Check if file exists
Check os version
Create directory
Get common file path
Query or enumerate registry value

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xc50
mov qword [rsp + 0x90], 0xfffffffffffffffe
mov qword [rsp + 0xca0], rbx
mov rax, qword [0x18010e350]
xor rax, rsp
mov qword [rsp + 0xc40], rax
mov rsi, rdx
mov qword [rsp + 0x80], rdx
mov r14d, ecx
mov dword [rsp + 0x64], ecx
xor r12d, r12d
lea rcx, [0x18010e058]
mov rax, qword [0x18010e058]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetElement]
lea rdi, [rax + 0x18]
mov qword [rsp + 0x70], rdi
mov word [rsp + 0x620], r12w
xor edx, edx
mov r8d, 0x206
lea rcx, [rsp + 0x622]
call fcn.180086e90
mov qword [rsp + 0x38], r12
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rcx, rax
lea r9, [rsp + 0x38]
mov ebp, 1
mov r8d, ebp
lea edx, [rbp + 0xb]
call qword [sym.imp.ADVAPI32.dll_OpenThreadToken]
or r13, 0xffffffffffffffff
mov r8, qword [rsp + 0x38]
test r8, r8
je 0x1800273f5
lea rax, [rsp + 0x620]
mov qword [rsp + 0x20], rax
xor r9d, r9d
lea edx, [rbp + 0x27]
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov dword [rsp + 0x30], r12d
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov edx, ebp
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov r11d, dword [rsp + 0x30]
test r11d, r11d
je 0x1800273e5
mov rbx, r11
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, rbx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rbx, rax
test rax, rax
je 0x1800273e5
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
mov r9d, dword [rsp + 0x30]
mov r8, rbx
mov edx, ebp
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x1800273d1
mov qword [rsp + 0x58], r12
lea rdx, [rsp + 0x58]
mov rcx, qword [rbx]
call sub.ADVAPI32.dll_ConvertSidToStringSidW
mov rdx, qword [rsp + 0x58]
test rdx, rdx
je 0x1800273d1
xor eax, eax
mov rcx, r13
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
lea r8d, [rcx - 1]
lea rcx, [rsp + 0x70]
call fcn.18000f954
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rdi, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, rbx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x38], r12
lea rcx, [0x18010e058]
mov rax, qword [0x18010e058]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetElement]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x40], rbx
cmp word [rsp + 0x620], 0
je 0x18002776e
cmp dword [rdi - 0x10], 0
je 0x18002776e
lea rcx, [0x18010e058]
mov rax, qword [0x18010e058]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetElement]
add rax, 0x18
mov qword [rsp + 0x50], rax
mov r8, rdi
lea rdx, str._sEnvironment
lea rcx, [rsp + 0x50]
call fcn.18000acf4
mov rsi, r12
mov qword [rsp + 0x78], r12
mov qword [rsp + 0x88], r12
lea rax, [rsp + 0x88]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
mov rbp, qword [rsp + 0x50]
mov rdx, rbp
mov rcx, 0xffffffff80000003
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x1800274a5
mov eax, r12d
mov rsi, qword [rsp + 0x88]
mov qword [rsp + 0x78], rsi
cdqe
test rax, rax
jne 0x1800276b5
mov word [rsp + 0x210], ax
xor edx, edx
mov r8d, 0x40e
lea rcx, [rsp + 0x212]
call fcn.180086e90
mov dword [rsp + 0x4c], 0x410
lea rax, [rsp + 0x4c]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x210]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x60]
xor r8d, r8d
lea rdx, [0x1800dde80]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x180027529
mov eax, dword [rsp + 0x60]
cmp eax, 1
je 0x180027516
cmp eax, 2
jne 0x180027529
cmp dword [rsp + 0x4c], 0
jne 0x180027529
mov word [rsp + 0x210], 0
jmp 0x180027534
cmp word [rsp + 0x210], 0
jne 0x180027597
mov dword [rsp + 0x48], 0x410
lea rax, [rsp + 0x48]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x210]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x68]
xor r8d, r8d
lea rdx, str.TEMP
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x180027597
mov eax, dword [rsp + 0x68]
cmp eax, 1
je 0x18002757d
cmp eax, 2
jne 0x180027597
movzx eax, word [rsp + 0x210]
cmp dword [rsp + 0x48], 0
cmove ax, r12w
mov word [rsp + 0x210], ax
xor eax, eax
mov rcx, r13
lea rdi, [rsp + 0x210]
repne scasw ax, word [rdi]
not rcx
sub rcx, 1
mov rdi, rcx
test ecx, ecx
jne 0x18002761f
lea rdx, [rbx - 0x18]
mov rdi, qword [rdx]
cmp dword [rdx + 8], eax
je 0x1800276b5
cmp dword [rdx + 0x10], eax
jge 0x1800275e6
cmp dword [rbx - 0xc], eax
jge 0x1800275da
mov ecx, 0x80070057
call fcn.1800012c4
int3
mov dword [rbx - 0x10], r12d
mov word [rbx], ax
jmp 0x1800276b5
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x1800275fe
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetElement]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x40], rbx
mov rbp, qword [rsp + 0x50]
mov rsi, qword [rsp + 0x78]
jmp 0x1800276b5
mov r14d, dword [rbx - 0x10]
lea r15, [rsp + 0x210]
sub r15, rbx
sar r15, 1
mov ecx, 1
sub ecx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, edi
or eax, ecx
jge 0x180027653
mov edx, edi
lea rcx, [rsp + 0x40]
call fcn.180009098
mov rbx, qword [rsp + 0x40]
cmp r15, r14
ja 0x180027673
movsxd rax, edi
lea r14, [rax + rax]
lea r8, [rbx + r15*2]
mov r9, r14
mov rdx, r14
mov rcx, rbx
call fcn.180088e80
jmp 0x180027690
movsxd rax, edi
lea r14, [rax + rax]
mov r9, r14
lea r8, [rsp + 0x210]
mov rdx, r14
mov rcx, rbx
call fcn.180087f80
test edi, edi
js 0x1800276aa
cmp edi, dword [rbx - 0xc]
jg 0x1800276aa
mov dword [rbx - 0x10], edi
mov word [r14 + rbx], 0
mov r14d, dword [rsp + 0x64]
jmp 0x1800276b5
mov ecx, 0x80070057
call fcn.1800012c4
int3
movsxd rcx, dword [rbx - 0x10]
test ecx, ecx
je 0x18002771d
xor dl, dl
mov rax, r12
test ecx, ecx
jle 0x180027703
mov rdi, rcx
nop
nop
test dl, dl
je 0x1800276ee
movzx ecx, word [rbx + rax*2]
cmp cx, 0x61
jb 0x1800276ee
cmp cx, 0x7a
ja 0x1800276ee
sub cx, 0x20
mov word [rbx + rax*2], cx
jmp 0x1800276fa
cmp word [rbx + rax*2], 0x25
jne 0x1800276fa
test dl, dl
sete dl
add rax, 1
cmp rax, rdi
jl 0x1800276d0
lea r8, [rsp + 0x620]
lea rdx, str._USERPROFILE_
lea rcx, [rsp + 0x40]
call fcn.18001a7e4
nop
test rsi, rsi
je 0x18002772c
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
nop
lea rdx, [rbp - 0x18]
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x18002775c
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rbx, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x80]
mov ebp, 1
jmp 0x18002776e
mov rbx, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x80]
mov ebp, 1
xor edx, edx
mov r8d, 0x118
lea rcx, [rsp + 0xf4]
call fcn.180086e90
mov dword [rsp + 0xf0], 0x11c
lea rcx, [rsp + 0xf0]
call qword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp dword [rsp + 0x100], 2
jne 0x1800277dc
mov eax, dword [rsp + 0xf4]
cmp eax, 6
ja 0x1800277c6
cmp eax, 6
jne 0x1800277dc
mov eax, dword [rsp + 0xf8]
test eax, eax
jne 0x1800277c6
test eax, eax
jne 0x1800277dc
mov rcx, qword [rsp + 0x38]
call fcn.18001dd30
test eax, eax
je 0x1800277dc
mov eax, dword [rbx - 0x10]
lea edi, [rax + 4]
jmp 0x1800277e4
mov ebp, r12d
mov eax, dword [rbx - 0x10]
mov edi, eax
test eax, eax
jne 0x1800277fc
mov rdx, rsi
mov ecx, r14d
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
mov r12d, eax
jmp 0x18002792e
test rsi, rsi
je 0x180027922
cmp edi, r14d
jae 0x180027922
test ebp, ebp
je 0x180027911
mov word [rsp + 0x830], 0
xor edx, edx
mov r8d, 0x40e
lea rcx, [rsp + 0x832]
call fcn.180086e90
mov r9, r13
mov r8, rbx
mov edx, 0x208
lea rcx, [rsp + 0x830]
call fcn.180088050
lea rdx, [0x1800dde48]
lea rcx, [rsp + 0x830]
call qword [sym.imp.SHLWAPI.dll_PathAppendW]
mov edi, eax
test eax, eax
je 0x1800278c5
lea rcx, [rsp + 0x830]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov edi, eax
test eax, eax
je 0x1800278c5
lea rcx, [rsp + 0xa0]
call fcn.180008858
lea rdx, [rsp + 0xc8]
cmp qword [rsp + 0xd0], 0
cmove rdx, r12
lea rcx, [rsp + 0x830]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov edi, eax
mov rcx, qword [rsp + 0xe0]
test rcx, rcx
je 0x1800278c1
call qword [sym.imp.KERNEL32.dll_LocalFree]
test edi, edi
jne 0x1800278e7
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x1800278e7
test edi, edi
jne 0x1800278e7
mov rdx, rsi
mov ecx, r14d
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
mov r12d, eax
jmp 0x18002792e
mov edx, r14d
mov r9, r13
lea r8, [rsp + 0x830]
mov rcx, rsi
call fcn.180088050
xor eax, eax
mov rcx, r13
mov rdi, rsi
repne scasw ax, word [rdi]
not rcx
lea r12d, [rcx - 1]
jmp 0x18002792e
mov rdx, rbx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
mov r12d, edi
jmp 0x18002792e
mov ecx, 0x7a
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop
lea rdx, [rbx - 0x18]
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x18002794b
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x70]
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], r13d
add r13d, 0xffffffff
test r13d, r13d
jg 0x18002796c
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov eax, r12d
mov rcx, qword [rsp + 0xc40]
xor rcx, rsp
call fcn.180086e60
mov rbx, qword [rsp + 0xca0]
add rsp, 0xc50
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret