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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x464
mov eax, dword [0x54c384]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov esi, ecx
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40f3eb
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x40f3eb
mov ecx, esi
mov dword [ebp - 0x450], eax
mov dword [ebp - 0x44c], 7
mov word [ebp - 0x460], ax
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f082
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0x460]
call fcn.00403e30
push 0x208
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.004c05c0
mov ecx, dword [ebp - 0x450]
mov eax, 0x103
cmp ecx, eax
cmova ecx, eax
cmp dword [ebp - 0x44c], 8
lea eax, [ebp - 0x460]
cmovae eax, dword [ebp - 0x460]
push ecx
push eax
lea eax, [ebp - 0x210]
push eax
call fcn.004cdf34
add esp, 0x18
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
xor eax, eax
mov dword [ebp - 0x438], 0
lea ecx, [ebp - 0x210]
mov dword [ebp - 0x434], 7
mov word [ebp - 0x448], ax
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f120
sub ecx, edx
lea eax, [ebp - 0x210]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x448]
call fcn.00403e30
mov edx, dword [ebp - 0x44c]
cmp edx, 8
jb 0x40f182
mov ecx, dword [ebp - 0x460]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40f178
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40f401
push edx
push ecx
call fcn.004bdd39
add esp, 8
mov ecx, esi
mov dword [ebp - 0x450], 0
xor eax, eax
mov dword [ebp - 0x44c], 7
mov word [ebp - 0x460], ax
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f1a4
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0x460]
call fcn.00403e30
cmp dword [ebp - 0x44c], 8
lea ecx, [ebp - 0x460]
mov edx, dword [ebp - 0x450]
cmovae ecx, dword [ebp - 0x460]
test edx, edx
je 0x40f258
or edi, 0xffffffff
lea ebx, [edx - 1]
cmp ebx, edi
mov eax, edi
cmovb eax, ebx
cmp word [ecx + eax*2], 0x5c
lea eax, [ecx + eax*2]
je 0x40f202
cmp eax, ecx
je 0x40f258
sub eax, 2
cmp word [eax], 0x5c
jne 0x40f1f5
sub eax, ecx
sar eax, 1
cmp eax, 0xffffffff
je 0x40f258
cmp eax, ebx
jae 0x40f258
lea ecx, [eax + 1]
mov dword [ebp - 0x420], 0
xor eax, eax
mov dword [ebp - 0x41c], 7
mov word [ebp - 0x430], ax
cmp edx, ecx
jb 0x40f406
sub edx, ecx
lea eax, [ebp - 0x460]
cmp edx, 0xffffffff
cmovb edi, edx
cmp dword [ebp - 0x44c], 8
cmovae eax, dword [ebp - 0x460]
lea eax, [eax + ecx*2]
jmp 0x40f27c
xor eax, eax
mov dword [ebp - 0x420], 0
mov word [ebp - 0x430], ax
xor edi, edi
mov dword [ebp - 0x41c], 7
mov eax, 0x5010a0
push edi
push eax
lea ecx, [ebp - 0x430]
call fcn.00403e30
mov edx, dword [ebp - 0x44c]
cmp edx, 8
jb 0x40f2c9
mov ecx, dword [ebp - 0x460]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40f2bf
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40f40b
push edx
push ecx
call fcn.004bdd39
add esp, 8
push 0x208
lea eax, [ebp - 0x418]
push 0
push eax
call fcn.004c05c0
add esp, 0xc
lea eax, [ebp - 0x418]
push eax
push 0x103
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp dword [ebp - 0x41c], 8
lea eax, [ebp - 0x430]
cmovae eax, dword [ebp - 0x430]
push eax
lea eax, [ebp - 0x418]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push 1
lea eax, [ebp - 0x418]
push eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_MoveFileExW]
call esi
test eax, eax
jne 0x40f32d
xor esi, esi
jmp 0x40f33f
push 4
push 0
lea eax, [ebp - 0x418]
push eax
call esi
mov esi, 1
mov edx, dword [ebp - 0x41c]
cmp edx, 8
jb 0x40f37f
mov ecx, dword [ebp - 0x430]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40f375
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40f410
push edx
push ecx
call fcn.004bdd39
add esp, 8
mov edx, dword [ebp - 0x434]
xor eax, eax
mov dword [ebp - 0x420], 0
mov dword [ebp - 0x41c], 7
mov word [ebp - 0x430], ax
cmp edx, 8
jb 0x40f3d8
mov ecx, dword [ebp - 0x448]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40f3ce
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40f410
push edx
push ecx
call fcn.004bdd39
add esp, 8
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bdaf8
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004bdaf8
mov esp, ebp
pop ebp
ret
call fcn.004c8da3
call fcn.004045a0
call fcn.004c8da3
call fcn.004c8da3
int3