Function at 0x41ca23
Capabilities:
Check if file exists
Get common file path
Query environment variable

Disassembly:
push 0x684
mov eax, 0x593cfe
call fcn.005663f8
mov esi, dword [ebp + 8]
mov dword [ebp - 0x690], esi
xor ebx, ebx
mov dword [ebp - 4], ebx
cmp dword [ebp + 0x1c], ebx
jne 0x41ca56
push 0x612278
mov ecx, esi
call fcn.00401650
jmp 0x41d1b7
push 0x598760
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41caa6
push 0x208
lea eax, [ebp - 0x218]
push ebx
push eax
call fcn.0056c410
push ebx
push 0x26
lea eax, [ebp - 0x218]
push eax
push ebx
call fcn.0041d6bc
lea eax, [ebp - 0x218]
push 0x613124
push eax
call fcn.00577ffb
add esp, 0x24
lea eax, [ebp - 0x218]
push eax
jmp 0x41ca4a
push 0x598768
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41cace
push 0x208
lea eax, [ebp - 0x218]
push ebx
push eax
call fcn.0056c410
push ebx
push 5
jmp 0x41ca7c
push str.desktop
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41cb0a
push ebx
push ebx
lea eax, [ebp - 0x62c]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [ebp - 0x62c]
push 0x613124
push eax
call fcn.00577ffb
pop ecx
pop ecx
lea eax, [ebp - 0x62c]
jmp 0x41caa3
push 0x598780
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41cb20
push ebx
push 6
jmp 0x41cae1
push str.program
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41cbae
mov edi, 0x208
lea eax, [ebp - 0x218]
push edi
push ebx
push eax
call fcn.0056c410
push ebx
push 0x26
lea eax, [ebp - 0x218]
push eax
push ebx
call fcn.0041d6bc
lea eax, [ebp - 0x218]
push eax
call fcn.0057808e
add esp, 0x20
cmp eax, 3
jl 0x41ca9d
push edi
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.0056c410
push 3
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x62c]
push eax
call fcn.0057a230
lea eax, [ebp - 0x62c]
push str.Program_Files_
push eax
call fcn.00577ffb
add esp, 0x20
lea eax, [ebp - 0x62c]
jmp 0x41caa3
push str.curr
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41cbff
push 0x208
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.0056c410
add esp, 0xc
lea eax, [ebp - 0x62c]
push 0x104
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x62c]
push 0x5c
push eax
call fcn.0056c91a
pop ecx
pop ecx
xor ecx, ecx
mov word [eax + 2], cx
jmp 0x41cba3
push str.temp
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41ccc9
mov edi, 0x208
lea eax, [ebp - 0x218]
push edi
push ebx
push eax
call fcn.0056c410
push edi
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.0056c410
add esp, 0x18
call fcn.0041d33b
test al, al
je 0x41cc74
push ebx
push 0x1c
lea eax, [ebp - 0x218]
push eax
push ebx
call fcn.0041d6bc
add esp, 0x10
test eax, eax
je 0x41ca9d
push str.Temp_
lea eax, [ebp - 0x218]
push eax
call fcn.00577ffb
pop ecx
pop ecx
jmp 0x41ca9d
lea eax, [ebp - 0x62c]
mov edi, 0x104
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push edi
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x62c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
lea eax, [ebp - 0x218]
push eax
call fcn.0057808e
pop ecx
test eax, eax
jne 0x41ca9d
push edi
lea eax, [ebp - 0x218]
push eax
push str.TEMP
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
jmp 0x41ca9d
push str.recirle
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41cd04
push 0x208
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.0056c410
push ebx
push 0xa
lea eax, [ebp - 0x62c]
push eax
push ebx
call fcn.0041d6bc
add esp, 0x1c
jmp 0x41cba3
push str.downloads
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41cdab
push 0x208
lea eax, [ebp - 0x218]
push ebx
push eax
call fcn.0056c410
push ebx
push 0x10
lea eax, [ebp - 0x218]
push eax
push ebx
call fcn.0041d6bc
lea eax, [ebp - 0x218]
push eax
call fcn.0057808e
add esp, 0x20
test eax, eax
lea eax, [ebp - 0x218]
je 0x41cd7b
push 0x5c
push eax
call fcn.0056c91a
xor ecx, ecx
push 0x598810
mov word [eax + 2], cx
lea eax, [ebp - 0x218]
push eax
call fcn.00577ffb
add esp, 0x10
jmp 0x41ca9d
push 0x104
push eax
push 0x598828
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x218]
push eax
call fcn.0057808e
pop ecx
test eax, eax
je 0x41ca9d
push str.Downloads_
jmp 0x41cc61
xor eax, eax
mov dword [ebp - 0x64c], ebx
mov dword [ebp - 0x648], 7
mov word [ebp - 0x65c], ax
push 0x208
lea eax, [ebp - 0x420]
mov byte [ebp - 4], 1
push ebx
push eax
call fcn.0056c410
add esp, 0xc
lea eax, [ebp - 0x420]
push 0x104
push eax
push 0x598828
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x420]
push str.AppDataLocalLow_
push eax
call fcn.00577ffb
lea eax, [ebp - 0x420]
push eax
call fcn.0057808e
add esp, 0xc
lea ecx, [ebp - 0x65c]
push eax
lea eax, [ebp - 0x420]
push eax
call fcn.00401730
push str.locallow
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41cedc
push ebx
push 0x1a
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0041d6bc
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp - 0x420]
push eax
lea ecx, [ebp - 0x644]
call fcn.00401650
push str.LocalLow
lea ecx, [ebp - 0x68c]
mov byte [ebp - 4], 2
call fcn.00401650
push str.Roaming
lea ecx, [ebp - 0x674]
mov byte [ebp - 4], 3
call fcn.00401650
lea eax, [ebp - 0x68c]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x674]
push eax
lea eax, [ebp - 0x644]
push eax
call fcn.00412213
add esp, 0xc
lea ecx, [ebp - 0x674]
call fcn.004015f0
lea ecx, [ebp - 0x68c]
mov byte [ebp - 4], 2
call fcn.004015f0
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
jmp 0x41d112
push str.roaming
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
jne 0x41d039
push str.Roaming
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
jne 0x41d039
push str.local
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41cfcd
push ebx
push 0x1c
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0041d6bc
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea eax, [ebp - 0x420]
push eax
call edi
test eax, eax
jne 0x41d06c
lea eax, [ebp - 0x65c]
mov dword [ebp - 0x634], ebx
push eax
lea ecx, [ebp - 0x644]
mov dword [ebp - 0x630], ebx
call fcn.00403280
push str.Local
lea ecx, [ebp - 0x674]
mov byte [ebp - 4], 8
call fcn.00401650
push str.LocalLow
lea ecx, [ebp - 0x68c]
mov byte [ebp - 4], 9
call fcn.00401650
lea eax, [ebp - 0x674]
mov byte [ebp - 4], 0xa
push eax
lea eax, [ebp - 0x68c]
push eax
lea eax, [ebp - 0x644]
push eax
call fcn.00412213
add esp, 0xc
lea ecx, [ebp - 0x68c]
call fcn.004015f0
mov byte [ebp - 4], 8
jmp 0x41d107
push str.system
lea ecx, [ebp + 0xc]
call fcn.00412ae9
test al, al
je 0x41d017
push ebx
push 0x29
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0041d6bc
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea eax, [ebp - 0x420]
push eax
call edi
test eax, eax
je 0x41d14e
jmp 0x41d06c
lea eax, [ebp + 0xc]
mov byte [ebp - 0x690], bl
mov ecx, esi
push dword [ebp - 0x690]
mov dword [esi + 0x14], ebx
push eax
mov dword [esi + 0x10], ebx
call fcn.004033b0
jmp 0x41d1ac
push ebx
push 0x1a
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0041d6bc
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea eax, [ebp - 0x420]
push eax
call edi
test eax, eax
je 0x41d091
lea eax, [ebp - 0x420]
push eax
call fcn.0057808e
pop ecx
push eax
lea eax, [ebp - 0x420]
push eax
lea ecx, [ebp - 0x65c]
call fcn.00401730
jmp 0x41d14e
lea eax, [ebp - 0x65c]
mov dword [ebp - 0x634], ebx
push eax
lea ecx, [ebp - 0x644]
mov dword [ebp - 0x630], ebx
call fcn.00403280
push str.Roaming
lea ecx, [ebp - 0x674]
mov byte [ebp - 4], 5
call fcn.00401650
push str.LocalLow
lea ecx, [ebp - 0x68c]
mov byte [ebp - 4], 6
call fcn.00401650
lea eax, [ebp - 0x674]
mov byte [ebp - 4], 7
push eax
lea eax, [ebp - 0x68c]
push eax
lea eax, [ebp - 0x644]
push eax
call fcn.00412213
add esp, 0xc
lea ecx, [ebp - 0x68c]
call fcn.004015f0
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x674]
call fcn.004015f0
cmp dword [ebp - 0x630], 8
lea eax, [ebp - 0x644]
cmovae eax, dword [ebp - 0x644]
push eax
call edi
test eax, eax
je 0x41d13f
lea eax, [ebp - 0x644]
push eax
lea ecx, [ebp - 0x65c]
call fcn.00406fd0
lea ecx, [ebp - 0x644]
mov byte [ebp - 4], 1
call fcn.004015f0
cmp dword [ebp - 0x648], 8
lea eax, [ebp - 0x65c]
cmovae eax, dword [ebp - 0x65c]
push eax
call edi
test eax, eax
je 0x41d1a0
push ebx
push str.system32
lea ecx, [ebp - 0x65c]
call fcn.00406f80
cmp eax, 0xffffffff
jne 0x41d1a0
push ebx
push str.systemprofile
lea ecx, [ebp - 0x65c]
call fcn.00406f80
cmp eax, 0xffffffff
jne 0x41d1a0
lea eax, [ebp - 0x65c]
jmp 0x41d01a
push 0x612278
mov ecx, esi
call fcn.00401650
lea ecx, [ebp - 0x65c]
call fcn.004015f0
lea ecx, [ebp + 0xc]
call fcn.004015f0
mov eax, esi
call fcn.005663b3
ret