Function at 0x407950
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.0040ddf0
sub rsp, rax
cmp qword [rcx + 0x3068], 0
mov r12, rcx
je 0x407af0
lea rcx, [0x00411e9a]
call fcn.00407830
mov rcx, qword [r12 + 0x3068]
xor r8d, r8d
xor edx, edx
mov r14, rax
call fcn.00408600
test rax, rax
mov rbx, rax
je 0x407c64
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 0x407c30
mov rcx, rbp
call fcn.004087b0
test eax, eax
je 0x407b40
cmp word [rsp + 0x34], 0x5c
jne 0x407c15
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetDriveTypeW]
cmp eax, 1
jle 0x407c50
mov rcx, rbp
call qword [sym.imp.msvcrt.dll__wcsdup]
test rax, rax
mov rbx, rax
je 0x407c3c
lea rcx, [0x00412158]
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 0x407c96
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.00407800
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 0x407b00
mov rcx, rsi
call sub.msvcrt.dll_free
sub ebx, 1
jne 0x407a7b
mov ebx, 0xffffffff
cmp qword [r12 + 0x3068], 0
je 0x407ad2
test r14, r14
je 0x407b30
lea rcx, [0x00411e9a]
mov rdx, r14
call fcn.004078c0
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 0x407a35
lea rdx, [r12 + 0x2022]
mov r8d, 0x1000
mov rcx, rsi
call fcn.00408510
xor ebx, ebx
test rax, rax
je 0x407c72
mov rcx, rsi
call sub.msvcrt.dll_free
jmp 0x407aab
lea rcx, [0x00411e9a]
call fcn.00407910
jmp 0x407ad2
xor ecx, ecx
mov r8d, 0x1000
mov rdx, rbp
call qword [sym.imp.msvcrt.dll__wfullpath]
test rax, rax
mov rbx, rax
je 0x407c88
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 0x407bcd
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 0x407b90
xor edx, edx
mov rcx, rbx
call r13
test eax, eax
jne 0x407a13
mov rsi, qword [sym.imp.KERNEL32.dll_GetLastError]
call rsi
cmp eax, 0xb7
je 0x407a13
call rsi
lea r8, str.LOADER:_failed_to_create_runtime_tmpdir_path__ls__n
mov r9, rbx
lea rcx, str.CreateDirectory
mov edx, eax
call fcn.004025c0
mov rcx, rbx
call sub.msvcrt.dll_free
jmp 0x407c3c
lea rdx, [0x00411fa6]
mov rcx, rbp
call sub.msvcrt.dll_wcscat
jmp 0x4079ec
lea rcx, str.LOADER:_failed_to_expand_environment_variables_in_the_runtime_tmpdir._n
call fcn.00402460
mov rcx, r14
mov ebx, 0xffffffff
call sub.msvcrt.dll_free
jmp 0x407ad2
lea rcx, str.LOADER:_runtime_tmpdir_points_to_non_existent_drive__ls__type:__d___n
mov r8d, eax
mov rdx, rbp
call fcn.00402460
jmp 0x407c3c
lea rcx, [0x00411ea0]
call fcn.00402460
jmp 0x407c3c
lea rcx, str.LOADER:_length_of_teporary_directory_path_exceeds_maximum_path_length__n
mov ebx, 0xffffffff
call fcn.00402460
jmp 0x407b21
lea rcx, str.LOADER:_failed_to_obtain_the_absolute_path_of_the_runtime_tmpdir._n
call fcn.00402460
jmp 0x407c3c
lea rcx, str.LOADER:_failed_to_set_the_TMP_environment_variable._n
call fcn.00402460
jmp 0x407c3c