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

Disassembly:
push 0x6b4
mov eax, 0x58559c
call fcn.0057ecf2
mov esi, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 0x6c0], ebx
mov dword [ebp - 4], ebx
cmp dword [ebp + 0x1c], ebx
jne 0x41ca84
push 0x5ff384
mov ecx, esi
call fcn.00403100
jmp 0x41d3b2
push 0x5879f8
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41cad4
push 0x208
lea eax, [ebp - 0x420]
push ebx
push eax
call fcn.0042d010
push ebx
push 0x26
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0041dd2d
lea eax, [ebp - 0x420]
push 0x5ff67c
push eax
call fcn.0043a1de
add esp, 0x24
lea eax, [ebp - 0x420]
push eax
jmp 0x41ca78
push 0x587a00
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41cafc
push 0x208
lea eax, [ebp - 0x420]
push ebx
push eax
call fcn.0042d010
push ebx
push 5
jmp 0x41caaa
push str.desktop
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41cb38
push ebx
push ebx
lea eax, [ebp - 0x62c]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [ebp - 0x62c]
push 0x5ff67c
push eax
call fcn.0043a1de
pop ecx
pop ecx
lea eax, [ebp - 0x62c]
jmp 0x41cad1
push 0x587a18
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41cb4e
push ebx
push 6
jmp 0x41cb0f
push str.program
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41cbdc
mov edi, 0x208
lea eax, [ebp - 0x420]
push edi
push ebx
push eax
call fcn.0042d010
push ebx
push 0x26
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0041dd2d
lea eax, [ebp - 0x420]
push eax
call fcn.00439df5
add esp, 0x20
cmp eax, 3
jl 0x41cacb
push edi
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.0042d010
push 3
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x62c]
push eax
call fcn.0043a20f
lea eax, [ebp - 0x62c]
push str.Program_Files_
push eax
call fcn.0043a1de
add esp, 0x20
lea eax, [ebp - 0x62c]
jmp 0x41cad1
push str.curr
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41cc2d
push 0x208
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.0042d010
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.0042c1be
pop ecx
pop ecx
xor ecx, ecx
mov word [eax + 2], cx
jmp 0x41cbd1
push str.temp
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41ccf7
mov edi, 0x208
lea eax, [ebp - 0x420]
push edi
push ebx
push eax
call fcn.0042d010
push edi
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.0042d010
add esp, 0x18
call fcn.0041d6f2
test al, al
je 0x41cca2
push ebx
push 0x1c
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0041dd2d
add esp, 0x10
test eax, eax
je 0x41cacb
push str.Temp_
lea eax, [ebp - 0x420]
push eax
call fcn.0043a1de
pop ecx
pop ecx
jmp 0x41cacb
lea eax, [ebp - 0x62c]
mov edi, 0x104
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push edi
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x62c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
lea eax, [ebp - 0x420]
push eax
call fcn.00439df5
pop ecx
test eax, eax
jne 0x41cacb
push edi
lea eax, [ebp - 0x420]
push eax
push str.TEMP
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
jmp 0x41cacb
push str.recirle
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41cd32
push 0x208
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.0042d010
push ebx
push 0xa
lea eax, [ebp - 0x62c]
push eax
push ebx
call fcn.0041dd2d
add esp, 0x1c
jmp 0x41cbd1
push str.downloads
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41cdd9
push 0x208
lea eax, [ebp - 0x420]
push ebx
push eax
call fcn.0042d010
push ebx
push 0x10
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0041dd2d
lea eax, [ebp - 0x420]
push eax
call fcn.00439df5
add esp, 0x20
test eax, eax
lea eax, [ebp - 0x420]
je 0x41cda9
push 0x5c
push eax
call fcn.0042c1be
xor ecx, ecx
push 0x587aa8
mov word [eax + 2], cx
lea eax, [ebp - 0x420]
push eax
call fcn.0043a1de
add esp, 0x10
jmp 0x41cacb
push 0x104
push eax
push str.USERPROFILE
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x420]
push eax
call fcn.00439df5
pop ecx
test eax, eax
je 0x41cacb
push str.Downloads_
jmp 0x41cc8f
xor eax, eax
mov dword [ebp - 0x630], 7
mov dword [ebp - 0x634], ebx
mov word [ebp - 0x644], ax
push 0x208
lea eax, [ebp - 0x218]
mov byte [ebp - 4], 1
push ebx
push eax
call fcn.0042d010
add esp, 0xc
lea eax, [ebp - 0x218]
push 0x104
push eax
push str.USERPROFILE
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x218]
push str.AppDataLocalLow_
push eax
call fcn.0043a1de
cmp word [ebp - 0x218], 0
pop ecx
pop ecx
jne 0x41ce43
mov eax, ebx
jmp 0x41ce50
lea eax, [ebp - 0x218]
push eax
call fcn.00439df5
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x644]
call fcn.00403620
push str.locallow
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41cfc6
push ebx
push 0x1a
lea eax, [ebp - 0x218]
push eax
push ebx
call fcn.0041dd2d
add esp, 0x10
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
push 7
xor eax, eax
mov dword [ebp - 0x67c], ebx
pop edi
mov dword [ebp - 0x678], edi
mov word [ebp - 0x68c], ax
cmp word [ebp - 0x218], ax
jne 0x41cebd
mov eax, ebx
jmp 0x41ceca
lea eax, [ebp - 0x218]
push eax
call fcn.00439df5
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x68c]
call fcn.00403620
mov dword [ebp - 0x664], ebx
xor eax, eax
mov ebx, str.LocalLow
mov byte [ebp - 4], 2
push ebx
mov dword [ebp - 0x660], edi
mov word [ebp - 0x674], ax
call fcn.00439df5
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x674]
call fcn.00403620
and dword [ebp - 0x64c], 0
xor eax, eax
mov ebx, str.Roaming
mov byte [ebp - 4], 3
push ebx
mov dword [ebp - 0x648], edi
mov word [ebp - 0x65c], ax
call fcn.00439df5
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x65c]
call fcn.00403620
lea eax, [ebp - 0x674]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x65c]
push eax
lea eax, [ebp - 0x68c]
push eax
call fcn.00421bd3
add esp, 0xc
lea ecx, [ebp - 0x65c]
xor ebx, ebx
push ebx
push 1
call fcn.004038c0
push ebx
push 1
lea ecx, [ebp - 0x674]
mov byte [ebp - 4], 2
call fcn.004038c0
cmp dword [ebp - 0x678], 8
lea eax, [ebp - 0x68c]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmovae eax, dword [ebp - 0x68c]
push eax
call edi
test eax, eax
je 0x41cfbb
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0x68c]
push eax
lea ecx, [ebp - 0x644]
call fcn.00403210
lea ecx, [ebp - 0x68c]
jmp 0x41d323
push str.roaming
lea ecx, [ebp + 0xc]
call fcn.00402b00
mov ebx, str.Roaming
test eax, eax
je 0x41d1c3
push ebx
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
je 0x41d1c3
push str.local
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41d14d
xor ebx, ebx
lea eax, [ebp - 0x218]
push ebx
push 0x1c
push eax
push ebx
call fcn.0041dd2d
add esp, 0x10
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea eax, [ebp - 0x218]
push eax
call edi
test eax, eax
jne 0x41d197
lea eax, [ebp - 0x644]
push eax
lea ecx, [ebp - 0x6a4]
call fcn.0040a5b0
mov dword [ebp - 0x64c], ebx
xor eax, eax
mov ebx, str.Local
mov byte [ebp - 4], 8
push ebx
mov dword [ebp - 0x648], 7
mov word [ebp - 0x65c], ax
call fcn.00439df5
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x65c]
call fcn.00403620
and dword [ebp - 0x664], 0
xor eax, eax
mov ebx, str.LocalLow
mov byte [ebp - 4], 9
push ebx
mov dword [ebp - 0x660], 7
mov word [ebp - 0x674], ax
call fcn.00439df5
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x674]
call fcn.00403620
lea eax, [ebp - 0x65c]
mov byte [ebp - 4], 0xa
push eax
lea eax, [ebp - 0x674]
push eax
lea eax, [ebp - 0x6a4]
push eax
call fcn.00421bd3
add esp, 0xc
lea ecx, [ebp - 0x674]
xor ebx, ebx
push ebx
push 1
call fcn.004038c0
push ebx
push 1
lea ecx, [ebp - 0x65c]
mov byte [ebp - 4], 8
call fcn.004038c0
cmp dword [ebp - 0x690], 8
lea eax, [ebp - 0x6a4]
cmovae eax, dword [ebp - 0x6a4]
push eax
call edi
test eax, eax
je 0x41d131
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0x6a4]
push eax
lea ecx, [ebp - 0x644]
call fcn.00403210
lea ecx, [ebp - 0x6a4]
jmp 0x41d323
lea eax, [ebp - 0x218]
push eax
call fcn.00439df5
jmp 0x41d216
push str.system
lea ecx, [ebp + 0xc]
call fcn.00402b00
test eax, eax
jne 0x41d1a2
xor ebx, ebx
lea eax, [ebp - 0x218]
push ebx
push 0x29
push eax
push ebx
call fcn.0041dd2d
add esp, 0x10
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea eax, [ebp - 0x218]
push eax
call edi
test eax, eax
je 0x41d32f
cmp word [ebp - 0x218], bx
jne 0x41d13c
jmp 0x41d204
lea eax, [ebp + 0xc]
mov ecx, esi
push eax
call fcn.0040a550
push 0
push 1
lea ecx, [ebp - 0x644]
call fcn.004038c0
push 0
jmp 0x41d3b3
push 0
push 0x1a
lea eax, [ebp - 0x218]
push eax
push 0
call fcn.0041dd2d
add esp, 0x10
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea eax, [ebp - 0x218]
push eax
call edi
test eax, eax
je 0x41d22f
cmp word [ebp - 0x218], 0
jne 0x41d208
xor ebx, ebx
mov eax, ebx
jmp 0x41d217
lea eax, [ebp - 0x218]
push eax
call fcn.00439df5
xor ebx, ebx
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x644]
call fcn.00403620
jmp 0x41d32f
lea eax, [ebp - 0x644]
push eax
lea ecx, [ebp - 0x6bc]
call fcn.0040a5b0
and dword [ebp - 0x64c], 0
xor eax, eax
push ebx
mov byte [ebp - 4], 5
mov dword [ebp - 0x648], 7
mov word [ebp - 0x65c], ax
call fcn.00439df5
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x65c]
call fcn.00403620
and dword [ebp - 0x664], 0
xor eax, eax
mov ebx, str.LocalLow
mov byte [ebp - 4], 6
push ebx
mov dword [ebp - 0x660], 7
mov word [ebp - 0x674], ax
call fcn.00439df5
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x674]
call fcn.00403620
lea eax, [ebp - 0x65c]
mov byte [ebp - 4], 7
push eax
lea eax, [ebp - 0x674]
push eax
lea eax, [ebp - 0x6bc]
push eax
call fcn.00421bd3
add esp, 0xc
lea ecx, [ebp - 0x674]
xor ebx, ebx
push ebx
push 1
call fcn.004038c0
push ebx
push 1
lea ecx, [ebp - 0x65c]
mov byte [ebp - 4], 5
call fcn.004038c0
cmp dword [ebp - 0x6a8], 8
lea eax, [ebp - 0x6bc]
cmovae eax, dword [ebp - 0x6bc]
push eax
call edi
test eax, eax
je 0x41d31d
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0x6bc]
push eax
lea ecx, [ebp - 0x644]
call fcn.00403210
lea ecx, [ebp - 0x6bc]
push ebx
push 1
mov byte [ebp - 4], 1
call fcn.004038c0
cmp dword [ebp - 0x630], 8
lea eax, [ebp - 0x644]
cmovae eax, dword [ebp - 0x644]
push eax
call edi
test eax, eax
je 0x41d398
mov edi, str.system32
push edi
call fcn.00439df5
pop ecx
push eax
push ebx
push edi
lea ecx, [ebp - 0x644]
call fcn.0041de1e
cmp eax, 0xffffffff
jne 0x41d398
mov edi, str.systemprofile
push edi
call fcn.00439df5
pop ecx
push eax
push ebx
push edi
lea ecx, [ebp - 0x644]
call fcn.0041de1e
cmp eax, 0xffffffff
jne 0x41d398
lea eax, [ebp - 0x644]
mov ecx, esi
push eax
call fcn.0040a550
jmp 0x41d3a4
push 0x5ff384
mov ecx, esi
call fcn.00403100
push ebx
push 1
lea ecx, [ebp - 0x644]
call fcn.004038c0
push ebx
push 1
lea ecx, [ebp + 0xc]
call fcn.004038c0
mov eax, esi
call fcn.0057ecad
ret