Function at 0x413650
Capabilities:
Check if file exists
Delete file
Get common file path
Move file
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x834
mov eax, dword [0x5023a4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x506568]
push ebx
mov ebx, ecx
mov dword [ebp - 0x834], ebx
push esi
push edi
test eax, eax
jne 0x41369b
push 0x20d0
call fcn.0049786c
add esp, 4
mov ecx, eax
call fcn.00414c70
mov ecx, eax
mov dword [0x506568], eax
mov edx, dword [eax]
call dword [edx]
mov eax, dword [0x506568]
mov edi, dword [sym.imp.KERNEL32.dll_DeleteFileW]
add eax, 4
push eax
call edi
cmp byte [ebx + 0x1c90], 0
je 0x4136be
lea eax, [ebx + 0x20c]
mov ecx, ebx
push eax
call fcn.00414a90
mov esi, dword [0x506568]
test esi, esi
jne 0x4136ed
push 0x20d0
call fcn.0049786c
add esp, 4
mov ecx, eax
call fcn.00414c70
mov ecx, eax
mov dword [0x506568], eax
mov edx, dword [eax]
call dword [edx]
mov esi, dword [0x506568]
add esi, 0x165c
cmp dword [esi + 0x14], 8
jb 0x4136fb
mov esi, dword [esi]
push 0x208
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.0049b560
add esp, 0xc
lea eax, [ebp - 0x620]
push 0x208
push 0
push eax
call fcn.0049b560
add esp, 0xc
lea eax, [ebp - 0x210]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov ebx, dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [ebp - 0x620]
push eax
push 0
push 0
lea eax, [ebp - 0x210]
push eax
call ebx
push esi
call edi
test eax, eax
jne 0x413824
lea eax, [ebp - 0x210]
push eax
push esi
call dword [sym.imp.SHLWAPI.dll_PathIsSameRootW]
test eax, eax
je 0x41379a
mov ebx, dword [sym.imp.KERNEL32.dll_MoveFileExW]
lea eax, [ebp - 0x620]
push 9
push eax
push esi
call ebx
test eax, eax
je 0x41378f
lea eax, [ebp - 0x620]
push eax
call edi
lea eax, [ebp - 0x620]
jmp 0x41381d
push 0x208
lea eax, [ebp - 0x418]
push 0
push eax
call fcn.0049b560
add esp, 0xc
lea eax, [ebp - 0x828]
push 0x208
push 0
push eax
call fcn.0049b560
add esp, 0xc
lea eax, [ebp - 0x418]
push esi
push eax
call dword [sym.imp.SHLWAPI.dll_StrCpyW]
lea eax, [ebp - 0x418]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [ebp - 0x828]
push eax
push 0
push 0x4dd7b8
lea eax, [ebp - 0x418]
push eax
call ebx
mov ebx, dword [sym.imp.KERNEL32.dll_MoveFileExW]
lea eax, [ebp - 0x828]
push 9
push eax
push esi
call ebx
test eax, eax
je 0x413817
lea eax, [ebp - 0x828]
push eax
call edi
lea eax, [ebp - 0x828]
push 0xc
push 0
push eax
call ebx
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
push 0x208
lea eax, [ebp - 0x418]
push 0
push eax
call fcn.0049b560
add esp, 0xc
lea eax, [ebp - 0x210]
push 0x208
push 0
push eax
call fcn.0049b560
mov esi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea eax, [ebp - 0x418]
add esp, 0xc
push 0x104
push eax
push str._appdata_GamePP
call esi
push 0x104
lea eax, [ebp - 0x210]
push eax
push str._localappdata_GamePP
call esi
xor ebx, ebx
call fcn.004031c0
test eax, eax
je 0x413985
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x82c], eax
call fcn.004031c0
test eax, eax
je 0x413985
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
push dword [ebx + 0x4d9e4c]
add eax, 0x10
mov dword [ebp - 0x830], eax
lea eax, [ebp - 0x418]
push eax
lea eax, [ebp - 0x82c]
push 0x4dc0d4
push eax
call fcn.004040c0
push dword [ebx + 0x4d9e4c]
lea eax, [ebp - 0x210]
push eax
lea eax, [ebp - 0x830]
push 0x4dc0d4
push eax
call fcn.004040c0
mov edi, dword [ebp - 0x82c]
add esp, 0x20
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov esi, dword [ebp - 0x830]
test eax, eax
je 0x41392d
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x41392d
mov ecx, dword [ebp - 0x834]
push esi
push edi
call fcn.004121d0
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x413945
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
add edi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x41395d
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
add ebx, 4
cmp ebx, 0x1c
jb 0x413885
mov ecx, dword [ebp - 0x834]
call fcn.00415cb0
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0049765c
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00402f10
int3