Function at 0x407040
Capabilities:
Check if file exists
Copy file
Move file

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1005c
call fcn.0041d6a0
mov eax, dword [0x424284]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push edi
lea eax, [ebp - 0x1001c]
mov ebx, ecx
push eax
mov dword [ebp - 0x10054], ebx
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
push 0
push 0x80
push 3
push 0
push 7
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x4071de
lea ecx, [ebp - 0x10050]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
mov ebx, dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
test eax, eax
jne 0x4070c2
xor eax, eax
lea edx, [ebp - 0x1003c]
mov dword [ebp + 0x14], eax
mov dword [ebp + 0x10], eax
mov dword [ebp + 8], eax
push edx
lea eax, [ebp - 0x1001c]
push eax
call ebx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp + 8], 0
je 0x407129
lea eax, [ebp - 0x1005c]
push eax
lea ecx, [ebp - 0x1001c]
push ecx
call ebx
mov edx, dword [ebp + 8]
mov edi, dword [ebp - 0x1005c]
mov ebx, dword [ebp - 0x10058]
push 0xffffffffffffffff
push 0xff676980
push 0
push edx
call fcn.0041da20
add edi, eax
lea eax, [ebp - 0x1005c]
push eax
lea ecx, [ebp - 0x1003c]
adc ebx, edx
push ecx
mov dword [ebp - 0x1005c], edi
mov dword [ebp - 0x10058], ebx
call dword [sym.imp.KERNEL32.dll_CompareFileTime]
test eax, eax
jg 0x4072a2
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x14]
test edx, edx
jne 0x407137
test eax, eax
je 0x407153
mov ecx, dword [ebp - 0x10030]
cmp ecx, eax
jb 0x4072a2
jne 0x407153
cmp dword [ebp - 0x1002c], edx
jb 0x4072a2
lea edx, [ebp - 0x1001c]
push edx
lea eax, [ebp - 0x1003c]
push eax
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
lea edx, [ebp - 0x1001c]
lea ebx, [ebp - 0x1000c]
mov ecx, esi
call fcn.00406f70
cmp byte [ebp + 0x18], 0
je 0x407227
push 1
lea ecx, [ebp - 0x1000c]
push ecx
push esi
mov ebx, str.CopyFile__
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x40726e
mov eax, 0x80
push 3
lea ecx, [eax - 0x7c]
mov ebx, esi
call fcn.00406ef0
mov edx, dword [ebp + 0xc]
add esp, 4
push edx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40723e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x4072a2
push 0
mov edi, eax
call fcn.00402080
push eax
push esi
push str.CreateFile__
push esi
push ebx
push 0xc0000427
push 1
call fcn.004021b0
add esp, 0x20
lea ecx, [ebp - 0x1003c]
push ecx
lea edx, [ebp - 0x1001c]
push edx
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
jmp 0x407153
lea eax, [ebp - 0x1000c]
push eax
push esi
mov ebx, str.MoveFile__
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
je 0x40726e
mov edx, dword [ebp - 0x10054]
push 0
lea ecx, [ebp - 0x1000c]
push ecx
push esi
push edx
push 0x40000435
push 4
call fcn.004021b0
add esp, 0x18
pop edi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041427b
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x4072a2
push 0
mov edi, eax
call fcn.00402080
mov ecx, dword [ebp - 0x10054]
push eax
lea eax, [ebp - 0x1000c]
push eax
push ebx
push esi
push ecx
push 0xc0000427
push 1
call fcn.004021b0
add esp, 0x20
mov ecx, dword [ebp - 8]
pop edi
xor ecx, ebp
pop ebx
call fcn.0041427b
mov esp, ebp
pop ebp
ret