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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5ebee0
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x66dd68]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
call fcn.00408985
xor ecx, ecx
xor ebx, ebx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x405806
push 0x80004005
call fcn.00402920
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x1c], eax
push edi
lea ecx, [ebp - 0x14]
mov dword [ebp - 4], ebx
mov dword [ebp - 0x24], ebx
call fcn.00402b60
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x14]
mov ecx, dword [edx - 0xc]
cmp ecx, ebx
jge 0x40583c
push 0x80070057
call fcn.00402920
mov eax, dword [edx - 8]
mov esi, 1
sub esi, dword [edx - 4]
sub eax, ecx
or eax, esi
jge 0x405859
push ecx
lea ecx, [ebp - 0x14]
call fcn.004027d0
mov edx, dword [ebp - 0x14]
push edx
call dword [sym.imp.SHLWAPI.dll_PathStripToRootW]
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.0059e180
add esp, 8
cmp eax, ebx
jl 0x405832
mov ecx, dword [ebp - 0x14]
cmp eax, dword [ecx - 8]
jg 0x405832
mov dword [ecx - 0xc], eax
mov edx, dword [ebp - 0x14]
xor ecx, ecx
mov word [edx + eax*2], cx
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push edi
lea ecx, [ebp - 0x10]
call fcn.00402b60
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx - 0xc]
inc edx
cmp edx, ebx
jge 0x4058b4
push 0x80070057
call fcn.00402920
mov eax, dword [ecx - 8]
mov esi, 1
sub esi, dword [ecx - 4]
sub eax, edx
or eax, esi
jge 0x4058d1
push edx
lea ecx, [ebp - 0x10]
call fcn.004027d0
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.0059e180
add esp, 8
cmp eax, ebx
jl 0x405832
mov ecx, dword [ebp - 0x10]
cmp eax, dword [ecx - 8]
jg 0x405832
mov dword [ecx - 0xc], eax
mov edx, dword [ebp - 0x10]
xor ecx, ecx
mov word [edx + eax*2], cx
mov eax, dword [ebp - 0x10]
push eax
lea ecx, [ebp - 0x18]
call fcn.00402b60
mov byte [ebp - 4], 3
mov dword [ebp - 0x20], ebx
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x405986
test al, 0x10
je 0x405986
mov edx, dword [ebp - 0x18]
push 0x80
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
test eax, eax
je 0x405957
mov dword [ebp - 0x24], 1
jmp 0x405a0e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x18]
push eax
push ecx
lea edx, [ebp - 0x1c]
push str.Unable_to_remove_Directory__s__Error:__u
push edx
call fcn.00402120
add esp, 0xc
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x28], esp
mov ecx, esp
push eax
call fcn.00401f30
jmp 0x405a06
mov ecx, dword [ebp - 0x18]
push ecx
lea edx, [ebp - 0x1c]
push str.Directory__s_does_NOT_exist_
push edx
call fcn.00402120
mov esi, dword [ebp - 0x1c]
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
mov edx, dword [eax + 0x10]
add esp, 8
mov dword [ebp - 0x28], esp
mov ebx, esp
call edx
cmp dword [esi - 4], 0
lea ecx, [esi - 4]
jl 0x4059c9
cmp eax, dword [esi - 0x10]
jne 0x4059c9
lea edi, [esi - 0x10]
mov eax, 1
lock xadd dword [ecx], eax
jmp 0x405a01
mov ecx, dword [esi - 0xc]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
je 0x405b53
mov eax, dword [esi - 0xc]
mov dword [edi + 4], eax
mov eax, dword [esi - 0xc]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [edi + 0x10]
push eax
call fcn.0059da05
add esp, 0x10
add edi, 0x10
mov dword [ebx], edi
call fcn.004011e0
add esp, 4
mov ecx, dword [ebp - 0x10]
mov esi, dword [ecx - 0xc]
add esi, 3
js 0x405832
mov eax, dword [ecx - 8]
mov edx, 1
sub edx, dword [ecx - 4]
sub eax, esi
or eax, edx
jge 0x405a3a
push esi
lea ecx, [ebp - 0x10]
call fcn.004027d0
mov ecx, dword [ebp - 0x10]
push 0x6312c0
push ecx
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.0059e180
add esp, 8
test eax, eax
js 0x405832
mov ecx, dword [ebp - 0x10]
cmp eax, dword [ecx - 8]
jg 0x405832
mov dword [ecx - 0xc], eax
mov edx, dword [ebp - 0x10]
xor ecx, ecx
mov word [edx + eax*2], cx
mov edx, dword [ebp - 0x10]
test edx, edx
jne 0x405a81
xor eax, eax
jmp 0x405a95
mov eax, edx
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405a86
sub eax, esi
sar eax, 1
push eax
push edx
lea ecx, [ebp - 0x18]
call fcn.004029a0
mov eax, dword [ebp - 0x20]
inc eax
mov dword [ebp - 0x20], eax
cmp eax, 2
jl 0x40591b
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405ad2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405af5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405b18
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
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 0x405b3e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.00402760
int3