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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x478
mov eax, dword [0x4b1040]
xor eax, ebp
mov dword [ebp - 4], eax
or dword [ebp - 0x468], 0xffffffff
lea eax, [ebp - 0x460]
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
xor edi, edi
push 0x250
push edi
push eax
mov dword [ebp - 0x464], edi
call fcn.00452250
mov esi, dword [ebp + 0xc]
lea eax, [ebp - 0x210]
push 0x20a
push edi
and esi, 1
push eax
mov dword [ebp - 0x474], esi
call fcn.00452250
add esp, 0x18
mov dword [ebp - 0x470], edi
mov dword [ebp - 0x46c], edi
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0x478], eax
cmp eax, 0xffffffff
jne 0x401e6c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x401e16
movzx esi, si
or esi, 0x80070000
test esi, esi
js 0x401e1f
mov esi, 0x80004005
jmp 0x401e36
mov eax, 0x80070003
cmp esi, eax
je 0x401e30
cmp esi, 0x80070002
jne 0x401e32
mov esi, edi
test esi, esi
jns 0x401e65
push esi
push 0xbd
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutildirutil.cpp
push edi
call fcn.0040129e
push ebx
push str.Failed_to_get_attributes_for_path:__ls
push esi
push 0xe
push 5
push 0xbd
push edi
call fcn.004012a1
add esp, 0x1c
jmp 0x4023cd
mov esi, eax
jmp 0x4023cd
test al, 0x10
je 0x40238c
test al, 1
je 0x401eeb
push 0x80
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test eax, eax
jne 0x401ee5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x401e9f
movzx esi, si
or esi, 0x80070000
test esi, esi
js 0x401ea8
mov esi, 0x80004005
jmp 0x401ebf
mov eax, 0x80070003
cmp esi, eax
je 0x401eb9
cmp esi, 0x80070002
jne 0x401ebb
mov esi, edi
test esi, esi
jns 0x401e65
push esi
push 0xc8
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutildirutil.cpp
push edi
call fcn.0040129e
push ebx
push str.Failed_to_remove_read_only_attribute_from_path:__ls
push esi
push 0xe
push 5
push 0xc8
jmp 0x401e57
mov eax, dword [ebp - 0x478]
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutildirutil.cpp
test esi, esi
jne 0x401efe
test byte [ebp + 0xc], 2
je 0x4022f9
test eax, 0x400
jne 0x4022f9
test byte [ebp + 0xc], 4
je 0x401f44
push 0
lea eax, [ebp - 0x470]
push eax
call fcn.00406d9a
mov esi, eax
test esi, esi
jns 0x401f44
push str.Failed_to_get_temp_directory.
push esi
push 0xe
push 5
push 0xd4
push str.d:_awixwix_srclibsdutilwixtoolset.dutildirutil.cpp
call fcn.004012a1
add esp, 0x18
jmp 0x4023cd
lea eax, [ebp - 0x464]
push eax
push 0x477d34
push ebx
call fcn.00405d77
mov esi, eax
test esi, esi
jns 0x401f76
push ebx
push str.Failed_to_concat_wild_cards_to_string:__ls
push esi
push 0xe
push 5
push 0xd9
push str.d:_awixwix_srclibsdutilwixtoolset.dutildirutil.cpp
jmp 0x401e58
lea eax, [ebp - 0x460]
push eax
push dword [ebp - 0x464]
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [ebp - 0x468], eax
cmp eax, 0xffffffff
jne 0x401fd8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x401fab
movzx esi, si
or esi, 0x80070000
test esi, esi
js 0x401fb2
mov esi, 0x80004005
push esi
push 0xde
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutildirutil.cpp
push edi
call fcn.0040129e
push ebx
push str.failed_to_get_first_file_in_directory:__ls
push esi
push 0xe
push 5
push 0xde
jmp 0x401e57
push 0x2e
pop edx
cmp dx, word [ebp - 0x434]
jne 0x402009
xor ecx, ecx
cmp cx, word [ebp - 0x432]
je 0x4021d3
cmp dx, word [ebp - 0x432]
jne 0x402009
cmp cx, word [ebp - 0x430]
je 0x4021d3
push 0xa00
push 0
push 0
push 0x104
lea eax, [ebp - 0x434]
push eax
push 0x105
lea eax, [ebp - 0x210]
push eax
call fcn.00401a1d
mov esi, eax
test esi, esi
js 0x4022dc
lea eax, [ebp - 0x464]
push eax
lea eax, [ebp - 0x210]
push eax
push ebx
call fcn.00405d77
mov esi, eax
test esi, esi
js 0x4022b7
test byte [ebp + 0xc], 2
je 0x4020c0
test byte [ebp - 0x460], 0x10
je 0x4020c0
lea eax, [ebp - 0x464]
push eax
call fcn.00405cbf
mov esi, eax
test esi, esi
js 0x4021f4
push dword [ebp + 0xc]
push dword [ebp - 0x464]
call fcn.00401d86
test eax, eax
jns 0x4021cd
cmp eax, 0x80070003
je 0x4021cd
push dword [ebp - 0x464]
push str.Failed_to_delete_subdirectory__continuing:__ls
push eax
push 0xe
push 5
push 0xfb
push edi
call fcn.004012a1
add esp, 0x1c
jmp 0x4021cd
cmp dword [ebp - 0x474], 0
je 0x4021cd
test byte [ebp - 0x460], 7
je 0x402127
push 0x80
push dword [ebp - 0x464]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test eax, eax
jne 0x402127
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x402102
movzx esi, si
or esi, 0x80070000
test esi, esi
jns 0x40220e
cmp esi, 0x80070003
je 0x402118
cmp esi, 0x80070002
jne 0x40211a
xor esi, esi
test esi, esi
js 0x402213
jmp 0x4021cd
push dword [ebp - 0x464]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x4021cd
test byte [ebp + 0xc], 4
je 0x402196
lea eax, [ebp - 0x46c]
push eax
push 0
push 0x477e88
push dword [ebp - 0x470]
call fcn.00406b4c
mov esi, eax
test esi, esi
js 0x402236
push 1
push dword [ebp - 0x46c]
push dword [ebp - 0x464]
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
push 4
push 0
test eax, eax
je 0x40218e
push dword [ebp - 0x46c]
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
jmp 0x4021cd
push dword [ebp - 0x464]
jmp 0x402186
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x4021ad
movzx esi, si
or esi, 0x80070000
test esi, esi
jns 0x40224a
cmp esi, 0x80070003
je 0x4021c3
cmp esi, 0x80070002
jne 0x4021c5
xor esi, esi
test esi, esi
js 0x40224f
mov eax, dword [ebp - 0x468]
lea ecx, [ebp - 0x460]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
je 0x402269
mov eax, dword [ebp - 0x468]
jmp 0x401fd8
push dword [ebp - 0x464]
push str.Failed_to_ensure_path_is_backslash_terminated:__ls
push esi
push 0xe
push 5
push 0xf3
jmp 0x4023b2
mov esi, 0x80004005
push esi
mov ebx, 0x106
push ebx
push edi
call fcn.0040129e
push dword [ebp - 0x464]
push str.Failed_to_remove_attributes_from_file:__ls
push esi
push 0xe
push 5
push ebx
jmp 0x4023b2
push str.Failed_to_get_temp_file_to_move_to.
push esi
push 0xe
push 5
push pe_nt_image_headers32
jmp 0x4022eb
mov esi, 0x80004005
push esi
mov ebx, 0x11f
push ebx
push edi
call fcn.0040129e
push dword [ebp - 0x464]
push str.Failed_to_delete_file:__ls
jmp 0x40222b
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12
je 0x4022f9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40228f
movzx esi, si
or esi, 0x80070000
test esi, esi
js 0x402296
mov esi, 0x80004005
push esi
push 0x12c
push edi
call fcn.0040129e
push ebx
push str.Failed_while_looping_through_files_in_directory:__ls
push esi
push 0xe
push 5
push 0x12c
jmp 0x4023b2
push ebx
lea eax, [ebp - 0x210]
push eax
push str.Failed_to_concat_filename__ls_to_directory:__ls
push esi
push 0xe
push 5
push 0xee
push edi
call fcn.004012a1
add esp, 0x20
jmp 0x4023bb
push str.Failed_to_ensure_file_name_was_null_terminated.
push esi
push 0xe
push 5
push 0xeb
push edi
call fcn.004012a1
add esp, 0x18
jmp 0x4023bb
push ebx
xor esi, esi
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
test eax, eax
jne 0x4023bb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40231f
movzx esi, si
or esi, 0x80070000
cmp esi, 0x80070020
jne 0x40233e
test byte [ebp + 0xc], 4
je 0x40236a
push 4
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x40236a
xor esi, esi
mov eax, 0x80070003
cmp esi, eax
je 0x402388
cmp esi, 0x80070002
je 0x402388
cmp esi, 0x80070091
jne 0x402366
cmp dword [ebp - 0x474], 0
jne 0x40236a
test byte [ebp + 0xc], 2
je 0x4023bb
test esi, esi
jns 0x4023bb
push esi
push 0x144
push edi
call fcn.0040129e
push ebx
push str.Failed_to_remove_directory:__ls
push esi
push 0xe
push 5
push 0x144
jmp 0x4023b2
mov esi, eax
jmp 0x4023bb
mov esi, 0x8000ffff
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutildirutil.cpp
push esi
push 0x149
push edi
call fcn.0040129e
push ebx
push str.Directory_delete_cannot_delete_file:__ls
push esi
push 0xe
push 5
push 0x149
push edi
call fcn.004012a1
add esp, 0x1c
mov eax, dword [ebp - 0x468]
cmp eax, 0xffffffff
je 0x4023cd
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp dword [ebp - 0x464], 0
je 0x4023e1
push dword [ebp - 0x464]
call fcn.00404128
cmp dword [ebp - 0x470], 0
je 0x4023f5
push dword [ebp - 0x470]
call fcn.00404128
cmp dword [ebp - 0x46c], 0
je 0x402409
push dword [ebp - 0x46c]
call fcn.00404128
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00451586
leave
ret 8