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

Disassembly:
push 0x6b0
mov eax, 0x5eba7e
call fcn.005ae057
mov esi, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 0x6bc], ebx
mov dword [ebp - 4], ebx
cmp dword [ebp + 0x1c], ebx
jne 0x5b05ea
push 0x694738
mov ecx, esi
call fcn.00402790
jmp 0x5b0e87
push 0x688058
lea ecx, [ebp + 0xc]
call fcn.004087e0
test eax, eax
jne 0x5b063a
push 0x208
lea eax, [ebp - 0x420]
push ebx
push eax
call fcn.005be3a0
push ebx
push 0x26
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.005b1a03
lea eax, [ebp - 0x420]
push 0x6947dc
push eax
call fcn.005c7787
add esp, 0x24
lea eax, [ebp - 0x420]
push eax
jmp 0x5b05de
push 0x688060
lea ecx, [ebp + 0xc]
call fcn.004087e0
test eax, eax
jne 0x5b0662
push 0x208
lea eax, [ebp - 0x420]
push ebx
push eax
call fcn.005be3a0
push ebx
push 5
jmp 0x5b0610
push str.program
lea ecx, [ebp + 0xc]
call fcn.004087e0
test eax, eax
jne 0x5b06ec
mov edi, 0x208
lea eax, [ebp - 0x420]
push edi
push ebx
push eax
call fcn.005be3a0
push ebx
push 0x26
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.005b1a03
lea eax, [ebp - 0x420]
push eax
call fcn.005c1d51
add esp, 0x20
cmp eax, 3
jl 0x5b0631
push edi
lea eax, [ebp - 0x628]
push ebx
push eax
call fcn.005be3a0
push 3
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x628]
push eax
call fcn.005d6336
lea eax, [ebp - 0x628]
push str.Program_Files_
push eax
call fcn.005c7787
add esp, 0x20
lea eax, [ebp - 0x628]
jmp 0x5b0637
push str.curr
lea ecx, [ebp + 0xc]
call fcn.004087e0
test eax, eax
jne 0x5b073d
push 0x208
lea eax, [ebp - 0x628]
push ebx
push eax
call fcn.005be3a0
add esp, 0xc
lea eax, [ebp - 0x628]
push 0x104
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x628]
push 0x5c
push eax
call fcn.005bff1b
pop ecx
pop ecx
xor ecx, ecx
mov word [eax + 2], cx
jmp 0x5b06e1
push str.temp
lea ecx, [ebp + 0xc]
call fcn.004087e0
test eax, eax
jne 0x5b0807
mov edi, 0x208
lea eax, [ebp - 0x420]
push edi
push ebx
push eax
call fcn.005be3a0
push edi
lea eax, [ebp - 0x628]
push ebx
push eax
call fcn.005be3a0
add esp, 0x18
call fcn.005b11c7
test al, al
je 0x5b07b2
push ebx
push 0x1c
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.005b1a03
add esp, 0x10
test eax, eax
je 0x5b0631
push str.Temp_
lea eax, [ebp - 0x420]
push eax
call fcn.005c7787
pop ecx
pop ecx
jmp 0x5b0631
lea eax, [ebp - 0x628]
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 - 0x628]
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
lea eax, [ebp - 0x420]
push eax
call fcn.005c1d51
pop ecx
test eax, eax
jne 0x5b0631
push edi
lea eax, [ebp - 0x420]
push eax
push str.TEMP
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
jmp 0x5b0631
push str.downloads
lea ecx, [ebp + 0xc]
call fcn.004087e0
test eax, eax
jne 0x5b08ae
push 0x208
lea eax, [ebp - 0x420]
push ebx
push eax
call fcn.005be3a0
push ebx
push 0x10
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.005b1a03
lea eax, [ebp - 0x420]
push eax
call fcn.005c1d51
add esp, 0x20
test eax, eax
lea eax, [ebp - 0x420]
je 0x5b087e
push 0x5c
push eax
call fcn.005bff1b
xor ecx, ecx
push 0x6880e0
mov word [eax + 2], cx
lea eax, [ebp - 0x420]
push eax
call fcn.005c7787
add esp, 0x10
jmp 0x5b0631
push 0x104
push eax
push str.USERPROFILE
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x420]
push eax
call fcn.005c1d51
pop ecx
test eax, eax
je 0x5b0631
push str.Downloads_
jmp 0x5b079f
xor eax, eax
mov dword [ebp - 0x62c], 7
mov dword [ebp - 0x630], ebx
mov word [ebp - 0x640], ax
push 0x208
lea eax, [ebp - 0x218]
mov byte [ebp - 4], 1
push ebx
push eax
call fcn.005be3a0
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.005c7787
cmp word [ebp - 0x218], 0
pop ecx
pop ecx
jne 0x5b0918
mov eax, ebx
jmp 0x5b0925
lea eax, [ebp - 0x218]
push eax
call fcn.005c1d51
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x640]
call fcn.004028f0
push str.locallow
lea ecx, [ebp + 0xc]
call fcn.004087e0
test eax, eax
jne 0x5b0a9b
push ebx
push 0x1a
lea eax, [ebp - 0x218]
push eax
push ebx
call fcn.005b1a03
add esp, 0x10
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
push 7
xor eax, eax
mov dword [ebp - 0x678], ebx
pop edi
mov dword [ebp - 0x674], edi
mov word [ebp - 0x688], ax
cmp word [ebp - 0x218], ax
jne 0x5b0992
mov eax, ebx
jmp 0x5b099f
lea eax, [ebp - 0x218]
push eax
call fcn.005c1d51
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x688]
call fcn.004028f0
mov dword [ebp - 0x660], ebx
xor eax, eax
mov ebx, str.LocalLow
mov byte [ebp - 4], 2
push ebx
mov dword [ebp - 0x65c], edi
mov word [ebp - 0x670], ax
call fcn.005c1d51
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x670]
call fcn.004028f0
and dword [ebp - 0x648], 0
xor eax, eax
mov ebx, str.Roaming
mov byte [ebp - 4], 3
push ebx
mov dword [ebp - 0x644], edi
mov word [ebp - 0x658], ax
call fcn.005c1d51
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x658]
call fcn.004028f0
lea eax, [ebp - 0x670]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x658]
push eax
lea eax, [ebp - 0x688]
push eax
call fcn.005b266e
add esp, 0xc
lea ecx, [ebp - 0x658]
xor ebx, ebx
push ebx
push 1
call fcn.00402830
push ebx
push 1
lea ecx, [ebp - 0x670]
mov byte [ebp - 4], 2
call fcn.00402830
cmp dword [ebp - 0x674], 8
lea eax, [ebp - 0x688]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmovae eax, dword [ebp - 0x688]
push eax
call edi
test eax, eax
je 0x5b0a90
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0x688]
push eax
lea ecx, [ebp - 0x640]
call fcn.00402b60
lea ecx, [ebp - 0x688]
jmp 0x5b0df8
push str.roaming
lea ecx, [ebp + 0xc]
call fcn.004087e0
mov ebx, str.Roaming
test eax, eax
je 0x5b0c98
push ebx
lea ecx, [ebp + 0xc]
call fcn.004087e0
test eax, eax
je 0x5b0c98
push str.local
lea ecx, [ebp + 0xc]
call fcn.004087e0
test eax, eax
jne 0x5b0c22
xor ebx, ebx
lea eax, [ebp - 0x218]
push ebx
push 0x1c
push eax
push ebx
call fcn.005b1a03
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 0x5b0c6c
lea eax, [ebp - 0x640]
push eax
lea ecx, [ebp - 0x6a0]
call fcn.00404450
mov dword [ebp - 0x648], ebx
xor eax, eax
mov ebx, str.Local
mov byte [ebp - 4], 8
push ebx
mov dword [ebp - 0x644], 7
mov word [ebp - 0x658], ax
call fcn.005c1d51
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x658]
call fcn.004028f0
and dword [ebp - 0x660], 0
xor eax, eax
mov ebx, str.LocalLow
mov byte [ebp - 4], 9
push ebx
mov dword [ebp - 0x65c], 7
mov word [ebp - 0x670], ax
call fcn.005c1d51
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x670]
call fcn.004028f0
lea eax, [ebp - 0x658]
mov byte [ebp - 4], 0xa
push eax
lea eax, [ebp - 0x670]
push eax
lea eax, [ebp - 0x6a0]
push eax
call fcn.005b266e
add esp, 0xc
lea ecx, [ebp - 0x670]
xor ebx, ebx
push ebx
push 1
call fcn.00402830
push ebx
push 1
lea ecx, [ebp - 0x658]
mov byte [ebp - 4], 8
call fcn.00402830
cmp dword [ebp - 0x68c], 8
lea eax, [ebp - 0x6a0]
cmovae eax, dword [ebp - 0x6a0]
push eax
call edi
test eax, eax
je 0x5b0c06
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0x6a0]
push eax
lea ecx, [ebp - 0x640]
call fcn.00402b60
lea ecx, [ebp - 0x6a0]
jmp 0x5b0df8
lea eax, [ebp - 0x218]
push eax
call fcn.005c1d51
jmp 0x5b0ceb
push str.system
lea ecx, [ebp + 0xc]
call fcn.004087e0
test eax, eax
jne 0x5b0c77
xor ebx, ebx
lea eax, [ebp - 0x218]
push ebx
push 0x29
push eax
push ebx
call fcn.005b1a03
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 0x5b0e04
cmp word [ebp - 0x218], bx
jne 0x5b0c11
jmp 0x5b0cd9
lea eax, [ebp + 0xc]
mov ecx, esi
push eax
call fcn.00404ab0
push 0
push 1
lea ecx, [ebp - 0x640]
call fcn.00402830
push 0
jmp 0x5b0e88
push 0
push 0x1a
lea eax, [ebp - 0x218]
push eax
push 0
call fcn.005b1a03
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 0x5b0d04
cmp word [ebp - 0x218], 0
jne 0x5b0cdd
xor ebx, ebx
mov eax, ebx
jmp 0x5b0cec
lea eax, [ebp - 0x218]
push eax
call fcn.005c1d51
xor ebx, ebx
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x640]
call fcn.004028f0
jmp 0x5b0e04
lea eax, [ebp - 0x640]
push eax
lea ecx, [ebp - 0x6b8]
call fcn.00404450
and dword [ebp - 0x648], 0
xor eax, eax
push ebx
mov byte [ebp - 4], 5
mov dword [ebp - 0x644], 7
mov word [ebp - 0x658], ax
call fcn.005c1d51
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x658]
call fcn.004028f0
and dword [ebp - 0x660], 0
xor eax, eax
mov ebx, str.LocalLow
mov byte [ebp - 4], 6
push ebx
mov dword [ebp - 0x65c], 7
mov word [ebp - 0x670], ax
call fcn.005c1d51
pop ecx
push eax
push ebx
lea ecx, [ebp - 0x670]
call fcn.004028f0
lea eax, [ebp - 0x658]
mov byte [ebp - 4], 7
push eax
lea eax, [ebp - 0x670]
push eax
lea eax, [ebp - 0x6b8]
push eax
call fcn.005b266e
add esp, 0xc
lea ecx, [ebp - 0x670]
xor ebx, ebx
push ebx
push 1
call fcn.00402830
push ebx
push 1
lea ecx, [ebp - 0x658]
mov byte [ebp - 4], 5
call fcn.00402830
cmp dword [ebp - 0x6a4], 8
lea eax, [ebp - 0x6b8]
cmovae eax, dword [ebp - 0x6b8]
push eax
call edi
test eax, eax
je 0x5b0df2
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0x6b8]
push eax
lea ecx, [ebp - 0x640]
call fcn.00402b60
lea ecx, [ebp - 0x6b8]
push ebx
push 1
mov byte [ebp - 4], 1
call fcn.00402830
cmp dword [ebp - 0x62c], 8
lea eax, [ebp - 0x640]
cmovae eax, dword [ebp - 0x640]
push eax
call edi
test eax, eax
je 0x5b0e6d
mov edi, str.system32
push edi
call fcn.005c1d51
pop ecx
push eax
push ebx
push edi
lea ecx, [ebp - 0x640]
call fcn.00405290
cmp eax, 0xffffffff
jne 0x5b0e6d
mov edi, str.systemprofile
push edi
call fcn.005c1d51
pop ecx
push eax
push ebx
push edi
lea ecx, [ebp - 0x640]
call fcn.00405290
cmp eax, 0xffffffff
jne 0x5b0e6d
lea eax, [ebp - 0x640]
mov ecx, esi
push eax
call fcn.00404ab0
jmp 0x5b0e79
push 0x694738
mov ecx, esi
call fcn.00402790
push ebx
push 1
lea ecx, [ebp - 0x640]
call fcn.00402830
push ebx
push 1
lea ecx, [ebp + 0xc]
call fcn.00402830
mov eax, esi
call fcn.005ae012
ret