Function at 0x140021bb0
Capabilities:
Get common file path

Disassembly:
push r15
mov eax, 0x10f8
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
call fcn.14008bc90
sub rsp, rax
xor r14d, r14d
mov word [rcx], r14w
movzx eax, word [rdx]
mov rbx, rcx
mov rsi, r8
test ax, ax
je 0x140021d15
lea rdi, [rdx + 2]
lea r12, [0x1400a78e4]
xor edx, edx
jmp 0x140021c18
test rdx, rdx
je 0x140021cf0
mov word [rdx], ax
add rdx, 2
movzx eax, word [rdi]
add rdi, 2
test ax, ax
je 0x140021d15
cmp ax, 0x25
jne 0x140021bf8
test rdx, rdx
je 0x140021d38
xor ebp, ebp
mov word [rdx], bp
lea rbp, [rsp + 0x8f0]
mov rdx, r12
mov rcx, rbp
call sub.msvcrt.dll__wcsicmp
test eax, eax
je 0x140021f00
lea rdx, str.PROGRAM
mov rcx, rbp
call sub.msvcrt.dll__wcsicmp
test eax, eax
je 0x140021f58
lea rdx, str.PROGRAM_BASE
mov rcx, rbp
call sub.msvcrt.dll__wcsicmp
test eax, eax
je 0x140021e78
lea rdx, [0x1400a7936]
mov rcx, rbp
call sub.msvcrt.dll__wcsicmp
test eax, eax
je 0x140022108
lea rdx, [0x1400a7942]
mov rcx, rbp
call sub.msvcrt.dll__wcsicmp
test eax, eax
je 0x140021fe0
lea rdx, str.CACHE_DIR
mov rcx, rbp
call sub.msvcrt.dll__wcsicmp
test eax, eax
jne 0x140021d58
lea rbp, [rsp + 0x2e0]
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
mov qword [rsp + 0x20], rbp
mov edx, 0x1c
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
je 0x140022088
nop word [rax + rax]
xor eax, eax
jmp 0x140021d1f
test rsi, rsi
je 0x140021ce8
xor ecx, ecx
mov word [rbx], ax
sub rsi, 1
add rbx, 2
mov word [rbx], cx
movzx eax, word [rdi]
add rdi, 2
test ax, ax
jne 0x140021c18
xor eax, eax
mov word [rbx], ax
mov eax, 1
add rsp, 0x10f8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
xor r13d, r13d
lea rdx, [rsp + 0x8f0]
mov word [rsp + 0x8f0], r13w
jmp 0x140021c08
lea rdx, str.TIME
mov rcx, rbp
call sub.msvcrt.dll__wcsicmp
test eax, eax
jne 0x140021ce8
lea rcx, [rsp + 0x48]
lea r15, [rsp + 0x4f0]
mov qword [rsp + 0x48], 0
call qword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov r9, qword [rsp + 0x48]
mov edx, 0x400
mov rcx, r15
lea r8, str._lld
call fcn.140005ce0
cmp word [rbx], 0
je 0x140022207
mov rbp, rsi
mov r9, rbx
nop dword [rax]
add r9, 2
sub rbp, 1
cmp word [r9], 0
jne 0x140021db8
movzx r8d, byte [rsp + 0x4f0]
test r8b, r8b
je 0x140021ed9
add rbp, r15
lea r14, [rsp + 0x2e0]
nop dword [rax]
mov rax, rbp
mov r13, r9
sub rax, r15
cmp word [r9], 0
je 0x140021e10
nop dword [rax + rax]
add r13, 2
sub rax, 1
cmp word [r13], 0
jne 0x140021e00
mov byte [rsp + 0x38], r8b
mov qword [rsp + 0x30], r9
test rax, rax
je 0x14009cbd4
mov rcx, r13
add r15, 1
call sub.msvcrt.dll_wcslen
movzx r8d, byte [rsp + 0x38]
mov rdx, r14
mov byte [rsp + 0x2e1], 0
lea rcx, [r13 + rax*2]
mov byte [rsp + 0x2e0], r8b
mov r8d, 2
call sub.msvcrt.dll_mbstowcs
mov r9, qword [rsp + 0x30]
movzx r8d, byte [r15]
add r9, 2
test r8b, r8b
jne 0x140021de8
jmp 0x140021fca
mov rcx, rbx
call sub.msvcrt.dll_wcslen
mov r8, rsi
lea rdx, str._PROGRAM_
mov rcx, rbx
sub r8, rax
call fcn.140021bb0
test al, al
je 0x140021ce8
mov rcx, rbx
call sub.msvcrt.dll_wcslen
cmp rax, 3
jbe 0x140021fca
lea rbp, [rbx + rax*2 - 8]
lea rdx, [0x1400a792c]
mov rcx, rbp
call sub.msvcrt.dll__wcsicmp
test eax, eax
jne 0x140021fca
xor r10d, r10d
mov word [rbp], r10w
cmp word [rbx], 0
je 0x140021ef8
xor eax, eax
nop dword [rax + rax]
add rbx, 2
sub rsi, 1
cmp word [rbx], 0
jne 0x140021f20
test al, al
jne 0x140021f47
nop word [rax + rax]
xor edx, edx
jmp 0x140021c08
mov rdx, rbx
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp word [rbx], 0
je 0x140021f47
mov eax, 1
nop word cs:[rax + rax]
add rbx, 2
sub rsi, 1
cmp word [rbx], 0
jne 0x140021f20
test al, al
je 0x140021ef8
jmp 0x140021f47
sub rbx, 2
xor r8d, r8d
add rsi, 1
mov word [rbx], r8w
cmp word [rbx - 2], 0x5c
je 0x140021f38
xor edx, edx
jmp 0x140021c08
mov rax, qword [str.8._f_]
cmp word [rbx], 0
mov rdx, rsi
mov rax, qword [rax]
mov rax, qword [rax]
mov rcx, qword [rax]
mov rax, rbx
je 0x140021f86
nop dword [rax]
add rax, 2
sub rdx, 1
cmp word [rax], 0
jne 0x140021f78
movzx r8d, word [rcx]
test r8w, r8w
je 0x140021fc3
test rdx, rdx
jne 0x140021fa9
jmp 0x140022226
test rdx, rdx
je 0x14009cbd4
add rcx, 2
mov word [rax], r8w
add rax, 2
sub rdx, 1
movzx r8d, word [rcx]
test r8w, r8w
jne 0x140021fa0
xor r11d, r11d
mov word [rax], r11w
cmp word [rbx], 0
je 0x140021ef8
xor eax, eax
jmp 0x140021ee0
lea rbp, [rsp + 0xd0]
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
mov qword [rsp + 0x20], rbp
mov edx, 0x28
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jne 0x140021ce8
cmp word [rbx], 0
mov rdx, rsi
mov rax, rbx
je 0x140022026
nop dword [rax]
add rax, 2
sub rdx, 1
cmp word [rax], 0
jne 0x140022018
movzx r8d, word [rsp + 0xd0]
test r8w, r8w
je 0x14002206b
test rdx, rdx
je 0x14009cbd4
mov rcx, rbp
jmp 0x140022051
test rdx, rdx
je 0x14009cbd4
add rcx, 2
mov word [rax], r8w
add rax, 2
sub rdx, 1
movzx r8d, word [rcx]
test r8w, r8w
jne 0x140022048
xor r9d, r9d
mov word [rax], r9w
cmp word [rbx], 0
jne 0x140021f11
jmp 0x140021f47
cmp word [rbx], 0
mov rdx, rsi
mov rax, rbx
je 0x1400220a6
nop dword [rax]
add rax, 2
sub rdx, 1
cmp word [rax], 0
jne 0x140022098
movzx r8d, word [rsp + 0x2e0]
test r8w, r8w
je 0x14002206b
test rdx, rdx
je 0x14009cbd4
mov rcx, rbp
jmp 0x1400220d1
test rdx, rdx
je 0x14009cbd4
add rcx, 2
mov word [rax], r8w
add rax, 2
sub rdx, 1
movzx r8d, word [rcx]
test r8w, r8w
jne 0x1400220c8
xor r9d, r9d
mov word [rax], r9w
cmp word [rbx], 0
jne 0x140021f11
jmp 0x140021f47
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea r15, [rsp + 0x50]
mov edx, pe_nt_image_headers64
lea r8, [0x1400a793e]
mov r9d, eax
mov rcx, r15
call fcn.140005ce0
cmp word [rbx], 0
je 0x1400221eb
mov rbp, rsi
mov r14, rbx
nop word [rax + rax]
add r14, 2
sub rbp, 1
cmp word [r14], 0
jne 0x140022140
movzx r13d, byte [rsp + 0x50]
test r13b, r13b
je 0x140021ed9
lea rax, [r15 + rbp]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x4f0]
mov qword [rsp + 0x38], rax
nop dword [rax]
mov rax, qword [rsp + 0x30]
mov rbp, r14
sub rax, r15
cmp word [r14], 0
je 0x14002219f
nop word [rax + rax]
add rbp, 2
sub rax, 1
cmp word [rbp], 0
jne 0x140022190
test rax, rax
je 0x14009cbd4
mov rcx, rbp
add r15, 1
add r14, 2
call sub.msvcrt.dll_wcslen
mov rdx, qword [rsp + 0x38]
mov r8d, 2
mov byte [rsp + 0x4f0], r13b
lea rcx, [rbp + rax*2]
mov byte [rsp + 0x4f1], 0
call sub.msvcrt.dll_mbstowcs
movzx r13d, byte [r15]
test r13b, r13b
jne 0x140022178
jmp 0x140021fca
movzx r13d, byte [rsp + 0x50]
mov rbp, rsi
mov r14, rbx
test r13b, r13b
jne 0x14002215e
xor edx, edx
jmp 0x140021c08
movzx r8d, byte [rsp + 0x4f0]
mov rbp, rsi
mov r9, rbx
test r8b, r8b
jne 0x140021dd9
xor edx, edx
jmp 0x140021c08
jmp 0x14009cbd4