Function at 0x1008386
Capabilities:
Enumerate files on windows
Enumerate files recursively
Get common file path
Set current directory

Disassembly:
sub esp, 0x250
push ebp
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push edi
push 0x410
push 8
mov dword [esp + 0x18], ecx
call esi
mov ebp, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
call ebp
mov edi, eax
test edi, edi
je 0x1008532
push ebx
push 1
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
push dword [esp + 0x264]
push edi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
movzx ebx, ax
lea edi, [edi + ebx - 1]
cmp byte [edi], 0x5c
je 0x10083eb
push 0x1002644
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
xor eax, eax
inc eax
sub eax, ebx
add edi, eax
cmp dword [esp + 0x268], 0
je 0x100840a
push dword [esp + 0x268]
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push edi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
je 0x1008522
lea eax, [esp + 0x15c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
lea eax, [esp + 0x1c]
push eax
push 0x1002980
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov dword [esp + 0x18], eax
push 0x100297c
lea eax, [esp + 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
mov ebx, 0x400
je 0x1008505
push 0x1002978
lea eax, [esp + 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x1008505
mov eax, dword [esp + 0x1c]
and eax, 0x10
cmp al, 0x10
je 0x10085a3
push ebx
push 8
call esi
push eax
call ebp
push ebx
push 8
mov dword [esp + 0x18], eax
call esi
push eax
call ebp
mov ebp, eax
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp byte [eax + ebp - 1], 0x5c
je 0x10084bc
push 0x1002644
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [esp + 0x48]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov ecx, dword [esp + 0x14]
push ebp
call fcn.01007ae1
test eax, eax
je 0x10084e4
push dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
push ebp
call fcn.0100808a
push dword [esp + 0x10]
push 8
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push ebp
push 8
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ebp, dword [sym.imp.KERNEL32.dll_HeapAlloc]
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x100853e
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_FindClose]
push edi
push 0
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor eax, eax
inc eax
pop ebx
pop edi
pop esi
pop ebp
add esp, 0x250
ret 8
push 0x100297c
lea eax, [esp + 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x1008505
push 0x1002978
lea eax, [esp + 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x1008505
mov eax, dword [esp + 0x1c]
and eax, 0x10
cmp al, 0x10
jne 0x1008484
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
movzx eax, ax
lea edi, [edi + eax - 1]
cmp byte [edi], 0x5c
mov dword [esp + 0x10], eax
je 0x100859c
push 0x1002644
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov eax, dword [esp + 0x10]
xor ecx, ecx
inc ecx
sub ecx, eax
add edi, ecx
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x48]
push eax
push edi
call fcn.01008386
jmp 0x1008505