Function at 0x10040f70
Capabilities:
Check if file exists
Delete file
Get file attributes
Move file
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [str..tmp]
push ebx
mov ebx, dword [ebp + 8]
push esi
mov dword [ebp - 0x1c], eax
mov esi, ebx
mov eax, dword [0x100b2860]
mov dword [ebp - 0x18], eax
mov ax, word [0x100b2864]
mov dword [ebp - 0x10], ecx
lea ecx, [esi + 2]
push edi
mov word [ebp - 0x14], ax
mov edi, edi
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x10040fa0
sub esi, ecx
mov edx, 2
sar esi, 1
xor ecx, ecx
add esi, 5
mov eax, esi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.10079e9e
push ebx
mov edi, eax
push esi
push edi
call fcn.10086dbb
lea eax, [ebp - 0x1c]
push eax
push esi
push edi
call fcn.1008947a
add esp, 0x1c
mov byte [ebp - 1], 0
xor esi, esi
mov dword [ebp - 0xc], esi
jmp 0x10040ff0
push 0x100ae0ec
lea eax, [ebp - 8]
mov dword [ebp - 8], 0
push edi
push eax
call fcn.10088fbb
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x10041019
mov esi, dword [ebp - 8]
test esi, esi
jne 0x10041089
mov esi, dword [ebp - 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x10041038
test al, 7
je 0x10041038
and eax, 0xfffffff8
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test eax, eax
je 0x10041053
push 0x100ae0ec
lea eax, [ebp - 8]
mov dword [ebp - 8], 0
push edi
push eax
call fcn.10088fbb
add esp, 0xc
mov ebx, eax
test ebx, ebx
jne 0x10041061
mov esi, dword [ebp - 8]
test esi, esi
jne 0x10041089
mov esi, dword [ebp - 0xc]
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
inc esi
mov dword [ebp - 0xc], esi
cmp esi, 0xa
jl 0x10040ff0
test ebx, ebx
jne 0x1004115d
mov esi, dword [ebp - 8]
test esi, esi
je 0x1004115d
mov ebx, dword [ebp - 0x10]
cmp byte [ebx + 0x44], 0
je 0x100410b6
push esi
push 0xef
call fcn.10088ed1
push esi
push 0xbb
call fcn.10088ed1
push esi
push 0xbf
call fcn.10088ed1
add esp, 0x18
mov eax, dword [ebx]
mov ecx, ebx
push 0
push esi
call dword [eax + 4]
push dword [ebp - 8]
call fcn.10089127
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
add esp, 4
push edi
call esi
cmp eax, 0xffffffff
je 0x100410e8
test al, 7
je 0x100410e8
and eax, 0xfffffff8
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov ebx, dword [ebp + 8]
mov byte [ebp - 1], 0
test ebx, ebx
je 0x1004110a
push ebx
call esi
cmp eax, 0xffffffff
je 0x1004110a
test al, 7
je 0x1004110a
and eax, 0xfffffff8
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push ebx
push edi
mov esi, 0xa
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
jne 0x10041159
jmp 0x10041120
push 0
push 0
push 2
push 0
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReplaceFileW]
test eax, eax
jne 0x10041159
dec esi
test esi, esi
jle 0x10041172
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x10041172
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
je 0x10041120
mov byte [ebp - 1], 1
push edi
call fcn.10079d07
mov al, byte [ebp - 1]
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x1004115d