Function at 0x406900
Capabilities:
Check if file exists
Delete directory
Delete file
Enumerate files on windows
Get file attributes
Set file attributes

Disassembly:
push 0xffffffffffffffff
push 0x4de870
mov eax, dword fs:[0]
push eax
sub esp, 0x324
mov eax, dword [0x526a28]
xor eax, esp
mov dword [esp + 0x320], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x526a28]
xor eax, esp
push eax
lea eax, [esp + 0x338]
mov dword fs:[0], eax
xor ebx, ebx
xor eax, eax
mov edi, ecx
mov word [esp + 0xb0], ax
mov ebp, 7
mov eax, edi
mov dword [esp + 0x18], ebx
mov dword [esp + 0xc4], ebp
mov dword [esp + 0xc0], ebx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x406965
sub eax, edx
sar eax, 1
push eax
mov eax, edi
lea esi, [esp + 0xb0]
call fcn.004095e0
mov dword [esp + 0x340], ebx
xor ecx, ecx
mov dword [esp + 0xe0], ebp
mov dword [esp + 0xdc], ebx
mov word [esp + 0xcc], cx
push 4
mov byte [esp + 0x344], 1
call fcn.0040b622
add esp, 4
cmp eax, ebx
je 0x4069c0
lea edx, [esp + 0x1c]
mov dword [eax], edx
jmp 0x4069c2
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
mov bl, 2
lea ecx, [esp + 0x58]
mov byte [esp + 0x340], bl
call fcn.0046f880
push edi
mov byte [esp + 0x344], 3
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x406a7f
lea ecx, [esp + 0x58]
mov byte [esp + 0x340], bl
call fcn.0046fa37
lea esi, [esp + 0x1c]
call fcn.00409290
mov eax, dword [esp + 0x1c]
push eax
call fcn.0040b651
mov esi, 8
add esp, 4
cmp dword [esp + 0xe0], esi
jb 0x406a43
mov ecx, dword [esp + 0xcc]
push ecx
call fcn.0040b651
add esp, 4
xor edx, edx
mov dword [esp + 0xe0], ebp
mov dword [esp + 0xdc], 0
mov word [esp + 0xcc], dx
cmp dword [esp + 0xc4], esi
jb 0x406a78
mov eax, dword [esp + 0xb0]
push eax
call fcn.0040b651
add esp, 4
xor eax, eax
jmp 0x407232
mov eax, dword [esp + 0xc0]
lea esi, [eax - 1]
cmp eax, esi
ja 0x406a99
call fcn.00474929
mov eax, dword [esp + 0xc0]
cmp dword [esp + 0xc4], 8
mov ecx, dword [esp + 0xb0]
jae 0x406ab1
lea ecx, [esp + 0xb0]
mov edx, 0x5c
cmp dx, word [ecx + esi*2]
lea esi, [esp + 0x3c]
jne 0x406b64
lea edx, [eax - 1]
lea eax, [esp + 0xac]
push eax
call fcn.00408f40
push eax
mov ebx, 0x5192d8
lea esi, [esp + 0x94]
mov byte [esp + 0x344], 4
call fcn.00409f80
add esp, 4
push 0xffffffffffffffff
push 0
lea ecx, [esp + 0xd0]
mov byte [esp + 0x348], 5
call fcn.004091e0
mov ebp, 8
cmp dword [esp + 0xa8], ebp
jb 0x406b27
mov ecx, dword [esp + 0x94]
push ecx
call fcn.0040b651
add esp, 4
xor edx, edx
mov byte [esp + 0x340], 3
mov dword [esp + 0xa8], 7
mov dword [esp + 0xa4], 0
mov word [esp + 0x94], dx
cmp dword [esp + 0x54], ebp
jb 0x406bb2
mov eax, dword [esp + 0x40]
push eax
call fcn.0040b651
add esp, 4
jmp 0x406bb2
lea ecx, [esp + 0xac]
push ecx
mov ebx, 0x5192d8
call fcn.00409f80
add esp, 4
push 0xffffffffffffffff
push 0
lea ecx, [esp + 0xd0]
mov byte [esp + 0x348], 6
call fcn.004091e0
mov byte [esp + 0x340], 3
cmp dword [esp + 0x54], 8
jb 0x406bad
mov edx, dword [esp + 0x40]
push edx
call fcn.0040b651
add esp, 4
mov ebp, 8
mov eax, dword [esp + 0xcc]
cmp dword [esp + 0xe0], ebp
jae 0x406bc9
lea eax, [esp + 0xcc]
lea ecx, [esp + 0xe4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [esp + 0x14], eax
cmp eax, 0xffffffff
jne 0x406c69
lea ecx, [esp + 0x58]
mov byte [esp + 0x340], 2
call fcn.0046fa37
lea esi, [esp + 0x1c]
call fcn.00409290
mov edx, dword [esp + 0x1c]
push edx
call fcn.0040b651
add esp, 4
cmp dword [esp + 0xe0], ebp
jb 0x406c25
mov eax, dword [esp + 0xcc]
push eax
call fcn.0040b651
add esp, 4
xor ecx, ecx
mov dword [esp + 0xe0], 7
mov dword [esp + 0xdc], 0
mov word [esp + 0xcc], cx
cmp dword [esp + 0xc4], ebp
jb 0x406a78
mov edx, dword [esp + 0xb0]
push edx
call fcn.0040b651
add esp, 4
xor eax, eax
jmp 0x407232
xor edi, edi
jmp 0x406c70
test byte [esp + 0xe4], 0x10
je 0x406e2e
cmp word [esp + 0x110], 0x2e
je 0x406ffc
xor eax, eax
mov dword [esp + 0xa8], 7
mov dword [esp + 0xa4], edi
mov word [esp + 0x94], ax
mov byte [esp + 0x340], 7
mov eax, dword [esp + 0xc0]
lea esi, [eax - 1]
cmp eax, esi
ja 0x406cc4
call fcn.00474929
mov eax, dword [esp + 0xb0]
cmp dword [esp + 0xc4], ebp
jae 0x406cdb
lea eax, [esp + 0xb0]
cmp word [eax + esi*2], 0x5c
lea esi, [esp + 0x6c]
je 0x406d7d
lea ecx, [esp + 0xac]
push ecx
mov ebx, 0x5192e4
call fcn.00409f80
add esp, 4
push eax
lea ebx, [esp + 0x114]
lea esi, [esp + 0x40]
mov byte [esp + 0x344], 8
call fcn.00409f80
add esp, 4
push 0xffffffffffffffff
push edi
lea ecx, [esp + 0x98]
mov byte [esp + 0x348], 9
call fcn.004091e0
mov esi, 8
cmp dword [esp + 0x54], esi
jb 0x406d4a
mov edx, dword [esp + 0x40]
push edx
call fcn.0040b651
add esp, 4
mov eax, 7
xor ecx, ecx
mov byte [esp + 0x340], al
mov dword [esp + 0x54], eax
mov dword [esp + 0x50], edi
mov word [esp + 0x40], cx
cmp dword [esp + 0x84], esi
jb 0x406dd5
mov edx, dword [esp + 0x70]
push edx
call fcn.0040b651
add esp, 4
jmp 0x406dd5
lea eax, [esp + 0xac]
push eax
lea ebx, [esp + 0x114]
call fcn.00409f80
add esp, 4
push 0xffffffffffffffff
push edi
lea ecx, [esp + 0x98]
mov byte [esp + 0x348], 0xa
call fcn.004091e0
mov byte [esp + 0x340], 7
cmp dword [esp + 0x84], 8
jb 0x406dd0
mov ecx, dword [esp + 0x70]
push ecx
call fcn.0040b651
add esp, 4
lea ebx, [ebx]
mov esi, 8
mov eax, dword [esp + 0x94]
cmp dword [esp + 0xa8], esi
jae 0x406dec
lea eax, [esp + 0x94]
mov edx, dword [esp + 0x60]
push eax
push edx
lea ecx, [esp + 0x60]
call fcn.0046fb82
lea eax, [esp + 0x90]
push eax
lea eax, [esp + 0x20]
call fcn.00409020
mov byte [esp + 0x340], 3
cmp dword [esp + 0xa8], esi
jb 0x406ff7
mov ecx, dword [esp + 0x94]
push ecx
jmp 0x406fef
xor edx, edx
mov dword [esp + 0xa8], 7
mov dword [esp + 0xa4], edi
mov word [esp + 0x94], dx
mov byte [esp + 0x340], 0xb
mov eax, dword [esp + 0xc0]
lea esi, [eax - 1]
cmp eax, esi
ja 0x406e65
call fcn.00474929
mov eax, dword [esp + 0xb0]
cmp dword [esp + 0xc4], ebp
jae 0x406e7c
lea eax, [esp + 0xb0]
cmp word [eax + esi*2], 0x5c
lea esi, [esp + 0x6c]
je 0x406f16
lea eax, [esp + 0xac]
push eax
mov ebx, 0x5192e4
call fcn.00409f80
add esp, 4
push eax
lea ebx, [esp + 0x114]
lea esi, [esp + 0x40]
mov byte [esp + 0x344], 0xc
call fcn.00409f80
add esp, 4
push 0xffffffffffffffff
push edi
lea ecx, [esp + 0x98]
mov byte [esp + 0x348], 0xd
call fcn.004091e0
mov esi, 8
cmp dword [esp + 0x54], esi
jb 0x406eeb
mov ecx, dword [esp + 0x40]
push ecx
call fcn.0040b651
add esp, 4
xor edx, edx
mov dword [esp + 0x54], 7
mov dword [esp + 0x50], edi
mov word [esp + 0x40], dx
cmp dword [esp + 0x84], esi
jb 0x406f60
mov eax, dword [esp + 0x70]
push eax
call fcn.0040b651
add esp, 4
jmp 0x406f60
lea ecx, [esp + 0xac]
push ecx
lea ebx, [esp + 0x114]
call fcn.00409f80
add esp, 4
push 0xffffffffffffffff
push edi
lea ecx, [esp + 0x98]
mov byte [esp + 0x348], 0xe
call fcn.004091e0
cmp dword [esp + 0x84], 8
jb 0x406f5b
mov edx, dword [esp + 0x70]
push edx
call fcn.0040b651
add esp, 4
mov esi, 8
mov eax, dword [esp + 0x94]
cmp dword [esp + 0xa8], esi
jae 0x406f77
lea eax, [esp + 0x94]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
test al, 1
je 0x406fb0
mov ecx, dword [esp + 0x94]
and eax, 0xfffffffe
cmp dword [esp + 0xa8], esi
jae 0x406f9c
lea ecx, [esp + 0x94]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
jmp 0x406fb0
mov eax, dword [esp + 0x94]
cmp dword [esp + 0xa8], esi
jae 0x406fc7
lea eax, [esp + 0x94]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x406fd6
inc dword [esp + 0x18]
mov byte [esp + 0x340], 3
cmp dword [esp + 0xa8], esi
jb 0x406ff7
mov eax, dword [esp + 0x94]
push eax
call fcn.0040b651
add esp, 4
mov ebp, 8
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0xe4]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x406c70
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
mov eax, dword [esp + 0x38]
cmp eax, edi
je 0x40710b
mov esi, dword [esp + 0x34]
add eax, esi
cmp esi, eax
jbe 0x40703d
call fcn.0043a94b
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x8c], esi
lea esi, [esp + 0x88]
mov dword [esp + 0x88], ecx
call fcn.00409e30
push 0xffffffffffffffff
push edi
lea ecx, [esp + 0xd0]
call fcn.004091e0
push 0xffffffffffffffff
push edi
lea ecx, [esp + 0xb4]
call fcn.004091e0
push 4
mov eax, 0x5192d8
lea ecx, [esp + 0xcc]
call fcn.00409500
cmp dword [esp + 0x38], edi
je 0x4070dc
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x2c]
mov esi, dword [eax + edx*4]
cmp dword [esi + 0x18], ebp
jb 0x4070ae
mov ecx, dword [esi + 4]
push ecx
call fcn.0040b651
add esp, 4
mov dword [esi + 0x18], 7
mov dword [esi + 0x14], edi
xor edx, edx
mov word [esi + 4], dx
mov eax, dword [esp + 0x34]
inc eax
mov dword [esp + 0x34], eax
cmp dword [esp + 0x30], eax
ja 0x4070d1
mov dword [esp + 0x34], edi
sub dword [esp + 0x38], 1
jne 0x4070dc
mov dword [esp + 0x34], edi
mov eax, dword [esp + 0xcc]
cmp dword [esp + 0xe0], ebp
jae 0x4070f3
lea eax, [esp + 0xcc]
lea ecx, [esp + 0xe4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [esp + 0x14], eax
jmp 0x406c70
call fcn.0041075a
xor ecx, ecx
cmp eax, edi
setne cl
cmp ecx, edi
jne 0x407125
push 0x80004005
call fcn.00404ef0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [esp + 0x14], esi
mov byte [esp + 0x340], 0xf
mov edi, dword [esp + 0x60]
add edi, 0xffffffff
js 0x407191
mov ebx, dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
test edi, edi
jl 0x40725a
cmp edi, dword [esp + 0x60]
jge 0x40725a
mov ecx, dword [esp + 0x5c]
lea eax, [ecx + edi*4]
push eax
lea ecx, [esp + 0x18]
call fcn.00404840
mov esi, dword [esp + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
test al, 1
je 0x407189
and eax, 0xfffffffe
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push esi
call ebx
sub edi, 1
jns 0x40714c
lea eax, [esi - 0x10]
mov byte [esp + 0x340], 3
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4071b5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x58]
mov byte [esp + 0x340], 2
call fcn.0046fa37
lea esi, [esp + 0x1c]
call fcn.00409290
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.0040b651
add esp, 4
cmp dword [esp + 0xe0], ebp
jb 0x4071f5
mov edx, dword [esp + 0xcc]
push edx
call fcn.0040b651
add esp, 4
xor eax, eax
mov dword [esp + 0xe0], 7
mov dword [esp + 0xdc], 0
mov word [esp + 0xcc], ax
cmp dword [esp + 0xc4], ebp
jb 0x40722e
mov ecx, dword [esp + 0xb0]
push ecx
call fcn.0040b651
add esp, 4
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x338]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x320]
xor ecx, esp
call fcn.00431c7a
add esp, 0x330
ret
call fcn.004106aa
int3