Function at 0x4080e0
Capabilities:
Create directory
Get common file path
Get disk information
Query environment variable

Disassembly:
push r15
mov eax, 0x4038
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
call fcn.0040e2a0
sub rsp, rax
cmp qword [rcx + 0x3040], 0
mov r12, rcx
je 0x408280
lea rcx, [0x00412c6a]
call fcn.00407fc0
mov rcx, qword [r12 + 0x3040]
xor r8d, r8d
xor edx, edx
mov r14, rax
call fcn.00408a30
test rax, rax
mov rbx, rax
je 0x4083f0
lea rbp, [rsp + 0x30]
mov r8d, 0x1000
mov rcx, rax
mov rdx, rbp
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov rcx, rbx
mov esi, eax
call sub.msvcrt.dll_free
test esi, esi
je 0x4083b4
mov rcx, rbp
call fcn.00408be0
test eax, eax
je 0x4082d0
cmp word [rsp + 0x34], 0x5c
jne 0x4083a0
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetDriveTypeW]
cmp eax, 1
jle 0x4083d2
mov rcx, rbp
call qword [sym.imp.msvcrt.dll__wcsdup]
test rax, rax
mov rbx, rax
je 0x4083c0
lea rcx, [0x00412f28]
mov rdx, rbx
call qword [sym.imp.msvcrt.dll__wputenv_s]
mov rcx, rbx
mov esi, eax
call sub.msvcrt.dll_free
test esi, esi
jne 0x408422
lea rdi, [rsp + 0x2030]
mov ecx, 0x1000
mov ebx, 5
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
call qword [sym.imp.msvcrt.dll__getpid]
lea r8, str._MEI_d
mov edx, 0x10
mov rcx, rbp
mov r9d, eax
call fcn.00407f90
mov r13, qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov r15, qword [sym.imp.msvcrt.dll__wtempnam]
mov rdx, rbp
mov rcx, rdi
call r15
mov rdx, qword [r12 + 0x3038]
mov rsi, rax
mov rcx, rax
call r13
test eax, eax
jne 0x408290
mov rcx, rsi
call sub.msvcrt.dll_free
sub ebx, 1
jne 0x40820b
mov ebx, 0xffffffff
cmp qword [r12 + 0x3040], 0
je 0x408262
test r14, r14
je 0x4082c0
lea rcx, [0x00412c6a]
mov rdx, r14
call fcn.00408050
mov rcx, r14
call sub.msvcrt.dll_free
mov eax, ebx
add rsp, 0x4038
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea rbp, [rsp + 0x30]
xor r14d, r14d
jmp 0x4081c5
lea rdx, [r12 + 0x2022]
mov r8d, 0x1000
mov rcx, rsi
call fcn.00408940
xor ebx, ebx
test rax, rax
je 0x4083fe
mov rcx, rsi
call sub.msvcrt.dll_free
jmp 0x40823b
lea rcx, [0x00412c6a]
call fcn.004080a0
jmp 0x408262
xor ecx, ecx
mov r8d, 0x1000
mov rdx, rbp
call qword [sym.imp.msvcrt.dll__wfullpath]
test rax, rax
mov rbx, rax
je 0x408414
mov edx, 0x5c
mov rcx, rax
call sub.msvcrt.dll_wcschr
mov r13, qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test rax, rax
mov r15, rax
je 0x40835d
mov r13, qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea rdi, [rsp + 0x2030]
lea rsi, str._.s
nop
mov r9, r15
mov r8, rsi
mov edx, 0x1000
mov qword [rsp + 0x20], rbx
sub r9, rbx
mov rcx, rdi
sar r9, 1
call qword [sym.imp.msvcrt.dll__snwprintf]
xor edx, edx
mov rcx, rdi
call r13
lea rcx, [r15 + 2]
mov edx, 0x5c
call sub.msvcrt.dll_wcschr
test rax, rax
mov r15, rax
jne 0x408320
xor edx, edx
mov rcx, rbx
call r13
test eax, eax
jne 0x4081a3
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x4081a3
lea rdx, str.LOADER:_failed_to_create_runtime_tmpdir_path__ls__n
mov r8, rbx
lea rcx, str.CreateDirectory
call fcn.00402c60
mov rcx, rbx
call sub.msvcrt.dll_free
jmp 0x4083c0
lea rdx, [0x00412d76]
mov rcx, rbp
call sub.msvcrt.dll_wcscat
jmp 0x40817c
lea rcx, str.LOADER:_failed_to_expand_environment_variables_in_the_runtime_tmpdir._n
call fcn.00402ad0
mov rcx, r14
mov ebx, 0xffffffff
call sub.msvcrt.dll_free
jmp 0x408262
lea rcx, str.LOADER:_runtime_tmpdir_points_to_non_existent_drive__ls__type:__d___n
mov r8d, eax
mov rdx, rbp
call fcn.00402ad0
jmp 0x4083c0
lea rcx, [0x00412c70]
call fcn.00402ad0
jmp 0x4083c0
lea rcx, str.LOADER:_length_of_teporary_directory_path_exceeds_maximum_path_length__n
mov ebx, 0xffffffff
call fcn.00402ad0
jmp 0x4082b1
lea rcx, str.LOADER:_failed_to_obtain_the_absolute_path_of_the_runtime_tmpdir._n
call fcn.00402ad0
jmp 0x4083c0
lea rcx, str.LOADER:_failed_to_set_the_TMP_environment_variable._n
call fcn.00402ad0
jmp 0x4083c0