Function at 0x14018f550
Capabilities:
Get common file path

Disassembly:
mov qword [rsp + 8], rcx
push rbp
push rbx
push rsi
push rdi
push r14
push r15
mov rbp, rsp
sub rsp, 0x48
mov rsi, rcx
xor ebx, ebx
mov dword [rbp - 0x28], ebx
lea r15, [0x140484d90]
mov qword [rbp + 0x48], r15
mov eax, dword [0x14049b204]
cmp eax, 0xfffffffe
jle 0x14018f587
call fcn.14018ff40
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov qword [rbp + 0x50], rbx
lea r8, [rbp + 0x50]
mov edx, 8
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov rdi, 0xffffffffffffffff
test eax, eax
je 0x14018f694
mov dword [rbp + 0x38], ebx
lea r8, [rbp + 0x38]
xor edx, edx
mov rcx, qword [rbp + 0x50]
call qword [sym.imp.USERENV.dll_GetUserProfileDirectoryW]
test eax, eax
jne 0x14018f68a
mov eax, dword [rbp + 0x38]
test eax, eax
je 0x14018f68a
mov ecx, eax
mov eax, 2
mul rcx
cmovb rax, rdi
mov rcx, rax
call fcn.14022a514
mov r14, rax
lea r8, [rbp + 0x38]
mov rdx, rax
mov rcx, qword [rbp + 0x50]
call qword [sym.imp.USERENV.dll_GetUserProfileDirectoryW]
test eax, eax
je 0x14018f682
mov r8d, edi
mov rdx, r14
lea rcx, [rbp - 0x20]
call fcn.1400ba830
nop
mov rbx, qword [rax]
mov qword [rax], r15
mov dword [rbp - 0x28], select
mov rax, qword [rbp - 0x20]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f640
cmp ecx, edi
je 0x14018f654
mov rax, qword [rbp - 0x20]
mov ecx, edi
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x14018f654
mov edx, 2
mov r8d, 8
mov rcx, qword [rbp - 0x20]
call fcn.1400affb0
mov rcx, qword [rbp + 0x48]
mov qword [rbp + 0x48], rbx
mov eax, dword [rcx]
test eax, eax
je 0x14018f672
cmp eax, 0xffffffff
je 0x14018f682
mov eax, edi
lock xadd dword [rcx], eax
cmp eax, 1
jne 0x14018f682
mov edx, 2
mov r8d, 8
call fcn.1400affb0
mov rcx, r14
call fcn.140229de4
mov rcx, qword [rbp + 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rbp + 0x48]
cmp dword [rax + 4], 0
je 0x14018f6af
lea rcx, [rbp + 0x48]
call fcn.1400dc860
test al, al
jne 0x14018f9d0
lea rdx, str.USERPROFILE
lea rcx, [rbp + 0x50]
call fcn.1400abd20
nop
mov rdx, rax
lea rcx, [rbp + 0x40]
call fcn.1400dfd00
mov rdx, qword [rbp + 0x48]
mov rcx, qword [rax]
mov qword [rbp + 0x48], rcx
mov qword [rax], rdx
mov rax, qword [rbp + 0x40]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f6f8
cmp ecx, 0xffffffff
je 0x14018f70d
mov rax, qword [rbp + 0x40]
mov ecx, edi
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x14018f70d
mov edx, 2
mov r8d, 8
mov rcx, qword [rbp + 0x40]
call fcn.1400affb0
nop
mov rax, qword [rbp + 0x50]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f72b
cmp ecx, 0xffffffff
je 0x14018f73f
mov rax, qword [rbp + 0x50]
mov ecx, edi
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x14018f73f
mov edx, 1
mov r8d, 8
mov rcx, qword [rbp + 0x50]
call fcn.1400affb0
mov rax, qword [rbp + 0x48]
cmp dword [rax + 4], 0
je 0x14018f75a
lea rcx, [rbp + 0x48]
call fcn.1400dc860
test al, al
jne 0x14018f9d0
lea rdx, str.HOMEPATH
lea rcx, [rbp - 0x10]
call fcn.1400abd20
nop
mov rdx, rax
lea rcx, [rbp - 0x18]
call fcn.1400dfd00
mov rbx, rax
lea rdx, str.HOMEDRIVE
lea rcx, [rbp - 0x20]
call fcn.1400abd20
nop
mov rdx, rax
lea rcx, [rbp + 0x50]
call fcn.1400dfd00
nop
mov rax, qword [rax]
mov qword [rbp + 0x40], rax
mov ecx, dword [rax]
inc ecx
cmp ecx, 1
jbe 0x14018f7af
mov rax, qword [rbp + 0x40]
lock inc dword [rax]
or dword [rbp - 0x28], 2
mov rdx, rbx
lea rcx, [rbp + 0x40]
call fcn.1400b7020
mov rcx, qword [rbp + 0x48]
mov rax, qword [rbp + 0x40]
mov qword [rbp + 0x48], rax
mov qword [rbp + 0x40], rcx
mov eax, dword [rcx]
test eax, eax
je 0x14018f7e5
cmp eax, 0xffffffff
je 0x14018f7fa
mov eax, edi
lock xadd dword [rcx], eax
cmp eax, 1
jne 0x14018f7fa
mov edx, 2
mov r8d, 8
mov rcx, qword [rbp + 0x40]
call fcn.1400affb0
nop
mov rax, qword [rbp + 0x50]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f818
cmp ecx, 0xffffffff
je 0x14018f82d
mov rax, qword [rbp + 0x50]
mov ecx, edi
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x14018f82d
mov edx, 2
mov r8d, 8
mov rcx, qword [rbp + 0x50]
call fcn.1400affb0
nop
mov rax, qword [rbp - 0x20]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f84b
cmp ecx, 0xffffffff
je 0x14018f860
mov rax, qword [rbp - 0x20]
mov ecx, edi
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x14018f860
mov edx, 1
mov r8d, 8
mov rcx, qword [rbp - 0x20]
call fcn.1400affb0
nop
mov rax, qword [rbp - 0x18]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f87e
cmp ecx, 0xffffffff
je 0x14018f893
mov rax, qword [rbp - 0x18]
mov ecx, edi
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x14018f893
mov edx, 2
mov r8d, 8
mov rcx, qword [rbp - 0x18]
call fcn.1400affb0
nop
mov rax, qword [rbp - 0x10]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f8b1
cmp ecx, 0xffffffff
je 0x14018f8c5
mov rax, qword [rbp - 0x10]
mov ecx, edi
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x14018f8c5
mov edx, 1
mov r8d, 8
mov rcx, qword [rbp - 0x10]
call fcn.1400affb0
mov rax, qword [rbp + 0x48]
cmp dword [rax + 4], 0
je 0x14018f8e0
lea rcx, [rbp + 0x48]
call fcn.1400dc860
test al, al
jne 0x14018f9d0
lea rdx, str.HOME
lea rcx, [rbp + 0x50]
call fcn.1400abd20
nop
mov rdx, rax
lea rcx, [rbp + 0x40]
call fcn.1400dfd00
mov rdx, qword [rbp + 0x48]
mov rcx, qword [rax]
mov qword [rbp + 0x48], rcx
mov qword [rax], rdx
mov rax, qword [rbp + 0x40]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f929
cmp ecx, 0xffffffff
je 0x14018f93e
mov rax, qword [rbp + 0x40]
mov ecx, edi
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x14018f93e
mov edx, 2
mov r8d, 8
mov rcx, qword [rbp + 0x40]
call fcn.1400affb0
nop
mov rax, qword [rbp + 0x50]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f95c
cmp ecx, 0xffffffff
je 0x14018f970
mov rax, qword [rbp + 0x50]
mov ecx, edi
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x14018f970
mov edx, 1
mov r8d, 8
mov rcx, qword [rbp + 0x50]
call fcn.1400affb0
mov rax, qword [rbp + 0x48]
cmp dword [rax + 4], 0
je 0x14018f987
lea rcx, [rbp + 0x48]
call fcn.1400dc860
test al, al
jne 0x14018f9d0
lea rcx, [rbp + 0x40]
call fcn.140191df0
mov rdx, qword [rbp + 0x48]
mov rcx, qword [rax]
mov qword [rbp + 0x48], rcx
mov qword [rax], rdx
mov rax, qword [rbp + 0x40]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f9bc
cmp ecx, 0xffffffff
je 0x14018f9d0
mov rax, qword [rbp + 0x40]
mov ecx, edi
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x14018f9d0
mov edx, 2
mov r8d, 8
mov rcx, qword [rbp + 0x40]
call fcn.1400affb0
lea rdx, [rbp + 0x48]
mov rcx, rsi
call fcn.14012bb90
nop
mov rax, qword [rbp + 0x48]
mov ecx, dword [rax]
test ecx, ecx
je 0x14018f9f9
cmp ecx, 0xffffffff
je 0x14018fa0d
mov rax, qword [rbp + 0x48]
lock xadd dword [rax], edi
cmp edi, 1
jne 0x14018fa0d
mov edx, 2
mov r8d, 8
mov rcx, qword [rbp + 0x48]
call fcn.1400affb0
mov rax, rsi
add rsp, 0x48
pop r15
pop r14
pop rdi
pop rsi
pop rbx
pop rbp
ret