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

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0x4f
push 0
push 0
dec ecx
jne 0x4046fc
push ebx
push esi
push edi
mov ebx, eax
mov edi, 0x40e288
xor eax, eax
push ebp
push 0x404a28
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [0x40e2c3], bl
lea eax, [ebp - 0x24c]
push eax
push 0xff
call sub.kernel32.dll_GetCurrentDirectoryA_1
lea eax, [ebp - 0x250]
lea edx, [ebp - 0x24c]
mov ecx, pe_nt_image_headers32
call fcn.0040344c
mov eax, dword [ebp - 0x250]
push eax
lea eax, [ebp - 0x254]
mov edx, 0x40e2c8
mov ecx, pe_nt_image_headers32
call fcn.0040344c
mov eax, dword [ebp - 0x254]
pop edx
call fcn.00403758
test eax, eax
jne 0x4049fd
lea eax, [ebp - 0x14c]
push eax
push 0x404a38
call sub.kernel32.dll_FindFirstFileA
mov esi, eax
lea eax, [ebp - 4]
call fcn.004032e0
test byte [ebp - 0x14c], 0x10
jne 0x404960
push 0x64
call sub.kernel32.dll_Sleep
mov eax, edi
lea edx, [ebp - 0x24c]
mov ecx, pe_nt_image_headers32
call fcn.0040344c
mov eax, dword [edi]
call fcn.00403464
mov edx, dword [edi]
cmp byte [edx + eax - 1], 0x5c
je 0x4047d5
mov eax, edi
mov edx, 0x404a44
call fcn.0040346c
lea eax, [ebp - 0x258]
lea edx, [ebp - 0x120]
mov ecx, 0x104
call fcn.0040344c
mov edx, dword [ebp - 0x258]
mov eax, edi
call fcn.0040346c
lea eax, [ebp - 0x25c]
lea edx, [ebp - 0x120]
mov ecx, 0x104
call fcn.0040344c
mov eax, dword [ebp - 0x25c]
lea edx, [ebp - 8]
call fcn.00403ed0
lea edx, [ebp - 0x260]
mov eax, 0x404a50
call fcn.00403f88
mov edx, dword [ebp - 0x260]
mov eax, dword [ebp - 8]
call fcn.004035b0
je 0x40485c
lea edx, [ebp - 0x264]
mov eax, 0x404a5c
call fcn.00403f88
mov edx, dword [ebp - 0x264]
mov eax, dword [ebp - 8]
call fcn.004035b0
jne 0x4048d3
lea eax, [ebp - 0x268]
lea edx, [ebp - 0x120]
mov ecx, 0x104
call fcn.0040344c
mov eax, dword [ebp - 0x268]
push eax
lea edx, [ebp - 0x26c]
xor eax, eax
call fcn.004027f0
mov edx, dword [ebp - 0x26c]
pop eax
call fcn.004035b0
je 0x4048d3
lea eax, [ebp - 0x270]
lea edx, [ebp - 0x120]
mov ecx, 0x104
call fcn.0040344c
mov eax, dword [ebp - 0x270]
mov edx, dword [ebp - 4]
call fcn.004035b0
je 0x4048d3
mov al, byte [0x40e2c4]
or al, byte [0x40e2c5]
je 0x4048d3
mov eax, dword [edi]
call fcn.00404198
jmp 0x4049cf
call fcn.004046c4
cmp word [0x40e2c0], 0x7d8
ja 0x4048ff
cmp word [0x40e2be], 0xb
jbe 0x4049cf
cmp word [0x40e2bc], 0x17
jbe 0x4049cf
mov eax, dword [ebp - 8]
call fcn.00403464
dec eax
jle 0x4049cf
lea edx, [ebp - 0xc]
mov eax, 0x404a68
call fcn.00403f88
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
call fcn.00403758
test eax, eax
jle 0x404936
mov edx, 1
mov eax, dword [edi]
call fcn.004044e8
lea edx, [ebp - 0xc]
mov eax, 0x404aa0
call fcn.00403f88
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
call fcn.00403758
test eax, eax
jle 0x4049cf
mov edx, 0xa
mov eax, dword [edi]
call fcn.004044e8
jmp 0x4049cf
lea eax, [ebp - 0x274]
lea edx, [ebp - 0x120]
mov ecx, 0x104
call fcn.0040344c
mov eax, dword [ebp - 0x274]
mov edx, 0x404acc
call fcn.004035b0
je 0x4049cf
lea eax, [ebp - 0x278]
lea edx, [ebp - 0x120]
mov ecx, 0x104
call fcn.0040344c
mov eax, dword [ebp - 0x278]
mov edx, 0x404ad8
call fcn.004035b0
je 0x4049cf
lea eax, [ebp - 0x120]
push eax
call sub.kernel32.dll_SetCurrentDirectoryA_1
mov eax, ebx
call fcn.004046f4
lea eax, [ebp - 0x24c]
push eax
call sub.kernel32.dll_SetCurrentDirectoryA_1
lea eax, [ebp - 4]
lea edx, [ebp - 0x120]
mov ecx, 0x104
call fcn.0040344c
lea eax, [ebp - 0x14c]
push eax
push esi
call sub.kernel32.dll_FindNextFileA
test eax, eax
jne 0x404793
push esi
call sub.kernel32.dll_FindClose
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x404a2f
lea eax, [ebp - 0x278]
mov edx, 0xb
call fcn.00403304
lea eax, [ebp - 0xc]
mov edx, 3
call fcn.00403304
ret