Function at 0x1002589
Capabilities:
Check if file exists
Enumerate files on windows
Enumerate files recursively
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x25c
push ebx
push esi
push edi
push dword [ebp + 0xc]
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
call edi
test eax, eax
jne 0x1002688
mov edi, dword [ebp + 8]
xor ebx, ebx
push edi
mov dword [ebp + 0xc], ebx
call fcn.010016fc
mov esi, eax
cmp esi, 0xffffffff
jne 0x10025f1
cmp byte [0x1004024], bl
je 0x10025cd
cmp byte [0x1004021], bl
jne 0x10025dc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
call fcn.0100141f
pop ecx
pop ecx
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
cmp byte [0x1004021], bl
jmp 0x10028fb
push edi
push 0xd
call fcn.01001396
pop ecx
pop ecx
push ebx
lea eax, [ebp + 8]
push eax
push ebx
push ebx
push 2
lea eax, [ebp + 0xc]
push eax
push 0x9c040
push esi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x1002652
cmp byte [0x1004024], bl
je 0x1002628
cmp byte [0x1004021], bl
jne 0x1002630
push 2
call fcn.01001396
pop ecx
cmp byte [0x1004024], bl
jne 0x100264f
cmp byte [0x1004021], bl
jne 0x100264f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
call fcn.0100141f
pop ecx
pop ecx
push esi
jmp 0x10025de
cmp byte [0x1004024], bl
jne 0x1002662
push 1
call fcn.01001396
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
add dword [0x1004248], 1
adc dword [0x100424c], ebx
add dword [0x1004a70], 1
adc dword [0x1004a74], ebx
jmp 0x10028db
mov ebx, dword [ebp + 8]
push ebx
call edi
lea esi, [ebx + eax*2]
push ebx
mov dword [ebp - 8], esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x10026b4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
call fcn.0100141f
pop ecx
pop ecx
jmp 0x10028f3
test ah, 8
push ebx
je 0x10026be
push 0xe
jmp 0x10026c0
push 0xf
call fcn.01001396
add dword [0x1004248], 1
pop ecx
pop ecx
adc dword [0x100424c], 0
push dword [ebp + 0xc]
sub esi, ebx
sar esi, 1
call edi
add eax, esi
mov ebx, 0x104
cmp eax, ebx
jge 0x10027f3
push dword [ebp + 0xc]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
lea eax, [ebp - 0x25c]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
je 0x10027f3
push 0x100112c
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
test eax, eax
je 0x10027d2
push 0x1001190
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
test eax, eax
je 0x10027d2
lea eax, [ebp - 0x230]
push eax
call edi
add eax, esi
cmp eax, ebx
jge 0x10027d2
lea eax, [ebp - 0x230]
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push dword [ebp + 8]
call fcn.010016fc
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
jne 0x10027b4
cmp byte [0x1004024], 0
je 0x100278a
cmp byte [0x1004021], 0
jne 0x10027d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp + 8]
call fcn.0100141f
cmp byte [0x1004021], 0
pop ecx
pop ecx
jne 0x10027d2
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FindClose]
xor al, al
jmp 0x10028dd
lea ecx, [ebp - 0x25c]
push ecx
push eax
call fcn.01002479
test al, al
push dword [ebp - 0xc]
je 0x10028e4
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x25c]
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x1002715
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp byte [0x1004020], 0
je 0x10028db
push 0x100118c
call edi
add eax, esi
cmp eax, ebx
jge 0x10028db
push 0x100118c
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
lea eax, [ebp - 0x25c]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
je 0x10028db
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcmpW]
push 0x100112c
lea eax, [ebp - 0x230]
push eax
call ebx
test eax, eax
je 0x10028ba
push 0x1001190
lea eax, [ebp - 0x230]
push eax
call ebx
test eax, eax
je 0x10028ba
test byte [ebp - 0x25c], 0x10
je 0x10028ba
push 0x1001188
call edi
mov ebx, eax
lea eax, [ebp - 0x230]
push eax
call edi
mov ecx, esi
add ecx, ebx
add eax, ecx
cmp eax, 0x104
jge 0x10028ba
lea eax, [ebp - 0x230]
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push 0x1001188
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.01002589
test al, al
je 0x10028ea
lea eax, [ebp - 0x25c]
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x100283b
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FindClose]
mov al, 1
pop edi
pop esi
pop ebx
leave
ret 8
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FindClose]
xor eax, eax
cmp byte [0x1004021], al
setne al
jmp 0x10028dd