Function at 0x180017640
Capabilities:
Check if file exists
Get common file path
Get file attributes

Disassembly:
mov rax, rsp
push rdi
sub rsp, 0x4b0
mov qword [rsp + 0x48], 0xfffffffffffffffe
mov qword [rax + 0x18], rbx
mov qword [rax + 0x20], rsi
mov rax, qword [0x18008b590]
xor rax, rsp
mov qword [rsp + 0x4a0], rax
mov rbx, rdx
mov rsi, rcx
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
lea r8, [rcx - 1]
lea rcx, [rsi + 0x20]
call fcn.180006be0
mov rcx, rbx
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x1800176f4
mov rcx, qword [rsi + 0x10]
cmp rcx, 0xffffffffffffffff
je 0x1800176b5
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsi + 0x10], 0xffffffffffffffff
xor edi, edi
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], edi
mov dword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov edx, 0xc0000000
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsi + 0x10], rax
cmp rax, 0xffffffffffffffff
jne 0x1800176ed
call fcn.180007940
mov edi, eax
mov eax, edi
jmp 0x1800178a1
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x180017711
and eax, 0x10
je 0x180017711
mov eax, 0x80004005
jmp 0x1800178a1
xor edi, edi
mov word [rsp + 0x80], di
xor edx, edx
mov r8d, 0x206
lea rcx, [rsp + 0x82]
call fcn.18005ce70
mov rcx, rbx
call qword [sym.imp.SHLWAPI.dll_PathIsRelativeW]
test eax, eax
je 0x180017789
lea rdx, [rsp + 0x80]
mov ecx, 0x104
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
jne 0x18001775e
call fcn.180007940
jmp 0x1800178a1
lea rcx, [rsp + 0x80]
call qword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov r8, rbx
mov edx, 0x104
lea rcx, [rsp + 0x80]
call fcn.180058f84
lea rbx, [rsp + 0x80]
mov rcx, rbx
call qword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
mov qword [rsp + 0x70], 7
mov qword [rsp + 0x68], rdi
mov word [rsp + 0x58], di
sub rax, rbx
sar rax, 1
mov r8, rax
mov rdx, rbx
lea rcx, [rsp + 0x50]
call fcn.180006be0
nop
mov word [rsp + 0x290], di
xor edx, edx
mov r8d, 0x206
lea rcx, [rsp + 0x292]
call fcn.18005ce70
lea rcx, [rsp + 0x58]
cmp qword [rsp + 0x70], 8
cmovae rcx, qword [rsp + 0x58]
lea r9, [rsp + 0x290]
xor r8d, r8d
lea rdx, [0x18007cbd8]
call qword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
jne 0x180017823
call fcn.180007940
mov edi, eax
cmp qword [rsp + 0x70], 8
jb 0x18001781f
mov rcx, qword [rsp + 0x58]
call fcn.18005822c
mov eax, edi
jmp 0x1800178a1
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rsp + 0x290]
repne scasw ax, word [rdi]
not rcx
lea r8, [rcx - 1]
lea rdx, [rsp + 0x290]
lea rcx, [rsi + 0x48]
call fcn.180006be0
cmp qword [rsi + 0x60], 0
jne 0x18001786c
cmp qword [rsp + 0x70], 8
jb 0x180017865
mov rcx, qword [rsp + 0x58]
call fcn.18005822c
mov eax, 0x80004005
jmp 0x1800178a1
cmp qword [rsi + 0x68], 8
jb 0x180017879
mov rdx, qword [rsi + 0x50]
jmp 0x18001787d
lea rdx, [rsi + 0x50]
mov r8d, 1
mov rcx, rsi
call fcn.1800174d0
mov edi, eax
cmp qword [rsp + 0x70], 8
jb 0x18001789f
mov rcx, qword [rsp + 0x58]
call fcn.18005822c
mov eax, edi
mov rcx, qword [rsp + 0x4a0]
xor rcx, rsp
call fcn.180058250
lea r11, [rsp + 0x4b0]
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rsp, r11
pop rdi
ret