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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe8
push ebx
xor edx, edx
mov dword [ebp - 0x18], edx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x59d4f9
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c8]
cmp byte [eax + 0x21], 0
je 0x59d4db
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c8]
cmp byte [eax + 0x21], 1
jne 0x59d3f7
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x674]
call fcn.00404ff0
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x674], edx
mov eax, dword [ebp - 4]
call fcn.0059d16c
mov eax, dword [ebp - 4]
lea ecx, [eax + 0x698]
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0x134]
add edx, 2
mov eax, dword [ebp - 4]
call fcn.0058fc3c
mov eax, dword [ebp - 4]
cmp dword [eax + 0x698], 0
jne 0x59d319
lea edx, [ebp - 0x18]
mov eax, 0xbb
call fcn.0041e6b8
mov ecx, dword [ebp - 0x18]
mov dl, 1
mov eax, dword [0x583bd8]
call fcn.0042388c
call fcn.00406160
mov eax, dword [ebp - 4]
inc dword [eax + 0x134]
mov dl, 1
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x698]
call fcn.0041ea28
test al, al
je 0x59d3b2
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x698]
call fcn.0040774c
push eax
call sub.kernel32.dll_DeleteFileW
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 9], al
cmp byte [ebp - 9], 0
jne 0x59d3b2
call sub.kernel32.dll_GetLastError_1
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x698]
call fcn.0040774c
push eax
call sub.kernel32.dll_GetFileAttributesW
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
je 0x59d3a9
test byte [ebp - 0xf], 4
je 0x59d3a9
test byte [ebp - 0x10], 0x10
je 0x59d3a9
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x698]
call fcn.0040774c
push eax
call sub.kernel32.dll_RemoveDirectoryW
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 9], al
jmp 0x59d3b2
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_SetLastError
mov eax, dword [ebp - 4]
cmp word [eax + 0x622], 0
je 0x59d3db
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x134]
inc ecx
mov ebx, dword [ebp - 4]
mov edx, dword [ebp - 4]
mov eax, dword [ebx + 0x624]
call dword [ebx + 0x620]
mov eax, dword [ebp - 4]
call fcn.0059d098
mov ecx, dword [ebp - 4]
mov dword [ecx + 0x650], eax
mov dword [ecx + 0x654], edx
jmp 0x59d47d
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x674]
call fcn.00404ff0
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x674], edx
lea eax, [ebp - 8]
mov edx, dword [ebp - 4]
mov edx, dword [edx + 0x698]
call fcn.00406e84
mov eax, dword [ebp - 4]
add eax, 0x698
mov edx, dword [ebp - 4]
mov edx, dword [edx + 0x1b0]
call fcn.00406e3c
push 1
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x134]
add ecx, 2
mov eax, dword [ebp - 4]
lea edx, [eax + 0x698]
mov eax, dword [ebp - 4]
call fcn.0058fdf4
mov eax, dword [ebp - 4]
inc dword [eax + 0x134]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c8]
mov edx, dword [ebp - 4]
mov ecx, dword [eax + 8]
mov dword [edx + 0x650], ecx
mov ecx, dword [eax + 0xc]
mov dword [edx + 0x654], ecx
push 0xff00
mov eax, dword [ebp - 4]
mov al, byte [eax + 0x10d]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x110]
push eax
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x698]
mov dl, 1
mov eax, dword [0x575fb4]
call fcn.00576648
mov edx, dword [ebp - 4]
mov dword [edx + 0x674], eax
mov eax, dword [ebp - 4]
mov dword [eax + 0x648], 0
mov dword [eax + 0x64c], 0
xor edx, edx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x690]
call fcn.005756ac
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x59d500
lea eax, [ebp - 0x18]
call fcn.00406a5c
lea eax, [ebp - 8]
call fcn.00406a5c
ret