Function at 0x40e7a0
Capabilities:
Delete directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4bfc7d
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x509074]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [edi]
or ebx, 0xffffffff
cmp dword [eax - 0xc], 0x104
jl 0x40e9eb
call fcn.0040eb90
test al, al
jne 0x40e9eb
call fcn.004043d0
mov ecx, eax
test ecx, ecx
je 0x40ea01
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x14]
push 0x4e0724
call fcn.00403470
test al, al
jne 0x40e82a
push 4
push 0x4e0724
lea ecx, [ebp - 0x14]
call fcn.004035e0
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x14]
mov eax, dword [edi]
push dword [eax - 0xc]
push eax
call fcn.00402420
mov esi, dword [ebp - 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
cmp eax, 1
sete byte [ebp - 0xd]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x40e86e
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov al, byte [ebp - 0xd]
test al, al
jne 0x40e9d6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x18], eax
call fcn.00429860
mov dword [ebp - 0x1c], eax
call fcn.004043d0
test eax, eax
je 0x40ea01
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], 5
lea ecx, [ebp - 0x14]
push 0x1c
push str.Failed_to_delete_directory:
call fcn.00402420
mov edx, dword [edi]
test edx, edx
je 0x40e8de
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40e8c5
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x14]
call fcn.00402420
push 0xc
push str._LastError
lea ecx, [ebp - 0x14]
call fcn.00402420
mov edi, dword [ebp - 0x18]
lea ecx, [ebp - 0x14]
push edi
call fcn.00429320
mov esi, eax
push 1
push 0x4e2638
mov ecx, esi
call fcn.00402420
push 0
mov edx, edi
lea ecx, [ebp - 0x20]
call fcn.0040dc20
add esp, 4
mov byte [ebp - 4], 6
mov edx, dword [eax]
test edx, edx
je 0x40e93f
mov ecx, edx
lea edi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40e927
sub ecx, edi
sar ecx, 1
push ecx
push edx
mov ecx, esi
call fcn.00402420
call fcn.004043d0
test eax, eax
je 0x40ea01
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x18], eax
mov byte [ebp - 4], 9
lea ecx, [ebp - 0x18]
push 0
push 0x4e2418
call fcn.00402420
push ecx
push esi
push ecx
mov ecx, dword [ebp - 0x1c]
lea eax, [ebp - 0x18]
push eax
call fcn.00429ba0
mov byte [ebp - 4], 6
mov eax, ebx
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40e999
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 5
mov eax, ebx
mov edx, dword [ebp - 0x20]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40e9b7
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x14]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x40e9d6
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov al, byte [ebp - 0xd]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push dword [edi]
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
cmp eax, 1
sete al
mov byte [ebp - 0xd], al
jmp 0x40e871
push 0x80004005
call fcn.00402570
int3