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

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x2648]
mov eax, 0x2748
call fcn.140116850
sub rsp, rax
mov rax, qword [0x140200100]
xor rax, rsp
mov qword [rbp + 0x2630], rax
mov qword [rbp - 0x40], r9
mov r13, r8
mov rsi, rdx
mov qword [rbp - 0x70], rcx
mov rax, qword [rbp + 0x26b8]
mov qword [rbp - 0x48], rax
mov r12, qword [rbp + 0x26c0]
mov qword [rbp - 0x30], r12
xor r14d, r14d
xor edx, edx
mov r8d, 0x2000
lea rcx, [rbp + 0x630]
call fcn.140198190
nop
movzx edx, byte [rsp + 0x40]
lea rcx, [rbp - 0x28]
call fcn.1400057c0
lea rcx, [rbp - 0x28]
call fcn.14000bb90
nop
mov rdx, rsi
lea rcx, [rsp + 0x70]
call fcn.140009ac0
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.14003d980
mov rdi, rax
cmp rsi, rax
je 0x1400470a7
mov rcx, rsi
call fcn.140005b50
mov rcx, rdi
call fcn.140005b50
mov rbx, rax
mov rcx, rsi
call fcn.14000b720
mov rcx, rbx
call fcn.14000ee50
mov rdx, rdi
mov rcx, rsi
call fcn.14000b9e0
lea rcx, [rsp + 0x48]
call fcn.140009a90
mov rdx, rsi
lea rcx, [rbp + 0x10]
call fcn.14003d1f0
nop
cmp dword [0x1402054ac], 9
ja 0x1400471af
lea rcx, [0x1401cfeb0]
call fcn.140005720
mov rdi, rax
mov rbx, qword [rbp + 0x20]
lea rcx, [rbp + 0x10]
call fcn.14000bc10
mov r12, rax
cmp rdi, rbx
ja 0x1400471ab
sub rbx, rdi
test rdi, rdi
je 0x140047165
lea r15, [rax + rbx*2]
mov rbx, rax
nop dword [rax]
nop word [rax + rax]
lea rax, [r15 + 2]
sub rax, rbx
sar rax, 1
mov rcx, r14
je 0x14004713b
cmp word [rbx], 0x65
je 0x140047138
cmp rax, 1
je 0x14004713b
dec rax
add rbx, 2
cmp word [rbx], 0x65
jne 0x140047125
mov rcx, rbx
mov rbx, rcx
test rcx, rcx
je 0x1400471ab
mov r8, rdi
lea rdx, [0x1401cfeb0]
call fcn.14000c3c0
test eax, eax
je 0x14004715c
add rbx, 2
jmp 0x140047110
sub rbx, r12
cmp rbx, 2
jae 0x1400471ab
mov qword [rbp], 4
mov rax, qword [rbp + 0x20]
mov qword [rsp + 0x68], rax
lea rdx, [rsp + 0x68]
lea rcx, [rbp]
call fcn.140005b00
mov rbx, qword [rax]
mov rdi, qword [rbp + 0x20]
lea rcx, [rbp + 0x10]
call fcn.140003e60
sub rdi, rbx
lea r8, [rdi + 1]
lea rdx, [rax + rbx*2]
mov rcx, rax
call fcn.14000c460
mov qword [rbp + 0x20], rdi
mov r12, qword [rbp - 0x30]
mov rdi, qword [rbp - 0x70]
add rdi, 8
mov rax, qword [rdi]
mov qword [rbp - 0x70], rax
mov rdx, rdi
lea rcx, [rbp - 0x70]
call fcn.140001c20
mov rbx, qword [rbp - 0x70]
mov rax, qword [rdi]
mov rcx, qword [rax]
mov qword [rbp], rcx
mov rdx, rdi
lea rcx, [rbp]
call fcn.140001c20
mov rax, qword [rbp]
mov qword [rbp - 8], rax
xor edx, edx
lea rcx, [rbp - 8]
call fcn.140001c20
mov qword [rbp - 0x30], rbx
xor edx, edx
lea rcx, [rbp - 0x30]
call fcn.140001c20
mov rbx, qword [rbp - 8]
cmp rbx, qword [rbp - 0x30]
je 0x14004723c
lea rcx, [rbx + 0x10]
call fcn.140009740
mov rdx, rax
lea rcx, [rbp + 0x10]
call fcn.140048770
mov rbx, qword [rbp - 8]
cmp rax, 0xffffffffffffffff
jne 0x14004723c
mov rbx, qword [rbx]
mov qword [rbp - 8], rbx
cmp rbx, qword [rbp - 0x30]
jne 0x140047210
mov rax, qword [rdi]
mov qword [rsp + 0x68], rax
mov rdx, rdi
lea rcx, [rsp + 0x68]
call fcn.140001c20
cmp rbx, qword [rsp + 0x68]
je 0x1400473b3
mov rcx, qword [rbx + 0x30]
cmp rcx, qword [rbx + 0x38]
je 0x14004729e
mov rdx, r13
call fcn.14000e1e0
test al, al
jne 0x140047278
mov rdi, qword [rbx + 0x30]
jmp 0x140047280
mov rdi, qword [rbx + 0x38]
sub rdi, 0x20
cmp rsi, rdi
je 0x1400472cd
mov rcx, rsi
call fcn.140005b50
mov rcx, rdi
call fcn.140005ac0
mov rbx, qword [rdi + 0x10]
mov rcx, rdi
jmp 0x1400472ba
cmp rsi, r13
je 0x1400472cd
mov rcx, rsi
call fcn.140005b50
mov rcx, r13
call fcn.140005ac0
mov rbx, qword [r13 + 0x10]
mov rcx, r13
call fcn.14000bc10
mov r8, rbx
mov rdx, rax
mov rcx, rsi
call fcn.140020db0
mov r9, r12
mov r8, qword [rbp - 0x48]
mov rdx, rsi
call fcn.140047be0
mov edx, 0x80000000
lea ecx, [rax + rdx]
test edx, ecx
jne 0x140047b73
cmp eax, 0xc015001d
je 0x140047b73
test byte [rbp + 0x26b0], 2
je 0x140047b76
xor edx, edx
mov r8d, 0x1fe
lea rcx, [rbp + 0x30]
call fcn.140198190
mov edx, 0xff
lea rcx, [rbp + 0x30]
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea rdx, [rbp + 0x30]
lea rcx, [rbp - 0x68]
call fcn.140005760
mov rbx, rax
lea rcx, [0x1401cfeac]
call fcn.140005720
mov rcx, rax
call fcn.140005860
mov r8, rax
lea rdx, [0x1401cfeac]
mov rcx, rbx
call fcn.1400098f0
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140009ac0
nop
mov rdx, rsi
lea rcx, [rsp + 0x70]
call fcn.14000b990
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.140009ac0
lea rdx, [rsp + 0x48]
mov rcx, rsi
call fcn.140020610
lea rcx, [rsp + 0x48]
call fcn.140009a90
nop
lea rcx, [rsp + 0x70]
call fcn.140009a90
nop
lea rcx, [rbp - 0x68]
call fcn.140009a90
jmp 0x140047b76
mov r15d, dword [rbp + 0x26b0]
test r15b, 1
jne 0x1400473f3
mov r9, r12
mov r13, qword [rbp - 0x48]
mov r8, r13
mov rdx, rsi
call fcn.140047be0
mov edx, 0x80000000
lea ecx, [rax + rdx]
test edx, ecx
jne 0x140047b73
cmp eax, 0xc015001d
je 0x140047b73
test r15b, 4
je 0x1400473fe
mov r14d, 0xc0000225
jmp 0x140047b76
mov rcx, rsi
call fcn.140009740
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x140047b76
mov qword [rbp + 8], r14
lea r8, [rbp + 8]
lea rdx, str.SYSTEMCurrentControlSetControlSession_ManagerKnownDLLs
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
movsxd rdi, eax
test eax, eax
jne 0x140047523
mov ebx, r14d
test rdi, rdi
jne 0x140047523
xor edx, edx
mov r8d, 0x1fe
lea rcx, [rbp + 0x430]
call fcn.140198190
xor edx, edx
mov r8d, 0x1fe
lea rcx, [rbp + 0x230]
call fcn.140198190
mov dword [rbp - 0x30], 0xff
mov dword [rbp - 8], r14d
lea rax, [rbp - 0x30]
mov qword [rsp + 0x38], rax
lea rax, [rbp + 0x230]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 8]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], r14
lea r9, [rbp - 0x30]
lea r8, [rbp + 0x430]
mov edx, ebx
mov rcx, qword [rbp + 8]
call qword [sym.imp.ADVAPI32.dll_RegEnumValueW]
movsxd rdi, eax
lea rcx, [rbp + 0x10]
call fcn.140009740
mov rdx, rax
lea rcx, [rbp + 0x230]
call fcn.14016bf00
test eax, eax
jne 0x140047515
xor edx, edx
mov r8d, 0x1fe
lea rcx, [rbp + 0x30]
call fcn.140198190
mov dword [rbp - 0x30], 0xff
mov edx, 0xff
lea rcx, [rbp + 0x30]
test r15b, 8
je 0x140047506
call qword [sym.imp.KERNEL32.dll_GetSystemWow64DirectoryW]
jmp 0x14004750c
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test rdi, rdi
je 0x1400476b7
inc ebx
cmp ebx, 0x1000
jl 0x140047442
mov rbx, qword [rbp - 0x40]
mov rcx, rbx
call fcn.1400096a0
test al, al
jne 0x1400475c8
lea r8, [0x1401cfeac]
mov rdx, rbx
lea rcx, [rbp - 0x68]
call fcn.1400498f0
nop
lea rdx, [rbp + 0x10]
mov rcx, rax
call fcn.14000b990
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.140009ac0
lea rcx, [rbp - 0x28]
call fcn.140005b50
lea rcx, [rsp + 0x48]
call fcn.140005b50
mov rbx, rax
lea rcx, [rbp - 0x28]
call fcn.14000b720
mov rcx, rbx
call fcn.14000ee50
lea rdx, [rsp + 0x48]
lea rcx, [rbp - 0x28]
call fcn.14000b9e0
lea rcx, [rsp + 0x48]
call fcn.140009a90
nop
lea rcx, [rbp - 0x68]
call fcn.140009a90
lea rcx, [rbp - 0x28]
call fcn.140009740
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1400479fa
mov r8d, dword [r13 + 8]
lea rdx, [rbp - 0x68]
call fcn.140048140
mov rbx, rax
lea rcx, [0x1401cfeac]
call fcn.140005720
mov rcx, rax
call fcn.140005860
mov r8, rax
lea rdx, [0x1401cfeac]
mov rcx, rbx
call fcn.1400098f0
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140009ac0
nop
lea rdx, [rbp + 0x10]
lea rcx, [rsp + 0x70]
call fcn.14000b990
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.140009ac0
lea rcx, [rbp - 0x28]
call fcn.140005b50
lea rcx, [rsp + 0x48]
call fcn.140005b50
mov rbx, rax
lea rcx, [rbp - 0x28]
call fcn.14000b720
mov rcx, rbx
call fcn.14000ee50
lea rdx, [rsp + 0x48]
lea rcx, [rbp - 0x28]
call fcn.14000b9e0
lea rcx, [rsp + 0x48]
call fcn.140009a90
nop
lea rcx, [rsp + 0x70]
call fcn.140009a90
nop
lea rcx, [rbp - 0x68]
call fcn.140009a90
lea rcx, [rbp - 0x28]
call fcn.140009740
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1400479fa
mov edx, 0x1000
lea rcx, [rbp + 0x630]
test r15b, 8
je 0x140047761
call qword [sym.imp.KERNEL32.dll_GetSystemWow64DirectoryW]
jmp 0x140047767
lea rdx, [rbp + 0x30]
lea rcx, [rbp - 0x68]
call fcn.140005760
mov rbx, rax
lea rcx, [0x1401cfeac]
call fcn.140005720
mov rcx, rax
call fcn.140005860
mov r8, rax
lea rdx, [0x1401cfeac]
mov rcx, rbx
call fcn.1400098f0
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.140009ac0
nop
lea rcx, [rbp + 0x230]
call fcn.140005720
mov rcx, rax
call fcn.140005860
mov r8, rax
lea rdx, [rbp + 0x230]
lea rcx, [rsp + 0x48]
call fcn.1400098f0
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140009ac0
lea rdx, [rsp + 0x70]
mov rcx, rsi
call fcn.140020610
lea rcx, [rsp + 0x70]
call fcn.140009a90
nop
lea rcx, [rsp + 0x48]
call fcn.140009a90
nop
lea rcx, [rbp - 0x68]
call fcn.140009a90
jmp 0x140047b62
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea rdx, [rbp + 0x630]
lea rcx, [rbp - 0x68]
call fcn.140005760
mov rbx, rax
lea rcx, [0x1401cfeac]
call fcn.140005720
mov rcx, rax
call fcn.140005860
mov r8, rax
lea rdx, [0x1401cfeac]
mov rcx, rbx
call fcn.1400098f0
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140009ac0
nop
lea rdx, [rbp + 0x10]
lea rcx, [rsp + 0x70]
call fcn.14000b990
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.140009ac0
lea rcx, [rbp - 0x28]
call fcn.140005b50
lea rcx, [rsp + 0x48]
call fcn.140005b50
mov rbx, rax
lea rcx, [rbp - 0x28]
call fcn.14000b720
mov rcx, rbx
call fcn.14000ee50
lea rdx, [rsp + 0x48]
lea rcx, [rbp - 0x28]
call fcn.14000b9e0
lea rcx, [rsp + 0x48]
call fcn.140009a90
nop
lea rcx, [rsp + 0x70]
call fcn.140009a90
nop
lea rcx, [rbp - 0x68]
call fcn.140009a90
lea rcx, [rbp - 0x28]
call fcn.140009740
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1400479fa
mov edx, 0x1000
lea rcx, [rbp + 0x630]
call qword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea rdx, [rbp + 0x630]
lea rcx, [rbp - 0x68]
call fcn.140005760
mov rbx, rax
lea rcx, [0x1401cfeac]
call fcn.140005720
mov rcx, rax
call fcn.140005860
mov r8, rax
lea rdx, [0x1401cfeac]
mov rcx, rbx
call fcn.1400098f0
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140009ac0
nop
lea rdx, [rbp + 0x10]
lea rcx, [rsp + 0x70]
call fcn.14000b990
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.140009ac0
lea rcx, [rbp - 0x28]
call fcn.140005b50
lea rcx, [rsp + 0x48]
call fcn.140005b50
mov rbx, rax
lea rcx, [rbp - 0x28]
call fcn.14000b720
mov rcx, rbx
call fcn.14000ee50
lea rdx, [rsp + 0x48]
lea rcx, [rbp - 0x28]
call fcn.14000b9e0
lea rcx, [rsp + 0x48]
call fcn.140009a90
nop
lea rcx, [rsp + 0x70]
call fcn.140009a90
nop
lea rcx, [rbp - 0x68]
call fcn.140009a90
lea rcx, [rbp - 0x28]
call fcn.140009740
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1400479fa
lea rdx, [rbp + 0x630]
mov ecx, 0x1000
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea rdx, [rbp + 0x630]
lea rcx, [rbp - 0x68]
call fcn.140005760
mov rbx, rax
lea rcx, [0x1401cfeac]
call fcn.140005720
mov rcx, rax
call fcn.140005860
mov r8, rax
lea rdx, [0x1401cfeac]
mov rcx, rbx
call fcn.1400098f0
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140009ac0
nop
lea rdx, [rbp + 0x10]
lea rcx, [rsp + 0x70]
call fcn.14000b990
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.140009ac0
lea rcx, [rbp - 0x28]
call fcn.140005b50
lea rcx, [rsp + 0x48]
call fcn.140005b50
mov rbx, rax
lea rcx, [rbp - 0x28]
call fcn.14000b720
mov rcx, rbx
call fcn.14000ee50
lea rdx, [rsp + 0x48]
lea rcx, [rbp - 0x28]
call fcn.14000b9e0
lea rcx, [rsp + 0x48]
call fcn.140009a90
nop
lea rcx, [rsp + 0x70]
call fcn.140009a90
nop
lea rcx, [rbp - 0x68]
call fcn.140009a90
lea rcx, [rbp - 0x28]
call fcn.140009740
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140047a38
lea rax, [rbp - 0x28]
cmp rsi, rax
je 0x140047b62
mov rcx, rsi
call fcn.140005b50
lea rcx, [rbp - 0x28]
call fcn.140005ac0
mov rbx, qword [rbp - 0x18]
lea rcx, [rbp - 0x28]
call fcn.14000bc10
mov r8, rbx
mov rdx, rax
mov rcx, rsi
call fcn.140020db0
jmp 0x140047b62
mov r8d, 0x1000
lea rdx, [rbp + 0x630]
lea rcx, str.PATH
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea r8, [rbp - 0x38]
lea rdx, [0x1401cff44]
lea rcx, [rbp + 0x630]
call fcn.14016c21c
test rax, rax
je 0x140047b5c
mov rdx, rax
lea rcx, [rbp - 0x68]
call fcn.140005760
mov rbx, rax
lea rcx, [0x1401cfeac]
call fcn.140005720
mov rcx, rax
call fcn.140005860
mov r8, rax
lea rdx, [0x1401cfeac]
mov rcx, rbx
call fcn.1400098f0
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140009ac0
nop
lea rdx, [rbp + 0x10]
lea rcx, [rsp + 0x70]
call fcn.14000b990
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.140009ac0
lea rcx, [rbp - 0x28]
call fcn.140005b50
lea rcx, [rsp + 0x48]
call fcn.140005b50
mov rbx, rax
lea rcx, [rbp - 0x28]
call fcn.14000b720
mov rcx, rbx
call fcn.14000ee50
lea rdx, [rsp + 0x48]
lea rcx, [rbp - 0x28]
call fcn.14000b9e0
lea rcx, [rsp + 0x48]
call fcn.140009a90
nop
lea rcx, [rsp + 0x70]
call fcn.140009a90
nop
lea rcx, [rbp - 0x68]
call fcn.140009a90
lea rcx, [rbp - 0x28]
call fcn.140009740
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1400479fa
lea r8, [rbp - 0x38]
lea rdx, [0x1401cff44]
mov rcx, qword [rbp - 0x38]
call fcn.14016c21c
test rax, rax
jne 0x140047a72
mov r14d, 0xc0000225
mov rcx, qword [rbp + 8]
test rcx, rcx
jle 0x140047b76
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x140047b76
mov r14d, eax
lea rcx, [rbp + 0x10]
call fcn.140009a90
nop
lea rcx, [rbp - 0x28]
call fcn.140009a90
mov eax, r14d
mov rcx, qword [rbp + 0x2630]
xor rcx, rsp
call fcn.140115b30
add rsp, 0x2748
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret