Function at 0x40d420
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.00440b70
mov eax, dword [0x4fa2a0]
xor eax, esp
mov dword [esp + 0x2e2c], eax
mov eax, dword [ebp + 8]
push esi
push edi
mov edi, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], edi
test edi, edi
je 0x40d87d
test ebx, ebx
je 0x40d87d
push 0x800
lea ecx, [esp + 0x181c]
push 0
push ecx
call fcn.00436fe0
push 0x400
lea edx, [esp + 0x1828]
push ebx
push edx
call fcn.0042f9f3
add esp, 0x18
lea eax, [esp + 0x1818]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea ecx, [esp + 0x1818]
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push 0x800
lea edx, [esp + 0x81c]
push 0
push edx
call fcn.00436fe0
add esp, 0xc
lea eax, [esp + 0x818]
push eax
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 0x40d4ed
mov esi, dword [sym.imp.KERNEL32.dll_MoveFileExW]
push 3
push ebx
push edi
call esi
test eax, eax
je 0x40d508
mov eax, 1
pop edi
pop esi
mov ecx, dword [esp + 0x2e2c]
xor ecx, esp
call fcn.0042cf77
mov esp, ebp
pop ebp
ret 4
push 0x800
lea ecx, [esp + 0x101c]
push 0
push ecx
call fcn.00436fe0
add esp, 0xc
lea edx, [esp + 0x1018]
push edx
push 0
push str.neocell
lea eax, [esp + 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x40d816
xor ecx, ecx
push 0x206
push ecx
lea edx, [esp + 0x2a2a]
push edx
mov word [esp + 0x2a2c], cx
call fcn.00436fe0
lea edx, [esp + 0x2a2c]
add esp, 0xc
mov eax, ebx
sub edx, ebx
nop
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x40d570
lea eax, [esp + 0x2a20]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea edi, [esp + 0x2a20]
add edi, 0xfffffffe
jmp 0x40d5a0
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x40d5a0
mov ecx, dword [0x4d4c6c]
push 0x800
lea edx, [esp + 0x201c]
push 0
push edx
mov dword [edi], ecx
call fcn.00436fe0
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0x2c3e]
push ecx
mov word [esp + 0x2c40], ax
call fcn.00436fe0
add esp, 0x18
lea edx, [esp + 0x2c28]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [esp + 0x2018]
push eax
push 0
push str.neocell
lea ecx, [esp + 0x2c34]
push ecx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [esp + 0x2018]
lea esi, [esp + 8]
call fcn.00403290
lea edx, [esp + 0x2a20]
push edx
lea eax, [esp + 0x2c2c]
push eax
mov ecx, esi
push ecx
call fcn.0040a110
mov edi, dword [esp + 8]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_MoveFileW]
xor edx, edx
push 0x206
push edx
lea eax, [esp + 0x2822]
push eax
mov word [esp + 0x2824], dx
call fcn.00436fe0
lea ecx, [esp + 0x2824]
add esp, 0xc
mov eax, ebx
sub ecx, ebx
jmp 0x40d680
movzx edx, word [eax]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x40d680
lea ecx, [esp + 0x2818]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [esp + 0x2818]
add eax, 0xfffffffe
jmp 0x40d6b0
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x40d6b0
mov edx, dword [str.Temp_]
mov ecx, dword [0x4d59d8]
mov dword [eax], edx
mov edx, dword [0x4d59dc]
mov dword [eax + 4], ecx
mov cx, word [0x4d59e0]
mov dword [eax + 8], edx
mov word [eax + 0xc], cx
lea eax, [esp + 0x1018]
lea esi, [esp + 0x10]
call fcn.00403290
lea edx, [esp + 0x2818]
push edx
lea eax, [esp + 0x81c]
push eax
mov ecx, esi
push ecx
call fcn.0040a110
push 0x800
lea edx, [esp + 0x1c]
push 0
push edx
call fcn.00436fe0
mov esi, dword [esp + 0x1c]
push 0x400
lea eax, [esp + 0x28]
push esi
push eax
call fcn.0042f9f3
add esp, 0x18
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea edx, [esp + 0x18]
push edx
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 0x40d786
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x40d775
call fcn.0040d3f0
test eax, eax
jne 0x40d775
push 4
push eax
mov eax, esi
push eax
call edi
mov esi, dword [esp + 8]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d7a8
jmp 0x40d78a
mov esi, dword [esp + 8]
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x40d7a8
call fcn.0040d3f0
test eax, eax
jne 0x40d7a8
mov ecx, dword [esp + 8]
push 4
push eax
push ecx
call edi
mov edx, dword [esp + 0xc]
push 0
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_CopyFileW]
mov esi, eax
test esi, esi
jne 0x40d7c8
mov eax, dword [esp + 0xc]
push 3
push ebx
push eax
call edi
mov esi, eax
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d7e8
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 0x40d808
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
jne 0x40d865
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.00436fe0
add esp, 0xc
lea edx, [esp + 0x18]
push edx
push 0
push str.neocell
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.0042cf77
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [esp + 0x2e34]
pop edi
pop esi
xor ecx, esp
xor eax, eax
call fcn.0042cf77
mov esp, ebp
pop ebp
ret 4