Function at 0x40b7f0
Capabilities:
Check if file exists
Get file attributes
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x52d3c0
mov eax, dword fs:[0]
push eax
sub esp, 0x48
push ebx
push esi
push edi
mov eax, dword [0x5976b8]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x18], ecx
mov eax, dword [ebp + 8]
cmp dword [eax - 0xc], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x10], 0
je 0x40bd33
cmp dword [eax - 4], 1
jle 0x40b84b
mov ecx, dword [eax - 0xc]
push ecx
lea ecx, [ebp + 8]
call fcn.004036b0
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x40b875
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x40bd46
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40b896
test al, 1
je 0x40b896
mov edx, dword [ebp + 8]
and eax, 0xfffffffe
push eax
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov esi, dword [ebp + 0xc]
mov edi, dword [ebp + 0x10]
cmp esi, 2
je 0x40b8aa
cmp esi, 1
jne 0x40bbb9
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
push eax
call fcn.00403500
add eax, 0x10
add esp, 4
mov dword [ebp + 0x10], eax
push 4
push 0x53ddc8
lea ecx, [ebp + 0x10]
mov byte [ebp - 4], 1
call fcn.00407e00
lea ecx, [ebp - 0x54]
call fcn.00416bbc
mov eax, dword [ebp + 0x10]
push 0
push eax
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 2
call fcn.00416c88
test eax, eax
je 0x40bb82
lea ecx, [ebp - 0x54]
call fcn.0041680e
lea ecx, [ebp - 0x54]
mov dword [ebp - 0x38], eax
call fcn.00416b7e
test eax, eax
jne 0x40bb70
mov edx, dword [ebp - 0x54]
mov eax, dword [edx + 0x38]
push 0x10
lea ecx, [ebp - 0x54]
call eax
test eax, eax
je 0x40b959
cmp esi, 1
jne 0x40bb65
mov ecx, dword [ebp + 0x14]
push ecx
push edi
push esi
push ecx
mov edx, esp
mov dword [ebp - 0x2c], esp
push edx
lea ecx, [ebp - 0x54]
call fcn.00416ecb
mov ecx, dword [ebp - 0x18]
call fcn.0040b7f0
cmp eax, 0xbc2
jne 0x40bb65
mov dword [ebp - 0x10], esi
jmp 0x40bb65
mov eax, dword [ebp - 0x54]
mov edx, dword [eax + 0x38]
push 1
lea ecx, [ebp - 0x54]
call edx
test eax, eax
je 0x40b9d8
lea eax, [ebp - 0x1c]
push eax
lea ecx, [ebp - 0x54]
call fcn.00416ecb
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov esi, eax
mov eax, dword [ebp - 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40b9a0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x20]
push ecx
lea ecx, [ebp - 0x54]
and esi, 0xfffffffe
call fcn.00416ecb
mov eax, dword [eax]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40b9d8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x24]
push ecx
lea ecx, [ebp - 0x54]
call fcn.00416ecb
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
mov eax, dword [ebp - 0x24]
sete bl
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40ba11
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
je 0x40bb65
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
je 0x40ba2d
cmp eax, 5
jne 0x40bb65
lea ecx, [ebp - 0x14]
call fcn.004037a0
mov eax, dword [edi + 8]
xor esi, esi
mov byte [ebp - 4], 3
mov dword [ebp - 0x2c], eax
test eax, eax
jle 0x40bab0
test esi, esi
js 0x40bc00
cmp esi, dword [edi + 8]
jge 0x40bc00
mov ecx, dword [edi + 4]
lea eax, [ecx + esi*4]
push eax
lea ecx, [ebp - 0x14]
call fcn.00404700
lea edx, [ebp - 0x28]
push edx
lea ecx, [ebp - 0x54]
call fcn.00416ecb
mov eax, dword [eax]
push eax
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
mov eax, dword [ebp - 0x28]
sete bl
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40baa2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
jne 0x40bb42
inc esi
cmp esi, dword [ebp - 0x2c]
jl 0x40ba45
mov esi, dword [ebp - 0x18]
cmp dword [esi + 0x14], 4
je 0x40bb42
lea ecx, [ebp - 0x30]
push ecx
lea ecx, [ebp - 0x54]
call fcn.00416ecb
mov eax, dword [eax]
push 0
push eax
mov ecx, esi
mov byte [ebp - 4], 4
call fcn.00409250
mov eax, dword [ebp - 0x30]
add eax, 0xfffffff0
mov byte [ebp - 4], 3
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40bafc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x34]
push ecx
lea ecx, [ebp - 0x54]
call fcn.00416ecb
mov ecx, dword [edi + 8]
push eax
push ecx
mov ecx, edi
mov byte [ebp - 4], 5
call fcn.004164df
mov eax, dword [ebp - 0x34]
add eax, 0xfffffff0
mov byte [ebp - 4], 3
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40bb3b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
mov byte [ebp - 4], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bb65
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov esi, dword [ebp + 0xc]
cmp dword [ebp - 0x38], 0
jne 0x40b8f4
lea ecx, [ebp - 0x54]
call fcn.00416728
lea ecx, [ebp + 0x10]
call fcn.004035e0
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 1
call fcn.00416bee
mov eax, dword [ebp + 0x10]
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 0x40bbb9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
test eax, eax
jne 0x40bca0
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
je 0x40bbe6
cmp eax, 5
je 0x40bbe6
cmp eax, 0x91
jne 0x40bcee
call fcn.004170fe
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40bc05
push 0x80004005
call fcn.00401550
call fcn.0041565f
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea ebx, [eax + 0x10]
mov dword [ebp + 0xc], ebx
mov eax, dword [edi + 8]
xor esi, esi
mov byte [ebp - 4], 6
mov dword [ebp + 0x10], eax
test eax, eax
jle 0x40bc54
test esi, esi
js 0x40bc00
cmp esi, dword [edi + 8]
jge 0x40bc00
mov ecx, dword [edi + 4]
lea eax, [ecx + esi*4]
push eax
lea ecx, [ebp + 0xc]
call fcn.00404700
mov edx, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x40bc7e
inc esi
cmp esi, dword [ebp + 0x10]
jl 0x40bc24
cmp dword [ebp + 0x14], 0
je 0x40bc7e
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x18]
push 1
push eax
call fcn.00409250
mov eax, dword [edi + 8]
lea ecx, [ebp + 8]
push ecx
push eax
mov ecx, edi
call fcn.004164df
mov dword [ebp - 0x10], 1
lea eax, [ebx - 0x10]
mov byte [ebp - 4], 0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40bcee
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x40bcee
lea ecx, [ebp - 0x54]
call fcn.00416bbc
mov ecx, dword [ebp + 8]
push 0
push ecx
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 7
call fcn.00416c88
test eax, eax
je 0x40bcda
mov edi, edi
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp + 8]
push 0
push edx
lea ecx, [ebp - 0x54]
call fcn.00416c88
test eax, eax
jne 0x40bcc0
lea ecx, [ebp - 0x54]
call fcn.00416728
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 0
call fcn.00416bee
cmp dword [ebp - 0x10], 0
mov eax, dword [ebp + 8]
je 0x40bd33
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bd1a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 0xbc2
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
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
mov dword [ebp - 4], edx
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bd52
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
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