Function at 0x408440
Capabilities:
Get common file path
Query environment variable

Disassembly:
sub esp, 0x670
mov eax, dword [0x828208]
xor eax, esp
mov dword [esp + 0x668], eax
push ebx
push esi
push edi
push 0x105
lea eax, [esp + 0x14c]
mov edi, edx
push 0
push eax
mov esi, ecx
call fcn.0048ff50
add esp, 0xc
lea eax, [esp + 0x40]
push 0x105
push 0
push eax
call fcn.0048ff50
mov eax, dword [0x4dae5c]
add esp, 0xc
movq xmm0, qword [str.LOCALAPPDATA]
mov ebx, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov dword [esp + 0x2c], eax
movzx eax, byte [0x4dae60]
mov byte [esp + 0x30], al
mov eax, dword [str.temp]
mov dword [esp + 0x10], eax
movzx eax, byte [0x4dae68]
mov byte [esp + 0x14], al
lea eax, [esp + 0x148]
push 0x105
push eax
lea eax, [esp + 0x2c]
movq qword [esp + 0x2c], xmm0
push eax
call ebx
test eax, eax
je 0x4086ff
movzx eax, byte [0x4daddc]
movq xmm0, qword [str.USERNAME]
push 0x105
mov byte [esp + 0x24], al
lea eax, [esp + 0x464]
push 0
push eax
movq qword [esp + 0x24], xmm0
call fcn.0048ff50
mov eax, dword [0x4dade8]
add esp, 0xc
movq xmm0, qword [str.SystemDrive]
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x568]
movq qword [esp + 0x34], xmm0
push 0x105
push 0
push eax
call fcn.0048ff50
movzx eax, byte [0x4dadf4]
add esp, 0xc
movq xmm0, qword [str.system32]
mov byte [esp + 0x258], al
lea eax, [esp + 0x259]
movq qword [esp + 0x250], xmm0
push 0xfc
push 0
push eax
call fcn.0048ff50
add esp, 0xc
lea eax, [esp + 0x358]
push 0x105
push 0
push eax
call fcn.0048ff50
add esp, 0xc
lea eax, [esp + 0x148]
push eax
lea eax, [esp + 0x35c]
push 0x4dadf8
push eax
call fcn.00402130
add esp, 0xc
lea eax, [esp + 0x358]
push eax
call fcn.0049d0ac
add esp, 4
lea eax, [esp + 0x148]
push eax
lea eax, [esp + 0x44]
push 0x4dadf8
push eax
call fcn.00402130
add esp, 0xc
lea eax, [esp + 0x148]
push 0x20
push eax
call fcn.0048f4b0
add esp, 8
test eax, eax
jne 0x408602
lea eax, [esp + 0x250]
push eax
lea eax, [esp + 0x35c]
push eax
call fcn.0048f240
add esp, 8
test eax, eax
je 0x408663
push str.Finalize_path_detected_a_space_or_system32_in_the_path
push 0
call fcn.0040abf0
add esp, 8
lea eax, [esp + 0x460]
push 0x105
push eax
lea eax, [esp + 0x20]
push eax
call ebx
test eax, eax
je 0x408663
push 0x105
lea eax, [esp + 0x56c]
push eax
lea eax, [esp + 0x3c]
push eax
call ebx
test eax, eax
je 0x408663
lea eax, [esp + 0x460]
push eax
lea eax, [esp + 0x56c]
push eax
lea eax, [esp + 0x48]
push str._sUsers_sAppDataLocal_
push eax
call fcn.00402130
add esp, 0x10
lea eax, [esp + 0x40]
push eax
lea eax, [esp + 0x14c]
push eax
push str.After_Finalizing_the_path_LocalAppDataPath___s_and_TempFolderPath_s__n
push 0
call fcn.0040abf0
add esp, 0x10
test edi, edi
jne 0x4086a8
mov eax, dword [0x8483c4]
push dword [eax + 0x10]
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x48]
push eax
push 0x4daeb8
push esi
call fcn.00402130
add esp, 0x14
jmp 0x4087f3
mov ecx, 0x4da4c2
mov eax, edi
nop
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4086d0
test dl, dl
je 0x4086cc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4086d0
add eax, 2
add ecx, 2
test dl, dl
jne 0x4086b0
xor eax, eax
jmp 0x4086d5
sbb eax, eax
or eax, 1
test eax, eax
mov eax, dword [0x8483c4]
je 0x408688
push edi
push dword [eax + 0x10]
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x4c]
push eax
push str._s_s_s_s
push esi
call fcn.00402130
add esp, 0x18
jmp 0x4087f3
lea eax, [esp + 0x40]
push eax
push 0x100
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x40877c
test edi, edi
jne 0x40872e
mov eax, dword [0x8483c4]
push dword [eax + 0x10]
lea eax, [esp + 0x44]
push eax
push str._s_s
jmp 0x4087ea
mov ecx, 0x4da4c2
mov eax, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x408755
test dl, dl
je 0x408751
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x408755
add eax, 2
add ecx, 2
test dl, dl
jne 0x408735
xor eax, eax
jmp 0x40875a
sbb eax, eax
or eax, 1
test eax, eax
mov eax, dword [0x8483c4]
je 0x40871c
push edi
push dword [eax + 0x10]
lea eax, [esp + 0x48]
push eax
push str._s_s_s
push esi
call fcn.00402130
add esp, 0x14
jmp 0x4087f3
test edi, edi
jne 0x408798
mov eax, dword [0x8483c4]
mov ecx, dword [eax + 0x10]
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [esi], al
lea esi, [esi + 1]
test al, al
jne 0x408788
jmp 0x4087f3
mov ecx, 0x4da4c2
mov eax, edi
nop
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4087c0
test dl, dl
je 0x4087bc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4087c0
add eax, 2
add ecx, 2
test dl, dl
jne 0x4087a0
xor eax, eax
jmp 0x4087c5
sbb eax, eax
or eax, 1
test eax, eax
mov eax, dword [0x8483c4]
jne 0x4087e1
mov ecx, dword [eax + 0x10]
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [esi], al
lea esi, [esi + 1]
test al, al
jne 0x4087d1
jmp 0x4087f3
push edi
push dword [eax + 0x10]
push 0x4dad74
push esi
call fcn.00402130
add esp, 0x10
mov ecx, dword [esp + 0x674]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0048980e
add esp, 0x670
ret