Function at 0x40af90
Capabilities:
Check if file exists
Delete directory
Get file attributes
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x52d31f
mov eax, dword fs:[0]
push eax
mov eax, 0x1674
call fcn.005158c0
mov eax, dword [0x5976b8]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 0x14]
sub edi, dword [ebp + 0x10]
mov esi, dword [ebp + 0xc]
push 0x206
mov dword [ebp - 0x1668], ecx
xor ebx, ebx
lea ecx, [ebp - 0x216]
xor eax, eax
push ebx
push ecx
mov dword [ebp - 0x166c], edi
mov word [ebp - 0x218], ax
call fcn.005149a0
add esp, 0xc
lea ecx, [ebp - 0x1680]
mov dword [ebp - 0x1660], ebx
call fcn.00416033
push 0xd4a4
mov dword [ebp - 4], ebx
call fcn.00415512
add esp, 4
mov dword [ebp - 0x1664], eax
mov byte [ebp - 4], 1
cmp eax, ebx
je 0x40b037
mov ecx, eax
call fcn.00411ce0
mov ebx, eax
mov dword [ebp - 0x1650], ebx
jmp 0x40b03d
mov dword [ebp - 0x1650], ebx
mov byte [ebp - 4], 0
test ebx, ebx
jne 0x40b061
lea ecx, [ebp - 0x1680]
mov dword [ebp - 4], 0xffffffff
call fcn.00416386
mov eax, 0x661
jmp 0x40b492
cmp dword [ebp + 8], 0
mov dword [ebp - 0x165c], 0
jbe 0x40b450
add esi, 0x208
mov dword [ebp - 0x1648], edi
mov dword [ebp - 0x1654], esi
push esi
lea edx, [esi - 0x208]
push edx
push 0x53d734
lea eax, [ebp - 0x218]
push 0x104
push eax
call fcn.00515c51
mov edx, dword [ebx]
mov edx, dword [edx + 0x1c]
add esp, 0x14
lea eax, [ebp - 0x1640]
push eax
push esi
mov ecx, ebx
call edx
mov eax, dword [ebp - 0x1438]
mov dword [ebp - 0x164c], eax
test eax, eax
jle 0x40b40a
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40b0f4
test al, 1
je 0x40b0f4
and eax, 0xfffffffe
push eax
lea ecx, [ebp - 0x218]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea edx, [ebp - 0x218]
push edx
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
test eax, eax
jne 0x40b2dd
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
je 0x40b124
cmp eax, 5
je 0x40b124
cmp eax, 0x91
jne 0x40b33e
call fcn.004170fe
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
je 0x40b47c
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x1644], eax
mov eax, dword [ebp - 0x1678]
xor edi, edi
mov byte [ebp - 4], 2
mov dword [ebp - 0x1664], eax
mov dword [ebp - 0x1658], edi
test eax, eax
jle 0x40b278
jmp 0x40b176
mov eax, dword [ebp - 0x1678]
test edi, edi
js 0x40b48b
cmp edi, eax
jge 0x40b48b
mov ecx, dword [ebp - 0x167c]
mov eax, dword [ecx + edi*4]
mov ebx, dword [ebp - 0x1644]
lea esi, [eax - 0x10]
add ebx, 0xfffffff0
cmp esi, ebx
je 0x40b24d
cmp dword [ebx + 0xc], 0
jl 0x40b23d
mov ecx, dword [esi]
cmp ecx, dword [ebx]
jne 0x40b23d
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
cmp dword [esi + 0xc], 0
lea ecx, [esi + 0xc]
jl 0x40b1d8
cmp eax, dword [esi]
jne 0x40b1d8
mov edi, esi
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x40b213
mov ecx, dword [esi + 4]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
je 0x40b486
mov eax, dword [esi + 4]
mov dword [edi + 4], eax
mov eax, dword [esi + 4]
lea ecx, [eax + eax + 2]
push ecx
add esi, 0x10
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [edi + 0x10]
push eax
call fcn.00515373
add esp, 0x10
lea eax, [ebx + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40b22c
mov ecx, dword [ebx]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebx
call eax
add edi, 0x10
mov dword [ebp - 0x1644], edi
mov edi, dword [ebp - 0x1658]
jmp 0x40b24d
mov ecx, dword [eax - 0xc]
push ecx
push eax
lea ecx, [ebp - 0x1644]
call fcn.00404130
mov edx, dword [ebp - 0x1644]
lea ecx, [ebp - 0x218]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x40b2b5
inc edi
mov dword [ebp - 0x1658], edi
cmp edi, dword [ebp - 0x1664]
jl 0x40b170
cmp dword [ebp + 0x1c], 0
je 0x40b2b5
mov ecx, dword [ebp - 0x1668]
push 1
lea eax, [ebp - 0x218]
push eax
call fcn.00409250
mov edx, dword [ebp - 0x1678]
lea ecx, [ebp - 0x218]
push ecx
push edx
lea ecx, [ebp - 0x1680]
call fcn.00416681
mov dword [ebp - 0x1660], 1
mov eax, dword [ebp - 0x1644]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40b33e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x40b33e
lea ecx, [ebp - 0x234]
call fcn.00416bbc
push 0
lea ecx, [ebp - 0x218]
push ecx
lea ecx, [ebp - 0x234]
mov byte [ebp - 4], 3
call fcn.00416c88
test eax, eax
je 0x40b324
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
lea edx, [ebp - 0x218]
push edx
lea ecx, [ebp - 0x234]
call fcn.00416c88
test eax, eax
jne 0x40b304
lea ecx, [ebp - 0x234]
call fcn.00416728
lea ecx, [ebp - 0x234]
mov byte [ebp - 4], 0
call fcn.00416bee
lea eax, [ebp - 0x218]
push 0x104
push eax
call fcn.0051611e
mov ecx, dword [ebp - 0x164c]
mov ecx, dword [ebp + ecx*4 - 0x1338]
add esp, 8
mov esi, eax
mov ebx, 7
xor edx, edx
mov eax, ecx
mov dword [ebp - 0x220], ebx
mov dword [ebp - 0x224], 0
mov word [ebp - 0x234], dx
lea edi, [eax + 2]
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x40b384
sub eax, edi
sar eax, 1
push eax
push ecx
lea ecx, [ebp - 0x234]
call fcn.00408030
cmp dword [ebp - 0x220], 8
mov edi, dword [ebp - 0x224]
jb 0x40b3be
mov eax, dword [ebp - 0x234]
push eax
call fcn.0041554c
add esp, 4
mov eax, dword [ebp - 0x164c]
dec eax
xor ecx, ecx
sub esi, edi
xor edx, edx
mov dword [ebp - 0x220], ebx
mov dword [ebp - 0x224], 0
mov word [ebp - 0x234], cx
mov word [ebp + esi*2 - 0x21a], dx
mov dword [ebp - 0x164c], eax
test eax, eax
jg 0x40b0cd
mov edi, dword [ebp - 0x166c]
mov ebx, dword [ebp - 0x1650]
mov esi, dword [ebp - 0x1654]
mov eax, dword [ebp - 0x1648]
xor edx, edx
div dword [ebp + 8]
mov ecx, dword [ebp + 0x18]
push ecx
mov ecx, dword [ebp - 0x1668]
add eax, dword [ebp + 0x10]
push eax
call fcn.00405f40
mov eax, dword [ebp - 0x165c]
add dword [ebp - 0x1648], edi
inc eax
add esi, 0x410
mov dword [ebp - 0x165c], eax
mov dword [ebp - 0x1654], esi
cmp eax, dword [ebp + 8]
jb 0x40b087
mov edx, dword [ebx]
mov eax, dword [edx]
push 1
mov ecx, ebx
call eax
lea ecx, [ebp - 0x1680]
mov dword [ebp - 4], 0xffffffff
call fcn.00416386
cmp dword [ebp - 0x1660], 0
je 0x40b490
mov eax, 0xbc2
jmp 0x40b492
push 0x80004005
call fcn.00401550
call fcn.004034f0
call fcn.0041565f
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00514990
mov esp, ebp
pop ebp
ret 0x18