Function at 0x417780
Capabilities:
Get common file path

Disassembly:
push r12
mov eax, 0x1040
push rbp
push rdi
push rsi
push rbx
call fcn.004282b0
sub rsp, rax
cmp r8d, 3
mov rsi, rcx
mov rdi, rdx
mov ebx, r8d
mov ebp, r9d
je 0x417960
cmp r8d, 4
mov qword [rcx + 0x10], 0
je 0x417920
cmp r8d, 2
je 0x417820
cmp r8d, 1
jne 0x4178d0
mov eax, dword [rsp + 0x1090]
xor r9d, r9d
xor r8d, r8d
mov rcx, rdi
mov qword [rsp + 0x30], 0
mov edx, 0x40000000
mov dword [rsp + 0x20], 2
or eax, 0x8000000
mov dword [rsp + 0x28], eax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsi + 8], rax
cmp rax, 0xffffffffffffffff
je 0x417863
cmp rax, 0xffffffffffffffff
setne al
add rsp, 0x1040
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
mov eax, dword [rsp + 0x1090]
xor r9d, r9d
xor r8d, r8d
mov rcx, rdi
mov qword [rsp + 0x30], 0
mov edx, 0x40000000
mov dword [rsp + 0x20], 1
or eax, 0x8000000
mov dword [rsp + 0x28], eax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsi + 8], rax
mov rax, qword [rsi + 8]
cmp rax, 0xffffffffffffffff
jne 0x41780a
test bpl, bpl
jne 0x417a04
test ebx, ebx
jne 0x41780a
mov r9d, eax
mov rax, qword [0x0042cd50]
mov r8, rdi
xor edx, edx
lea rbx, [rsp + 0x40]
mov dword [rsp + 0x28], 0x1000
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x20], rbx
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov rax, qword [0x0042cd40]
mov r9, rbx
xor r8d, r8d
lea rcx, str._r_c_r_Cant_open__s_n
mov edx, dword [rax]
call sub.msvcrt.dll_printf
mov rax, qword [rsi + 8]
jmp 0x41780a
test ebx, ebx
jne 0x417859
mov eax, dword [rsp + 0x1090]
xor r9d, r9d
mov r8d, 1
mov rcx, rdi
mov qword [rsp + 0x30], 0
mov edx, 0x80000000
mov dword [rsp + 0x20], 3
or eax, 0x8000000
mov dword [rsp + 0x28], eax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsi + 8], rax
jmp 0x417804
mov qword [rsp + 0x30], 0
xor r9d, r9d
xor r8d, r8d
mov edx, 0x100
mov dword [rsp + 0x28], 0x2000000
mov rcx, rdi
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsi + 8], rax
jmp 0x417859
lea r12, [rsp + 0x40]
mov ecx, 0x208
call fcn.0041b8f0
mov rdx, r12
mov ecx, 0x104
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp eax, 0x104
jg 0x4179ee
test eax, eax
je 0x4179ee
xor r8d, r8d
mov r9, rdi
mov rcx, r12
lea rdx, [0x0042b320]
call qword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x4179ee
mov eax, dword [rsp + 0x1090]
mov qword [rsi], rdi
xor r9d, r9d
xor r8d, r8d
mov qword [rsi + 0x10], 0
mov edx, 0xc0000000
mov rcx, rdi
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x20], 2
or eax, 0x4000100
mov dword [rsp + 0x28], eax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsi + 8], rax
jmp 0x417804
lea rcx, str._n__ERROR__get_tempfile_failed_
call sub.msvcrt.dll_puts
mov ecx, 1
call sub.msvcrt.dll_exit
mov r9d, eax
mov rax, qword [0x0042cd50]
mov r8, rdi
xor edx, edx
lea rbx, [rsp + 0x40]
mov dword [rsp + 0x28], 0x1000
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x20], rbx
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea rcx, str._n__ERROR__Cant_open_create__s__n
mov rdx, rbx
call sub.msvcrt.dll_printf
mov ecx, 1
call sub.msvcrt.dll_exit
nop
nop
nop word [rax + rax]