Function at 0x18013f250
Capabilities:
Get common file path

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x270]
sub rsp, 0x370
mov rax, qword [0x18018f008]
xor rax, rsp
mov qword [rbp + 0x260], rax
mov eax, 0x100
test r9, r9
mov rdi, rdx
mov r12d, 0x4000100
lea rdx, [rbp + 0x50]
mov r13, r9
cmovne r12d, eax
lea ecx, [rax + 4]
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x18013f514
cdqe
lea rbx, [rbp + 0x50]
xor esi, esi
lea rbx, [rbx + rax*2]
test rdi, rdi
je 0x18013f345
mov rcx, rdi
call sym.tcl86t.dll_hcl_GetString
mov dword [rsp + 0x5c], 0xc8
mov ecx, esi
mov dword [rsp + 0x58], ecx
lea rdx, [rsp + 0x60]
mov qword [rsp + 0x50], rdx
mov byte [rsp + 0x60], cl
test rax, rax
je 0x18013f304
mov edx, dword [rdi + 0x10]
lea r8, [rsp + 0x50]
mov rcx, rax
call sym.tcl86t.dll_hcl_UtfToUniCharDString
mov ecx, dword [rsp + 0x58]
mov rdx, qword [rsp + 0x50]
movsxd r8, ecx
mov rcx, rbx
call sub.VCRUNTIME140.dll_memcpy
mov rcx, qword [rsp + 0x50]
lea rax, [rsp + 0x60]
movsxd rdi, dword [rsp + 0x58]
cmp rcx, rax
je 0x18013f328
call sym.tcl86t.dll_hclpFree
lea rax, [rsp + 0x60]
mov dword [rsp + 0x58], esi
mov qword [rsp + 0x50], rax
mov dword [rsp + 0x5c], 0xc8
mov byte [rsp + 0x60], sil
jmp 0x18013f35d
mov eax, dword [0x180173260]
mov edi, 6
mov dword [rbx], eax
movzx eax, word [0x180173264]
mov word [rbx + 4], ax
mov rdx, qword [0x18018fa50]
lea rax, [rdi + rbx]
lea rcx, [rsp + 0x40]
mov qword [rsp + 0x48], rax
call qword [0x18018f090]
imul r15d, dword [rsp + 0x40], 0xf4240
mov eax, 0x80018005
mov r14d, 0x400
add r15d, dword [rsp + 0x44]
mul r15d
shr edx, 0xf
imul eax, edx, 0xfffd
sub r15d, eax
mov r8d, r15d
lea rdx, str._d.TMP
lea rcx, [rbp + 0x30]
call fcn.180001060
lea rax, [rsp + 0x60]
mov dword [rsp + 0x58], esi
inc r15w
mov qword [rsp + 0x50], rax
lea rax, [rbp + 0x30]
movzx r15d, r15w
mov dword [rsp + 0x5c], 0xc8
mov rdx, 0xffffffffffffffff
mov byte [rsp + 0x60], 0
inc rdx
cmp byte [rax + rdx], 0
jne 0x18013f3e1
lea r8, [rsp + 0x50]
lea rcx, [rbp + 0x30]
call sym.tcl86t.dll_hcl_UtfToUniCharDString
mov eax, dword [rsp + 0x58]
mov ebx, dword [rsp + 0x5c]
add eax, 1
cmovns esi, eax
cmp esi, ebx
jl 0x18013f474
add ebx, ebx
cmp esi, ebx
jl 0x18013f413
lea ebx, [rsi + 1]
mov rcx, qword [rsp + 0x50]
lea rax, [rsp + 0x60]
mov dword [rsp + 0x5c], ebx
cmp rcx, rax
jne 0x18013f456
mov ecx, ebx
call sym.tcl86t.dll_hclpAlloc
mov rdi, rax
test rax, rax
jne 0x18013f43d
test ebx, ebx
jne 0x18013f5d3
movsxd r8, dword [rsp + 0x58]
mov rcx, rdi
mov rdx, qword [rsp + 0x50]
call sub.VCRUNTIME140.dll_memcpy
mov qword [rsp + 0x50], rdi
jmp 0x18013f479
mov edx, ebx
call sym.tcl86t.dll_hclpRealloc
mov rdi, rax
test rax, rax
jne 0x18013f46d
test ebx, ebx
jne 0x18013f5e2
mov qword [rsp + 0x50], rax
jmp 0x18013f479
mov rdi, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x48]
movsxd rax, esi
mov dword [rsp + 0x58], esi
mov byte [rax + rdi], 0
mov eax, dword [rsp + 0x58]
mov rdx, qword [rsp + 0x50]
inc eax
movsxd r8, eax
call sub.VCRUNTIME140.dll_memcpy
mov rcx, qword [rsp + 0x50]
lea rax, [rsp + 0x60]
cmp rcx, rax
je 0x18013f4b0
call sym.tcl86t.dll_hclpFree
xor esi, esi
mov dword [rsp + 0x5c], 0xc8
mov qword [rsp + 0x30], rsi
lea rax, [rsp + 0x60]
mov dword [rsp + 0x28], r12d
lea rcx, [rbp + 0x50]
xor r9d, r9d
mov dword [rsp + 0x20], 1
xor r8d, r8d
mov qword [rsp + 0x50], rax
mov edx, 0xc0000000
mov dword [rsp + 0x58], esi
mov byte [rsp + 0x60], sil
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x18013f54d
dec r14d
test r14d, r14d
jle 0x18013f514
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x50
je 0x18013f3a0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call sym.tcl86t.dll_hclWinConvertError
xor eax, eax
mov rcx, qword [rbp + 0x260]
xor rcx, rsp
call fcn.180146240
mov rbx, qword [rsp + 0x3b0]
add rsp, 0x370
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
test r13, r13
je 0x18013f5c1
lea rcx, [rbp + 0x50]
call fcn.1801387d0
mov rdx, rax
mov rcx, r13
mov rbx, rax
call sym.tcl86t.dll_hcl_AppendObjToObj
mov edx, dword [rbx]
lea ecx, [rdx - 1]
mov dword [rbx], ecx
cmp edx, 1
jg 0x18013f5c1
mov rax, qword [rbx + 0x18]
test rax, rax
je 0x18013f59b
cmp qword [rax + 8], rsi
je 0x18013f59b
mov rcx, rbx
call sym.tcl86t.dll_hclFreeObj
mov edx, 6
mov rcx, rdi
call sym.tcl86t.dll_hcl_MakeFileChannel
jmp 0x18013f523
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x18013f5b2
cmp rcx, qword [0x18018f080]
je 0x18013f5b2
call sym.tcl86t.dll_hclpFree
mov rcx, rbx
mov dword [rbx + 0x10], 0xffffffff
call fcn.1801063c0
mov edx, 6
mov rcx, rdi
call sym.tcl86t.dll_hcl_MakeFileChannel
jmp 0x18013f523
mov edx, ebx
lea rcx, str.unable_to_alloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3
mov edx, ebx
lea rcx, str.unable_to_realloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3