Function at 0x408530
Capabilities:
Get common file path
Get disk information
Query environment variable

Disassembly:
push ebp
mov eax, 0x403c
push edi
push esi
push ebx
call fcn.0040f2e0
sub esp, eax
mov ebp, dword [esp + 0x4050]
lea edi, [esp + 0x30]
mov eax, dword [ebp + 0x3038]
mov dword [esp + 0x2c], eax
test eax, eax
je 0x408632
mov dword [esp], 0x41bdd2
call fcn.004083c0
mov dword [esp + 8], 0
mov dword [esp + 0x2c], eax
mov dword [esp + 4], 0
mov eax, dword [ebp + 0x3038]
mov dword [esp], eax
call fcn.004094e0
mov ebx, eax
test eax, eax
je 0x408920
lea edi, [esp + 0x30]
mov dword [esp + 8], 0x1000
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
sub esp, 0xc
mov esi, eax
mov dword [esp], ebx
call sub.msvcrt.dll_free
test esi, esi
je 0x4088d8
mov dword [esp], edi
call fcn.00409700
test eax, eax
je 0x408788
cmp word [esp + 0x34], 0x5c
jne 0x4088c0
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_GetDriveTypeW]
sub esp, 4
cmp eax, 1
jle 0x408900
mov dword [esp], edi
call dword [sym.imp.msvcrt.dll__wcsdup]
mov edx, eax
test eax, eax
je 0x4088e4
mov dword [esp + 4], edx
mov dword [esp + 0x24], edx
mov dword [esp], 0x41c088
call dword [sym.imp.msvcrt.dll__wputenv_s]
mov edx, dword [esp + 0x24]
mov ebx, eax
mov dword [esp], edx
call sub.msvcrt.dll_free
test ebx, ebx
jne 0x408948
lea esi, [esp + 0x2030]
mov dword [esp], 0x1000
mov ebx, 5
mov dword [esp + 4], esi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
sub esp, 8
call dword [sym.imp.msvcrt.dll__getpid]
mov dword [esp + 8], str._MEI_d
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x10
mov dword [esp], edi
call fcn.00408390
mov eax, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov dword [esp + 0x28], esi
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wtempnam]
mov esi, eax
mov eax, dword [ebp + 0x301c]
mov dword [esp], esi
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
call eax
sub esp, 8
test eax, eax
jne 0x408748
mov dword [esp], esi
call sub.msvcrt.dll_free
sub ebx, 1
jne 0x408681
mov ebx, 0xffffffff
mov eax, dword [ebp + 0x3038]
test eax, eax
je 0x4086ee
mov edi, dword [esp + 0x2c]
test edi, edi
je 0x408700
mov dword [esp + 4], edi
mov dword [esp], 0x41bdd2
call fcn.00408470
mov dword [esp], edi
call sub.msvcrt.dll_free
add esp, 0x403c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0x41bdd2
call fcn.004094e0
mov dword [esp + 4], 0x41bdd0
mov esi, eax
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wputenv_s]
mov dword [esp], esi
call sub.msvcrt.dll_free
add esp, 0x403c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebp + 0x2012]
mov dword [esp + 8], 0x1000
xor ebx, ebx
mov dword [esp + 4], eax
mov dword [esp], esi
mov dword [esp + 0x24], esi
call fcn.004093c0
mov edx, dword [esp + 0x24]
test eax, eax
je 0x40892e
mov dword [esp], edx
call sub.msvcrt.dll_free
jmp 0x4086c4
mov dword [esp + 8], 0x1000
mov dword [esp + 4], edi
mov dword [esp], 0
call dword [sym.imp.msvcrt.dll__wfullpath]
test eax, eax
je 0x408964
mov dword [esp + 4], 0x5c
mov dword [esp], eax
mov dword [esp + 0x24], eax
call sub.msvcrt.dll_wcschr
mov edx, dword [esp + 0x24]
test eax, eax
mov ebx, eax
je 0x408956
mov eax, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov dword [esp + 0x4050], ebp
mov ebp, ebx
lea esi, [esp + 0x2030]
mov dword [esp + 0x28], edi
mov edi, edx
mov dword [esp + 0x24], eax
mov ebx, eax
lea esi, [esi]
mov eax, ebp
mov dword [esp + 0x10], edi
sub eax, edi
mov dword [esp + 8], 0x41bff6
sar eax, 1
mov dword [esp + 4], 0x1000
mov dword [esp + 0xc], eax
mov dword [esp], esi
call dword [sym.imp.msvcrt.dll__snwprintf]
mov dword [esp + 4], 0
mov dword [esp], esi
call ebx
lea ecx, [ebp + 2]
sub esp, 8
mov dword [esp + 4], 0x5c
mov dword [esp], ecx
call sub.msvcrt.dll_wcschr
mov ebp, eax
test eax, eax
jne 0x4087f0
mov edx, edi
mov ebp, dword [esp + 0x4050]
mov edi, dword [esp + 0x28]
mov dword [esp], edx
mov eax, dword [esp + 0x24]
mov dword [esp + 0x28], edx
mov dword [esp + 4], 0
call eax
sub esp, 8
test eax, eax
mov edx, dword [esp + 0x28]
jne 0x408607
mov dword [esp + 0x24], edx
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
mov edx, dword [esp + 0x24]
cmp eax, 0xb7
je 0x408607
call ebx
mov edx, dword [esp + 0x24]
mov dword [esp], str.CreateDirectory
mov dword [esp + 8], str.LOADER:_failed_to_create_runtime_tmpdir_path__ls__n
mov dword [esp + 0xc], edx
mov dword [esp + 4], eax
call fcn.004027b0
mov edx, dword [esp + 0x24]
mov dword [esp], edx
call sub.msvcrt.dll_free
jmp 0x4088e4
mov dword [esp + 4], 0x41bede
mov dword [esp], edi
call sub.msvcrt.dll_wcscat
jmp 0x4085df
mov dword [esp], str.LOADER:_failed_to_expand_environment_variables_in_the_runtime_tmpdir._n
call fcn.00402640
mov eax, dword [esp + 0x2c]
mov ebx, 0xffffffff
mov dword [esp], eax
call sub.msvcrt.dll_free
jmp 0x4086ee
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov dword [esp], str.LOADER:_runtime_tmpdir_points_to_non_existent_drive__ls__type:__d___n
call fcn.00402640
jmp 0x4088e4
mov dword [esp], 0x41bdd8
call fcn.00402640
jmp 0x4088e4
mov dword [esp], str.LOADER:_length_of_teporary_directory_path_exceeds_maximum_path_length__n
mov ebx, 0xffffffff
call fcn.00402640
mov edx, dword [esp + 0x24]
jmp 0x408774
mov dword [esp], str.LOADER:_failed_to_set_the_TMP_environment_variable._n
call fcn.00402640
jmp 0x4088e4
mov eax, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov dword [esp + 0x24], eax
jmp 0x40884d
mov dword [esp], str.LOADER:_failed_to_obtain_the_absolute_path_of_the_runtime_tmpdir._n
call fcn.00402640
jmp 0x4088e4