Function at 0x406ecb
Capabilities:
Check if file exists
Enumerate files on windows
Enumerate files recursively
Get file attributes
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
push edi
push 0x29c
mov byte [ebp - 1], 1
call fcn.0040582b
mov esi, eax
xor ebx, ebx
cmp esi, ebx
je 0x4070e6
lea eax, [esi + 0x3c]
push eax
call fcn.004045de
push esi
call fcn.004045de
mov edi, dword [ebp + 8]
mov eax, dword [edi + 4]
mov dword [esi + 4], eax
mov eax, dword [edi + 8]
cmp eax, 9
mov dword [esi + 8], eax
jb 0x406f2a
push 8
push str.file:___
push esi
call fcn.00404693
test eax, eax
jne 0x406f2a
add dword [esi + 4], 0x10
add dword [esi + 8], 0xfffffff8
cmp dword [ebp + 0x10], ebx
jne 0x407003
test byte [ebp + 0xd], 1
je 0x406fa4
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x407003
test al, 0x10
je 0x407003
mov eax, dword [esi + 8]
add eax, 3
push eax
lea eax, [ebp - 0x28]
push eax
call fcn.0040460d
test eax, eax
je 0x4070e0
mov eax, dword [esi + 8]
cmp eax, ebx
jbe 0x406f8e
mov ecx, dword [esi + 4]
mov ax, word [ecx + eax*2 - 2]
cmp ax, 0x5c
je 0x406f86
cmp ax, 0x2f
jne 0x406f8e
push esi
push 0x40ac30
jmp 0x406f94
push esi
push 0x40ac24
push dword [ebp - 0x24]
call fcn.004052d2
add esp, 0xc
mov dword [ebp - 0x20], eax
jmp 0x406ff7
test byte [ebp + 0xc], 0xc
jne 0x406fb4
mov eax, dword [ebp + 0xc]
and eax, 3
cmp al, 2
jne 0x407003
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x407003
test al, 0x10
je 0x407003
lea eax, [ebp - 0x28]
push eax
call fcn.004045de
lea eax, [ebp - 0x28]
push ebx
push eax
push 1
push esi
call fcn.00406871
test eax, eax
je 0x4070e0
lea eax, [ebp - 0x28]
push eax
call fcn.00406e79
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x24]
mov word [ecx + eax*2], bx
lea eax, [ebp - 0x28]
push 0x10
push eax
push esi
call fcn.00404504
mov eax, dword [esi + 8]
and byte [ebp + 0xb], 0
cmp eax, ebx
mov dword [esi + 0x38], eax
jbe 0x40704d
dec dword [esi + 0x38]
mov eax, dword [esi + 0x38]
mov ecx, dword [esi + 4]
mov cx, word [ecx + eax*2]
cmp cx, 0x5c
je 0x407045
cmp cx, 0x2f
je 0x407045
cmp eax, 1
jne 0x407039
push esi
call fcn.00406013
test eax, eax
jne 0x407040
cmp dword [esi + 0x38], ebx
ja 0x407011
jmp 0x40704d
inc dword [esi + 0x38]
jmp 0x407049
inc eax
mov dword [esi + 0x38], eax
mov byte [ebp + 0xb], 1
mov eax, dword [ebp + 0xc]
mov dword [esi + 0x30], 1
and eax, 0xc
mov dword [ebp - 0x10], eax
je 0x407066
mov dword [esi + 0x30], 2
lea edi, [esi + 0x10]
push edi
call fcn.004045de
cmp byte [ebp + 0xb], 0
lea eax, [ebp - 0x28]
je 0x4070ed
push eax
call fcn.004045de
mov eax, dword [esi + 4]
mov dword [ebp - 0x24], eax
mov eax, dword [esi + 0x38]
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x28]
push eax
call fcn.00406e79
push ebx
push edi
lea eax, [ebp - 0x28]
push 1
push eax
call fcn.00406871
test eax, eax
je 0x4070da
mov eax, dword [esi + 0x18]
and byte [ebp - 4], 0
cmp eax, ebx
jbe 0x4070c7
mov ecx, dword [esi + 0x14]
mov cx, word [ecx + eax*2 - 2]
cmp cx, 0x5c
je 0x4070c3
cmp cx, 0x2f
jne 0x4070c7
mov byte [ebp - 4], 1
add eax, 0x106
lea ecx, [esi + 0x20]
push eax
push ecx
call fcn.0040460d
test eax, eax
jne 0x4070fa
push esi
call fcn.004045f2
push esi
call fcn.00405841
xor eax, eax
jmp 0x407279
push 0x40ac20
push eax
call fcn.0040463a
jmp 0x407093
cmp dword [esi + 0x30], ebx
mov dword [esi + 0x34], ebx
jbe 0x407257
jmp 0x40710a
xor ebx, ebx
and byte [ebp - 2], 0
cmp dword [ebp - 0x10], 0xc
je 0x407126
test byte [ebp + 0xc], 4
je 0x407120
cmp dword [esi + 0x34], 1
jmp 0x407129
test byte [ebp + 0xc], 8
je 0x407164
cmp dword [esi + 0x34], ebx
jne 0x407164
test byte [ebp + 0xc], 0x10
mov byte [ebp - 2], 1
je 0x407164
lea eax, [esi + 0x10]
push eax
push 0x40ac24
push dword [esi + 0x2c]
push dword [esi + 0x24]
call fcn.004052bb
add esp, 0x10
lea edi, [esi + 0x4c]
mov dword [esi + 0x28], eax
push edi
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [ebp - 0xc], eax
jmp 0x40722d
cmp byte [ebp + 0xb], 0
je 0x4071aa
mov eax, dword [esi + 0x38]
cmp eax, dword [esi + 8]
jne 0x40718b
lea eax, [esi + 0x10]
push eax
push 0x40aae4
push dword [esi + 0x2c]
push dword [esi + 0x24]
call fcn.004052bb
add esp, 0x10
jmp 0x4071cf
mov ecx, dword [esi + 4]
cmp byte [ebp - 4], 0
lea eax, [ecx + eax*2]
push eax
lea eax, [esi + 0x10]
push eax
je 0x4071a3
push str._y_s
jmp 0x4071c1
push 0x40ac08
jmp 0x4071c1
cmp byte [ebp - 4], 0
lea eax, [esi + 0x10]
push esi
push eax
je 0x4071bc
push str._y_y
jmp 0x4071c1
push 0x40aaec
push dword [esi + 0x2c]
push dword [esi + 0x24]
call fcn.004052bb
add esp, 0x14
lea edi, [esi + 0x4c]
mov dword [esi + 0x28], eax
push edi
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
jne 0x407280
cmp dword [esi + 0x28], 3
jne 0x4071fe
lea eax, [esi + 0x20]
push eax
call fcn.0040604c
test eax, eax
jne 0x407211
cmp dword [esi + 0x28], 7
jne 0x407233
lea eax, [esi + 0x20]
push eax
call fcn.004060b8
test eax, eax
je 0x407233
push ebx
push dword [esi + 0x24]
push edi
call fcn.00407743
test eax, eax
je 0x407233
mov word [esi + 0x78], bx
mov word [esi + 0x280], bx
mov dword [ebp - 0xc], ebx
cmp dword [ebp - 0xc], 0xffffffff
jne 0x407280
cmp dword [ebp + 0x18], ebx
je 0x4074c8
push dword [ebp + 0x1c]
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esi + 0x20]
push eax
call dword [ebp + 0x18]
test eax, eax
jne 0x407257
and byte [ebp - 1], al
push esi
call fcn.004045f2
lea eax, [esi + 0x10]
push eax
call fcn.004045f2
lea eax, [esi + 0x20]
push eax
call fcn.004045f2
push esi
call fcn.00405841
movzx eax, byte [ebp - 1]
pop edi
pop esi
pop ebx
leave
ret 0x18
mov eax, dword [ebp + 0xc]
and eax, 0x40
mov dword [ebp - 0x14], eax
and byte [ebp - 5], 0
lea ebx, [esi + 0x78]
push 0x40ac20
push ebx
mov byte [ebp - 3], 1
call fcn.00407fc6
test eax, eax
je 0x4072b2
push 0x40abf4
push ebx
call fcn.00407fc6
test eax, eax
jne 0x4072c0
test byte [ebp + 0xc], 0x80
jne 0x4072bc
and byte [ebp - 3], 0
mov byte [ebp - 5], 1
mov edi, dword [edi]
mov edx, edi
and edx, 0x10
je 0x4072cf
test byte [ebp + 0xc], 2
jmp 0x4072d3
test byte [ebp + 0xc], 1
jne 0x4072d9
and byte [ebp - 3], 0
xor cl, cl
cmp dword [ebp - 0x14], 0
je 0x4072fc
test edi, 0x400
je 0x4072fc
mov eax, dword [esi + 0x70]
cmp eax, 0xa0000003
je 0x4072fa
cmp eax, 0xa000000c
jne 0x4072fc
mov cl, 1
cmp byte [ebp - 5], 0
jne 0x407416
test edx, edx
je 0x407416
cmp byte [ebp - 2], 0
je 0x407416
test cl, cl
jne 0x407416
lea eax, [esi + 0x78]
push eax
call fcn.00407f73
mov edi, eax
mov eax, dword [ebp + 0xc]
push 2
and eax, 0x10
pop ebx
mov dword [ebp - 0x18], eax
je 0x40733f
mov ebx, dword [esi + 8]
sub ebx, dword [esi + 0x38]
mov eax, dword [esi + 0x38]
add eax, ebx
lea eax, [eax + edi + 2]
push eax
lea eax, [esi + 0x3c]
push eax
call fcn.0040460d
test eax, eax
je 0x40749c
cmp byte [ebp + 0xb], 0
je 0x407377
mov eax, dword [esi + 0x38]
add eax, eax
push eax
push dword [esi + 4]
push dword [esi + 0x40]
call fcn.00404504
mov eax, dword [esi + 0x38]
mov dword [esi + 0x44], eax
mov ecx, dword [esi + 0x40]
lea eax, [edi + edi]
push eax
lea eax, [esi + 0x78]
push eax
mov eax, dword [esi + 0x44]
lea eax, [ecx + eax*2]
push eax
call fcn.00404504
add dword [esi + 0x44], edi
mov eax, dword [esi + 0x44]
mov ecx, dword [esi + 0x40]
mov word [ecx + eax*2], 0x5c
inc dword [esi + 0x44]
cmp dword [ebp - 0x18], 0
mov eax, dword [esi + 0x44]
je 0x4073d7
cmp byte [ebp + 0xb], 0
je 0x4073bb
mov ecx, dword [esi + 0x38]
mov edx, dword [esi + 4]
lea ecx, [edx + ecx*2]
push ecx
jmp 0x4073be
push dword [esi + 4]
mov ecx, dword [esi + 0x40]
push 0x40a8e8
lea eax, [ecx + eax*2]
push eax
call fcn.004052d2
add esp, 0xc
add dword [esi + 0x44], ebx
jmp 0x4073ee
mov ecx, dword [esi + 0x40]
mov word [ecx + eax*2], 0x2a
inc dword [esi + 0x44]
mov eax, dword [esi + 0x44]
mov ecx, dword [esi + 0x40]
and word [ecx + eax*2], 0
push dword [ebp + 0x1c]
mov eax, dword [ebp + 0x10]
inc eax
lea edi, [esi + 0x3c]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
push eax
push dword [ebp + 0xc]
push edi
call fcn.00406ecb
test eax, eax
je 0x40749c
push edi
call fcn.004045f2
cmp byte [ebp - 3], 0
je 0x407479
cmp byte [ebp - 2], 0
jne 0x407479
cmp byte [ebp + 0xb], 0
je 0x407430
mov eax, dword [esi + 0x38]
cmp eax, dword [esi + 8]
je 0x40745b
cmp byte [ebp - 4], 0
lea eax, [esi + 0x78]
push eax
lea eax, [esi + 0x10]
push eax
je 0x407445
push str._y_s
jmp 0x40744a
push 0x40ac08
push dword [esi + 0x2c]
push dword [esi + 0x24]
call fcn.004052bb
add esp, 0x14
mov dword [esi + 0x28], eax
push dword [ebp + 0x1c]
lea eax, [esi + 0x4c]
push dword [ebp + 0x10]
push eax
lea eax, [esi + 0x20]
push eax
call dword [ebp + 0x14]
test eax, eax
je 0x40749c
call fcn.00407f20
test eax, eax
jne 0x40749c
cmp dword [ebp - 0xc], 0xffffffff
je 0x4074a0
cmp dword [ebp - 0xc], 0
je 0x4074a0
lea edi, [esi + 0x4c]
push edi
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x407289
jmp 0x4074a0
and byte [ebp - 1], 0
lea eax, [esi + 0x3c]
push eax
call fcn.004045f2
cmp dword [ebp - 0xc], 0
je 0x4074be
cmp dword [ebp - 0xc], 0xffffffff
je 0x4074be
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp byte [ebp - 1], 0
je 0x407257
inc dword [esi + 0x34]
mov eax, dword [esi + 0x34]
cmp eax, dword [esi + 0x30]
jb 0x407108
jmp 0x407257