Function at 0x413360
Capabilities:
Check if file exists
Copy file
Delete file
Get common file path
Move file

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x2e30
call fcn.00437cf0
mov eax, dword [0x4f2500]
xor eax, esp
mov dword [esp + 0x2e2c], eax
mov eax, dword [ebp + 8]
push esi
push edi
push str.SafeCopyFile2_Enter.
mov edi, ecx
push 0x1e1
mov dword [esp + 0x1c], eax
mov dword [esp + 0x14], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [0x4f6d14]
push eax
push str.ModuleAid.cpp
push 1
push ecx
mov eax, str.CModuleAidManger::SafeCopyFile2
call fcn.00403090
add esp, 0x18
test edi, edi
je 0x4137f0
test ebx, ebx
je 0x4137f0
push 0x800
lea edx, [esp + 0x181c]
push 0
push edx
call fcn.004276b0
add esp, 0xc
push 0x400
lea eax, [esp + 0x181c]
push ebx
push eax
call fcn.00425661
add esp, 0xc
lea ecx, [esp + 0x1818]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea edx, [esp + 0x1818]
push edx
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push 0x800
lea eax, [esp + 0x81c]
push 0
push eax
call fcn.004276b0
add esp, 0xc
lea ecx, [esp + 0x818]
push ecx
push 0x400
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push 0
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x41345c
mov esi, dword [sym.imp.KERNEL32.dll_MoveFileExW]
push 3
push ebx
push edi
call esi
test eax, eax
je 0x413477
mov eax, 1
pop edi
pop esi
mov ecx, dword [esp + 0x2e2c]
xor ecx, esp
call fcn.0042292e
mov esp, ebp
pop ebp
ret 4
push 0x800
lea edx, [esp + 0x101c]
push 0
push edx
call fcn.004276b0
add esp, 0xc
lea eax, [esp + 0x1018]
push eax
push 0
push str.gamepp
lea ecx, [esp + 0x824]
push ecx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x413789
xor edx, edx
push 0x206
push edx
lea eax, [esp + 0x2a2a]
push eax
mov word [esp + 0x2a2c], dx
call fcn.004276b0
lea edx, [esp + 0x2a2c]
add esp, 0xc
mov eax, ebx
sub edx, ebx
mov edi, edi
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4134e0
lea ecx, [esp + 0x2a20]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea edi, [esp + 0x2a20]
add edi, 0xfffffffe
jmp 0x413510
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x413510
mov edx, dword [0x4cb7dc]
push 0x800
lea eax, [esp + 0x201c]
push 0
push eax
mov dword [edi], edx
call fcn.004276b0
add esp, 0xc
xor ecx, ecx
push 0x206
push ecx
lea edx, [esp + 0x2c32]
push edx
mov word [esp + 0x2c34], cx
call fcn.004276b0
add esp, 0xc
lea eax, [esp + 0x2c28]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea ecx, [esp + 0x2018]
push ecx
push 0
push str.gamepp
lea edx, [esp + 0x2c34]
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [esp + 0x2018]
lea esi, [esp + 8]
call fcn.004032d0
lea eax, [esp + 0x2a20]
push eax
lea ecx, [esp + 0x2c2c]
push ecx
mov edx, esi
push edx
call fcn.00410490
mov edi, dword [esp + 8]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_MoveFileW]
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0x2822]
push ecx
mov word [esp + 0x2824], ax
call fcn.004276b0
lea ecx, [esp + 0x2824]
add esp, 0xc
mov eax, ebx
sub ecx, ebx
lea ebx, [ebx]
movzx edx, word [eax]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x4135f0
lea edx, [esp + 0x2818]
push edx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [esp + 0x2818]
add eax, 0xfffffffe
jmp 0x413620
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x413620
mov ecx, dword [str.Temp_]
mov edx, dword [0x4cf344]
mov dword [eax], ecx
mov ecx, dword [0x4cf348]
mov dword [eax + 4], edx
mov dx, word [0x4cf34c]
mov dword [eax + 8], ecx
mov word [eax + 0xc], dx
lea eax, [esp + 0x1018]
lea esi, [esp + 0x10]
call fcn.004032d0
lea eax, [esp + 0x2818]
push eax
lea ecx, [esp + 0x81c]
push ecx
mov edx, esi
push edx
call fcn.00410490
push 0x800
lea eax, [esp + 0x1c]
push 0
push eax
call fcn.004276b0
mov esi, dword [esp + 0x1c]
add esp, 0xc
push 0x400
lea ecx, [esp + 0x1c]
push esi
push ecx
call fcn.00425661
add esp, 0xc
lea edx, [esp + 0x18]
push edx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [esp + 0x18]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push 3
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_MoveFileExW]
call edi
test eax, eax
je 0x4136f9
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x4136e8
call fcn.00413330
test eax, eax
jne 0x4136e8
push 4
push eax
mov ecx, esi
push ecx
call edi
mov esi, dword [esp + 8]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x41371b
jmp 0x4136fd
mov esi, dword [esp + 8]
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x41371b
call fcn.00413330
test eax, eax
jne 0x41371b
mov edx, dword [esp + 8]
push 4
push eax
push edx
call edi
mov eax, dword [esp + 0xc]
push 0
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
mov esi, eax
test esi, esi
jne 0x41373b
mov ecx, dword [esp + 0xc]
push 3
push ebx
push ecx
call edi
mov esi, eax
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x41375b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 8]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41377b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
jne 0x4137d8
mov esi, dword [sym.imp.KERNEL32.dll_MoveFileExW]
mov edi, dword [esp + 0xc]
push 0x800
lea ecx, [esp + 0x1c]
push 0
push ecx
call fcn.004276b0
add esp, 0xc
lea edx, [esp + 0x18]
push edx
push 0
push str.gamepp
lea eax, [esp + 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
push 3
lea ecx, [esp + 0x1c]
push ecx
push edi
call esi
push 5
push ebx
lea edx, [esp + 0x20]
push edx
call esi
mov esi, eax
mov eax, dword [esp + 0x14]
mov byte [eax + 0x2084], 0
mov eax, esi
pop edi
pop esi
mov ecx, dword [esp + 0x2e2c]
xor ecx, esp
call fcn.0042292e
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [esp + 0x2e34]
pop edi
pop esi
xor ecx, esp
xor eax, eax
call fcn.0042292e
mov esp, ebp
pop ebp
ret 4