Function at 0x140020e40
Capabilities:
Get common file path

Disassembly:
push r15
mov eax, 0x1108
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
call fcn.14008ec80
sub rsp, rax
xor edi, edi
mov word [rcx], di
movzx eax, word [rdx]
mov rbx, rcx
mov rsi, r8
test ax, ax
je 0x140020fb1
lea rbp, [rdx + 2]
lea r13, [0x1400aa77c]
xor edx, edx
lea r14, [rsp + 0x2f0]
jmp 0x140020eb1
test rdx, rdx
je 0x140020f90
mov word [rdx], ax
add rdx, 2
movzx eax, word [rbp]
add rbp, 2
test ax, ax
je 0x140020fb1
cmp ax, 0x25
jne 0x140020e90
test rdx, rdx
je 0x140020fc0
xor r10d, r10d
lea r12, [rsp + 0x900]
mov word [rdx], r10w
mov rcx, r12
mov rdx, r13
call sub.msvcrt.dll__wcsicmp
test eax, eax
je 0x140021180
lea rdx, str.PROGRAM
mov rcx, r12
call sub.msvcrt.dll__wcsicmp
test eax, eax
je 0x1400211d8
lea rdx, str.PROGRAM_BASE
mov rcx, r12
call sub.msvcrt.dll__wcsicmp
test eax, eax
je 0x1400210f0
lea rdx, [0x1400aa7ce]
mov rcx, r12
call sub.msvcrt.dll__wcsicmp
test eax, eax
je 0x140021378
lea rdx, [0x1400aa7da]
mov rcx, r12
call sub.msvcrt.dll__wcsicmp
test eax, eax
je 0x140021260
lea rdx, str.CACHE_DIR
mov rcx, r12
call sub.msvcrt.dll__wcsicmp
test eax, eax
jne 0x140020fe0
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
mov qword [rsp + 0x20], r14
mov edx, 0x1c
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
je 0x140021300
nop dword [rax]
xor eax, eax
add rsp, 0x1108
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
test rsi, rsi
je 0x140020f78
mov word [rbx], ax
movzx eax, word [rbp]
sub rsi, 1
add rbx, 2
add rbp, 2
test ax, ax
jne 0x140020eb1
xor eax, eax
mov word [rbx], ax
mov eax, 1
jmp 0x140020f7a
xor r11d, r11d
lea rdx, [rsp + 0x900]
mov word [rsp + 0x900], r11w
jmp 0x140020ea0
lea rdx, str.TIME
mov rcx, r12
call sub.msvcrt.dll__wcsicmp
test eax, eax
jne 0x140020f78
lea rcx, [rsp + 0x58]
lea rdi, [rsp + 0x500]
mov qword [rsp + 0x58], 0
call qword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov r9, qword [rsp + 0x58]
mov edx, 0x400
mov rcx, rdi
lea r8, str._lld
call fcn.140004e90
cmp word [rbx], 0
je 0x140021488
mov r12, rsi
mov r15, rbx
nop dword [rax]
add r15, 2
sub r12, 1
cmp word [r15], 0
jne 0x140021040
movzx edx, byte [rsp + 0x500]
test dl, dl
je 0x140021150
mov r9, rdi
add r12, rdi
nop dword [rax]
mov rax, r12
mov rdi, r15
sub rax, r9
cmp word [r15], 0
je 0x14002108e
nop dword [rax + rax]
add rdi, 2
sub rax, 1
cmp word [rdi], 0
jne 0x140021080
mov qword [rsp + 0x40], r9
mov byte [rsp + 0x38], dl
test rax, rax
je fcn.14009f796
mov rcx, rdi
add r15, 2
call sub.msvcrt.dll_wcslen
movzx edx, byte [rsp + 0x38]
mov r8d, 2
mov byte [rsp + 0x2f1], 0
lea rcx, [rdi + rax*2]
mov byte [rsp + 0x2f0], dl
mov rdx, r14
call sub.msvcrt.dll_mbstowcs
mov r9, qword [rsp + 0x40]
movzx edx, byte [r9 + 1]
add r9, 1
test dl, dl
jne 0x140021068
jmp 0x14002124a
mov rcx, rbx
call sub.msvcrt.dll_wcslen
mov r8, rsi
lea rdx, str._PROGRAM_
mov rcx, rbx
sub r8, rax
call fcn.140020e40
test al, al
je 0x140020f78
mov rcx, rbx
call sub.msvcrt.dll_wcslen
cmp rax, 3
jbe 0x14002124a
lea rdi, [rbx + rax*2 - 8]
lea rdx, [0x1400aa7c4]
mov rcx, rdi
call sub.msvcrt.dll__wcsicmp
test eax, eax
jne 0x14002124a
xor r8d, r8d
mov word [rdi], r8w
cmp word [rbx], 0
je 0x140021170
xor eax, eax
nop word [rax + rax]
add rbx, 2
sub rsi, 1
cmp word [rbx], 0
jne 0x1400211a0
test al, al
jne 0x1400211c5
nop word [rax + rax]
xor edx, edx
jmp 0x140020ea0
mov rdx, rbx
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp word [rbx], 0
je 0x1400211c5
mov eax, 1
nop word cs:[rax + rax]
add rbx, 2
sub rsi, 1
cmp word [rbx], 0
jne 0x1400211a0
test al, al
je 0x140021170
jmp 0x1400211c5
sub rbx, 2
xor edx, edx
add rsi, 1
mov word [rbx], dx
cmp word [rbx - 2], 0x5c
je 0x1400211b8
xor edx, edx
jmp 0x140020ea0
mov rax, qword [sym.imp.msvcrt.dll___wargv]
cmp word [rbx], 0
mov rdx, rsi
mov rax, qword [rax]
mov rax, qword [rax]
mov rcx, qword [rax]
mov rax, rbx
je 0x140021206
nop dword [rax]
add rax, 2
sub rdx, 1
cmp word [rax], 0
jne 0x1400211f8
movzx r8d, word [rcx]
test r8w, r8w
je 0x140021243
test rdx, rdx
jne 0x140021229
jmp 0x1400214a5
test rdx, rdx
je fcn.14009f796
add rcx, 2
mov word [rax], r8w
add rax, 2
sub rdx, 1
movzx r8d, word [rcx]
test r8w, r8w
jne 0x140021220
xor r9d, r9d
mov word [rax], r9w
cmp word [rbx], 0
je 0x140021170
xor eax, eax
jmp 0x140021158
lea rdi, [rsp + 0xe0]
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
mov qword [rsp + 0x20], rdi
mov edx, 0x28
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jne 0x140020f78
cmp word [rbx], 0
mov rdx, rsi
mov rax, rbx
je 0x1400212a6
nop dword [rax]
add rax, 2
sub rdx, 1
cmp word [rax], 0
jne 0x140021298
movzx r8d, word [rsp + 0xe0]
test r8w, r8w
je 0x1400212eb
test rdx, rdx
je fcn.14009f796
mov rcx, rdi
jmp 0x1400212d1
test rdx, rdx
je fcn.14009f796
add rcx, 2
mov word [rax], r8w
add rax, 2
sub rdx, 1
movzx r8d, word [rcx]
test r8w, r8w
jne 0x1400212c8
xor ecx, ecx
mov word [rax], cx
cmp word [rbx], 0
jne 0x140021191
jmp 0x1400211c5
cmp word [rbx], 0
mov rdx, rsi
mov rax, rbx
je 0x14002131e
nop dword [rax]
add rax, 2
sub rdx, 1
cmp word [rax], 0
jne 0x140021310
movzx ecx, word [rsp + 0x2f0]
test cx, cx
je 0x1400212eb
test rdx, rdx
je fcn.14009f796
mov r8, r14
jmp 0x140021349
test rdx, rdx
je fcn.14009f796
add r8, 2
mov word [rax], cx
add rax, 2
sub rdx, 1
movzx ecx, word [r8]
test cx, cx
jne 0x140021340
xor ecx, ecx
mov word [rax], cx
cmp word [rbx], 0
jne 0x140021191
jmp 0x1400211c5
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea rdi, [rsp + 0x60]
mov edx, pe_nt_image_headers64
lea r8, [0x1400aa7d6]
mov r9d, eax
mov rcx, rdi
call fcn.140004e90
cmp word [rbx], 0
je 0x14002146c
mov r12, rsi
mov r9, rbx
nop word [rax + rax]
add r9, 2
sub r12, 1
cmp word [r9], 0
jne 0x1400213b0
movzx r15d, byte [rsp + 0x60]
test r15b, r15b
je 0x140021150
lea rax, [rdi + r12]
mov r10, rdi
lea r12, [rsp + 0x500]
mov qword [rsp + 0x48], rax
nop word [rax + rax]
mov rax, qword [rsp + 0x48]
mov rdi, r9
sub rax, r10
cmp word [r9], 0
je 0x14002140e
nop word [rax + rax]
add rdi, 2
sub rax, 1
cmp word [rdi], 0
jne 0x140021400
mov qword [rsp + 0x40], r10
mov qword [rsp + 0x38], r9
test rax, rax
je fcn.14009f796
mov rcx, rdi
call sub.msvcrt.dll_wcslen
mov r8d, 2
mov rdx, r12
mov byte [rsp + 0x500], r15b
lea rcx, [rdi + rax*2]
mov byte [rsp + 0x501], 0
call sub.msvcrt.dll_mbstowcs
mov r10, qword [rsp + 0x40]
mov r9, qword [rsp + 0x38]
movzx r15d, byte [r10 + 1]
add r10, 1
add r9, 2
test r15b, r15b
jne 0x1400213e8
jmp 0x14002124a
movzx r15d, byte [rsp + 0x60]
mov r12, rsi
mov r9, rbx
test r15b, r15b
jne 0x1400213ce
xor edx, edx
jmp 0x140020ea0
movzx edx, byte [rsp + 0x500]
mov r12, rsi
mov r15, rbx
test dl, dl
jne 0x14002105f
xor edx, edx
jmp 0x140020ea0
jmp fcn.14009f796