Function at 0x406380
Capabilities:
Check if file exists
Create directory
Delete file
Move file
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x439310
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x4510e0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x18], ecx
mov dword [ebp - 4], 2
xor ebx, ebx
call fcn.00409d5c
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x4063d0
push 0x80004005
call fcn.004022b0
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x14], esi
lea eax, [ebp + 0xc]
push eax
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0x10]
mov byte [ebp - 4], 3
push eax
mov dword [ebp - 0x10], 0
call fcn.00406f10
add esp, 0xc
mov byte [ebp - 4], 4
push 0x80
push dword [ebp - 0x10]
inc ebx
mov dword [ebp - 0x28], ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ebx, eax
mov dword [ebp - 0x20], ebx
test ebx, ebx
jne 0x406568
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x24], eax
cmp eax, 2
je 0x406568
cmp eax, 3
je 0x406568
push dword [ebp - 0x10]
lea eax, [ebp - 0x14]
push 0x447a34
push eax
call fcn.004073f0
mov esi, dword [ebp - 0x14]
add esp, 0xc
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
call dword [eax + 0x10]
lea edx, [esi - 4]
mov ecx, eax
cmp dword [edx], ebx
jl 0x40647e
cmp ecx, dword [esi - 0x10]
jne 0x40647e
lea ebx, [esi - 0x10]
mov eax, 1
lock xadd dword [edx], eax
jmp 0x4064b7
mov eax, dword [ecx]
push 2
push dword [esi - 0xc]
call dword [eax]
mov ebx, eax
test ebx, ebx
je 0x40667f
mov ecx, dword [esi - 0xc]
mov dword [ebx + 4], ecx
mov edx, dword [esi - 0xc]
lea ecx, [ebx + 0x10]
lea eax, [edx*2 + 2]
push eax
push esi
lea eax, [edx*2 + 2]
push eax
push ecx
call fcn.0041bebc
add esp, 0x10
lea edi, [ebx + 0x10]
mov dword [ebp - 0x2c], edi
mov byte [ebp - 4], 5
mov eax, dword [edi - 0xc]
test eax, eax
je 0x406529
mov ecx, dword [ebp - 0x18]
cmp dword [ecx + 8], 0
je 0x406529
inc eax
xor ecx, ecx
mov dword [ebp - 0x1c], eax
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00409a44
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x406529
mov ecx, dword [ebp - 0x1c]
add ecx, ecx
push ecx
push 0
push ebx
call fcn.0041d590
push edi
push dword [ebp - 0x1c]
push ebx
call fcn.0041c0d9
mov eax, dword [ebp - 0x18]
add esp, 0x18
mov eax, dword [eax + 8]
push ebx
push 0x68d
push 0x8bb8
push dword [eax + 0x20]
call dword [sym.imp.USER32.dll_PostMessageW]
add edi, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edi + 0xc]
mov byte [ebp - 4], 4
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x406547
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
cmp dword [ebp - 0x24], 5
je 0x406620
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ebx, dword [ebp - 0x28]
cmp ebx, 0xa
jl 0x406400
mov ebx, dword [ebp - 0x20]
mov byte [ebp - 4], 3
mov edx, dword [ebp - 0x10]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x406589
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea edx, [esi - 0x10]
or esi, 0xffffffff
mov byte [ebp - 4], 2
lea eax, [edx + 0xc]
mov ecx, esi
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x4065a9
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 1
mov edx, dword [ebp + 8]
add edx, 0xfffffff0
mov ecx, esi
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x4065c9
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov edx, dword [ebp + 0xc]
add edx, 0xfffffff0
mov ecx, esi
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x4065e9
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp + 0x14]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x40660a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
cmp dword [ebp + 0x10], 0
je 0x406565
push 0
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
xor edi, edi
push edi
push dword [ebp + 0xc]
lea eax, [ebp - 0x14]
push dword [ebp + 0x14]
push str._s_s._04d.OLD
push eax
call fcn.004073f0
mov esi, dword [ebp - 0x14]
add esp, 0x14
push esi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_MoveFileW]
push 4
push 0
push esi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test ebx, ebx
jne 0x406568
inc edi
cmp edi, 0x3e8
jl 0x406637
jmp 0x406568
call fcn.004021c0
int3