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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43bf22
mov eax, dword fs:[0]
push eax
mov eax, 0x20468
call fcn.00426590
mov eax, dword [0x4b249c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x2045c], ecx
lea eax, [ebp - 0x2044c]
push eax
mov ecx, dword [ebp - 0x2045c]
call fcn.0041fc00
mov dword [ebp - 0x20460], eax
mov ecx, dword [ebp - 0x20460]
mov dword [ebp - 0x20464], ecx
mov dword [ebp - 4], 0
mov edx, dword [ebp - 0x20464]
push edx
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x28
call fcn.0040d2f0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2044c]
call fcn.00403cf0
lea eax, [ebp - 0x20450]
push eax
mov ecx, dword [ebp - 0x2045c]
call fcn.0041fd80
mov dword [ebp - 0x20468], eax
mov ecx, dword [ebp - 0x20468]
mov dword [ebp - 0x2046c], ecx
mov dword [ebp - 4], 1
mov edx, dword [ebp - 0x2046c]
push edx
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x30
call fcn.0040d2f0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x20450]
call fcn.00403cf0
mov eax, dword [ebp - 0x2045c]
add eax, 0x28
push eax
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x2c
call fcn.0040d2f0
push 0x442c94
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x2c
call fcn.00421e20
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x28
push ecx
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x34
call fcn.0040d2f0
push str.SetupUI_
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x34
call fcn.00421e20
push 0x442d10
call fcn.0040de50
add esp, 4
test eax, eax
jne 0x41ff7c
mov edx, dword [ebp - 0x2045c]
mov eax, dword [edx + 0x28]
push eax
push str.Work_Directory_____s
mov ecx, dword [ebp - 0x2045c]
push ecx
push 0x442d80
call fcn.0040e820
add esp, 8
push eax
call fcn.0041ada0
add esp, 0xc
push 0x442df0
call fcn.0040de50
add esp, 4
test eax, eax
jne 0x41ffb9
mov edx, dword [ebp - 0x2045c]
mov eax, dword [edx + 0x2c]
push eax
push str.UI_Directory_____s
mov ecx, dword [ebp - 0x2045c]
push ecx
push 0x442e40
call fcn.0040e820
add esp, 8
push eax
call fcn.0041ada0
add esp, 0xc
push 0x442eb8
call fcn.0040de50
add esp, 4
test eax, eax
jne 0x41fff6
mov edx, dword [ebp - 0x2045c]
mov eax, dword [edx + 0x30]
push eax
push str.XAR_Directory_____s
mov ecx, dword [ebp - 0x2045c]
push ecx
push 0x442f08
call fcn.0040e820
add esp, 8
push eax
call fcn.0041ada0
add esp, 0xc
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x28
call fcn.004053b0
push eax
push str.workdir
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x2c
call fcn.004053b0
push eax
push str.uidir
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x30
call fcn.004053b0
push eax
push str.xardir
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, dword [ebp - 0x2045c]
add ecx, 0x34
call fcn.004053b0
push eax
push str.xluedir
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push 0
lea edx, [ebp - 0x10034]
push edx
call fcn.00401490
add esp, 8
mov dword [ebp - 4], 2
lea ecx, [ebp - 0x10034]
call fcn.004053b0
push eax
push str.public_home
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x20454], esp
mov eax, dword [ebp - 0x2045c]
mov edx, dword [eax + 0x28]
push edx
call fcn.00405190
mov dword [ebp - 0x20470], eax
call fcn.00402220
add esp, 0x1c
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x20458], esp
mov eax, dword [ebp - 0x2045c]
mov edx, dword [eax + 0x2c]
push edx
call fcn.00405190
mov dword [ebp - 0x20474], eax
call fcn.00402220
add esp, 0x1c
xor eax, eax
mov word [ebp - 0x10014], ax
push 0xfffe
push 0
lea ecx, [ebp - 0x10012]
push ecx
call fcn.00426300
add esp, 0xc
push 0x8000
lea edx, [ebp - 0x10014]
push edx
push 0x442eac
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov eax, dword [ebp - 0x2045c]
mov ecx, dword [eax + 0x28]
push ecx
lea edx, [ebp - 0x10014]
push edx
call dword [sym.imp.SHLWAPI.dll_StrStrIW]
test eax, eax
jne 0x4201f4
xor eax, eax
mov word [ebp - 0x20034], ax
push 0xfffe
push 0
lea ecx, [ebp - 0x20032]
push ecx
call fcn.00426300
add esp, 0xc
lea edx, [ebp - 0x10014]
push edx
mov eax, dword [ebp - 0x2045c]
mov ecx, dword [eax + 0x28]
push ecx
push str._s__s
push 0xffffffffffffffff
push 0x8000
lea edx, [ebp - 0x20034]
push edx
call fcn.004262dd
add esp, 0x18
push 0x442fb0
call fcn.0040de50
add esp, 4
test eax, eax
jne 0x4201e2
push 1
lea eax, [ebp - 0x20034]
push eax
push str.___GetEnvironmentVariable_:
mov ecx, dword [ebp - 0x2045c]
mov edx, dword [ecx + 0x28]
push edx
push str._AddEnvironmentVariable_:
mov eax, dword [ebp - 0x2045c]
push eax
push str.CKKPSetupEnvironment::InitWorkDir
call fcn.0040e820
add esp, 8
mov ecx, eax
call fcn.0040d970
mov ecx, eax
call fcn.0041adf0
mov ecx, eax
call fcn.0040d970
mov ecx, eax
call fcn.0041adf0
mov ecx, eax
call fcn.0040de00
lea ecx, [ebp - 0x20034]
push ecx
push 0x442ff4
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
xor edx, edx
mov word [ebp - 0x20444], dx
push 0x40e
push 0
lea eax, [ebp - 0x20442]
push eax
call fcn.00426300
add esp, 0xc
push 0x208
lea ecx, [ebp - 0x20444]
push ecx
push str._CommonProgramFiles_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea edx, [ebp - 0x20444]
push edx
call fcn.00426a1b
add esp, 4
test eax, eax
je 0x42024e
lea eax, [ebp - 0x20444]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x420288
lea ecx, [ebp - 0x20444]
push ecx
push 0
push 0
push 0x2b
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov dword [ebp - 0x20448], eax
lea edx, [ebp - 0x20444]
push edx
call dword [sym.imp.SHLWAPI.dll_PathRemoveBackslashW]
lea eax, [ebp - 0x20444]
push eax
push str.CommonProgramFiles
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push 0x4430b8
lea ecx, [ebp - 0x10030]
call fcn.00405190
mov byte [ebp - 4], 3
push 0x4430bc
lea ecx, [ebp - 0x10030]
call fcn.00405250
lea ecx, [ebp - 0x10030]
call fcn.004052b0
push eax
push 0x4430c0
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x10030]
call fcn.00405210
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x10034]
call fcn.00403cf0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0042624f
mov esp, ebp
pop ebp
ret