Function at 0x140020510
Capabilities:
Get common file path

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x478
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x3f0], 0xfffffffffffffffe
mov qword [rbp + 0x3b8], rcx
mov qword [rbp + 0x3d8], 0
mov qword [rbp + 0x3e0], 2
mov qword [rbp + 0x3e8], 0
mov edi, 0x200
mov eax, 2
mov qword [rbp + 0x3a8], rax
xor eax, eax
mov qword [rbp + 0x3b0], rax
xor ebx, ebx
xor r14d, r14d
cmp rdi, 0x201
jae 0x1400205b0
jmp 0x14002059f
jae 0x140020678
cmp rdi, 0x201
jae 0x1400205b0
mov r12d, 0x200
lea r15, [rbp - 0x58]
mov r13, rdi
jmp 0x140020616
sub rdi, r14
sub rbx, r14
cmp rbx, rdi
jae 0x1400205e9
lea rcx, [rbp + 0x3d8]
mov rdx, r14
mov r8, rdi
call fcn.14002c350
mov rax, qword [rbp + 0x3d8]
mov qword [rbp + 0x3b0], rax
mov rax, qword [rbp + 0x3e0]
mov qword [rbp + 0x3a8], rax
mov eax, 0xffffffff
mov rbx, qword [rbp + 0x3b0]
cmp rbx, rax
mov r14d, 0xffffffff
cmovb r14, rbx
mov qword [rbp + 0x3e8], r14
mov r12, r14
mov r15, qword [rbp + 0x3a8]
mov r13, r14
xor ecx, ecx
call qword [sym.imp.kernel32.dll_SetLastError]
mov rcx, r15
mov edx, r13d
call qword [sym.imp.kernel32.dll_GetSystemDirectoryW]
mov esi, eax
test eax, eax
jne 0x14002063a
call qword [sym.imp.kernel32.dll_GetLastError]
test eax, eax
jne 0x1400206a6
mov edi, esi
cmp r13, rdi
jne 0x140020590
call qword [sym.imp.kernel32.dll_GetLastError]
cmp eax, 0x7a
jne 0x14002091a
add r13, r13
mov eax, 0xffffffff
cmp r13, rax
cmovae r13, rax
mov rdi, r13
cmp rdi, 0x201
jb 0x14002059f
jmp 0x1400205b0
cmp r12, rdi
jb 0x140020934
test esi, esi
je 0x1400206ee
lea rsi, [rdi + rdi]
movzx eax, byte [0x14007e218]
mov rcx, rsi
call fcn.140026320
test rax, rax
je 0x140020948
mov r14, rax
jmp 0x1400206f6
call qword [sym.imp.kernel32.dll_GetLastError]
mov esi, eax
shl rsi, 0x20
or rsi, 2
cmp qword [rbp + 0x3d8], 0
je 0x1400206d1
mov rcx, qword [rbp + 0x3e0]
mov edx, 2
call fcn.140005190
mov rcx, qword [rbp + 0x3b8]
mov qword [rcx + 8], rsi
movabs rax, 0x8000000000000000
mov qword [rcx], rax
jmp 0x140020906
mov r14d, 2
xor esi, esi
mov rcx, r14
mov rdx, r15
mov r8, rsi
call sub.VCRUNTIME140.dll_memcpy
cmp qword [rbp + 0x3d8], 0
je 0x14002071f
mov rcx, qword [rbp + 0x3e0]
mov edx, 2
call fcn.140005190
mov qword [rbp + 0x3c0], rdi
mov qword [rbp + 0x3c8], r14
mov qword [rbp + 0x3d0], rdi
lea rsi, [0x140075e27]
xor r15d, r15d
lea rbx, [rbp + 0x3c0]
xor r12d, r12d
jmp 0x140020762
mov r12d, ecx
mov word [r14 + rdi*2], r13w
inc rdi
mov qword [rbp + 0x3d0], rdi
test rsi, rsi
je 0x140020840
test r12w, r12w
je 0x1400207c0
xor ecx, ecx
mov r13d, r12d
cmp rdi, qword [rbp + 0x3c0]
jne 0x140020750
lea rax, [0x140075e27]
sub rax, rsi
add rax, 0xa
movabs rdx, 0xaaaaaaaaaaaaaaab
mul rdx
mov r8, rdx
shr r8, 1
cmp cx, 1
mov rax, r15
adc rax, 0xffffffffffffffff
sub r8, rax
inc r8
mov r12d, ecx
jmp 0x14002086b
lea rax, [0x140075e2f]
cmp rsi, rax
je 0x140020840
movzx edx, byte [rsi]
movzx r13d, dl
test r13b, r13b
js 0x1400207df
inc rsi
xor ecx, ecx
jmp 0x140020776
mov eax, r13d
and eax, 0x1f
movzx r8d, byte [rsi + 1]
and r8d, 0x3f
cmp r13b, 0xdf
jbe 0x140020885
movzx ecx, byte [rsi + 2]
shl r8d, 6
and ecx, 0x3f
or ecx, r8d
cmp dl, 0xf0
jb 0x140020899
movzx r13d, byte [rsi + 3]
and eax, 7
shl eax, 0x12
shl ecx, 6
and r13d, 0x3f
or r13d, ecx
or r13d, eax
cmp r13d, 0x110000
jne 0x1400208d6
nop word cs:[rax + rax]
cmp r15, 1
je 0x1400208ea
mov r15d, 1
xor r13d, r13d
mov esi, 0
mov r8d, 0
cmp rdi, qword [rbp + 0x3c0]
jne 0x140020753
inc r8
mov rcx, rbx
mov rdx, rdi
call fcn.14002c350
mov r14, qword [rbp + 0x3c8]
jmp 0x140020753
add rsi, 2
shl eax, 6
or eax, r8d
mov r13d, eax
xor ecx, ecx
jmp 0x140020776
add rsi, 3
shl eax, 0xc
or ecx, eax
mov r13d, ecx
cmp r13d, 0xffff
jbe 0x1400208e3
lea eax, [r13 + 0xff0000]
shr eax, 0xa
or eax, 0xd800
and r13d, 0x3ff
or r13d, 0xdc00
mov ecx, r13d
mov r13d, eax
jmp 0x140020776
add rsi, 4
cmp r13d, 0xffff
ja 0x1400208ae
xor ecx, ecx
jmp 0x140020776
mov rax, qword [rbp + 0x3d0]
mov rcx, qword [rbp + 0x3b8]
mov qword [rcx + 0x10], rax
movups xmm0, xmmword [rbp + 0x3c0]
movups xmmword [rcx], xmm0
add rsp, 0x478
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
lea rcx, str.internal_error:_entered_unreachable_code
lea r8, str.library_std_src_syspalwindowsmod.rsstrings_passed_to_WinAPI_cannot_contain_NULs
mov edx, 0x28
call fcn.14002b840
jmp 0x140020955
lea r8, str.library_std_src_syspalwindowsmod.rsstrings_passed_to_WinAPI_cannot_contain_NULs
mov rcx, rdi
mov rdx, r12
call fcn.14002b830
jmp 0x140020955
mov ecx, 2
mov rdx, rsi
call fcn.14002b690
ud2