Function at 0x509740
Capabilities:
Enumerate files on windows
Enumerate files recursively

Disassembly:
push 0xffffffffffffffff
push 0x520746
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x27c
push ebx
push esi
push edi
mov edi, dword [esp + 0x298]
xor ebx, ebx
push ebx
push edi
mov byte [esp + 0x17], bl
call fcn.00510565
mov esi, eax
push 0x525da4
push esi
mov dword [esp + 0x3c], esi
call fcn.0051020b
add esp, 0x10
lea eax, [esp + 0x38]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x18], eax
jne 0x5097a2
mov al, 1
jmp 0x509adb
mov ecx, dword [esp + 0x2a0]
push ebp
push ebx
mov edx, dword [ecx + 8]
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
sete al
cmp al, bl
jne 0x509abf
mov ebp, dword [esp + 0x2a0]
lea eax, [esp + 0x68]
push 0x5252c8
push eax
call fcn.00510946
add esp, 8
test eax, eax
je 0x509a91
lea ecx, [esp + 0x68]
push 0x525d9c
push ecx
call fcn.00510946
add esp, 8
test eax, eax
je 0x509a91
lea edx, [esp + 0x68]
add esi, 2
push edx
push esi
call fcn.0051020b
mov eax, dword [esp + 0x64]
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x44]
and al, 0x7f
mov dword [esp + 0x40], ecx
mov dword [esp + 0x44], eax
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
lea edx, [esp + 0x30]
push ebx
push edx
push eax
lea eax, [esp + 0x5c]
lea ecx, [esp + 0x64]
push eax
lea edx, [esp + 0x58]
push ecx
lea eax, [esp + 0x50]
add edi, 8
push edx
push eax
push edi
push ebx
mov dword [esp + 0x2c0], ebx
call fcn.00507460
mov ecx, dword [ebp + 4]
mov esi, eax
mov eax, dword [ebp + 8]
add esp, 0x2c
cmp ecx, eax
jb 0x509886
mov edx, dword [ebp]
lea eax, [eax + eax + 0x64]
mov dword [ebp + 8], eax
lea ecx, [eax*4]
push ecx
push edx
call fcn.00510617
add esp, 8
mov dword [ebp], eax
mov eax, dword [ebp + 4]
mov ecx, dword [ebp]
push ebp
mov dword [ecx + eax*4], esi
mov edx, dword [ebp + 4]
inc edx
mov dword [ebp + 4], edx
lea edx, [esp + 0x40]
push edx
push edi
call fcn.00507120
mov eax, dword [esp + 0x48]
add esp, 0xc
test al, 0x10
je 0x509a6e
test ah, 4
jne 0x509a6e
push 0xc
call fcn.005101d3
mov esi, eax
add esp, 4
mov dword [esp + 0x20], esi
cmp esi, ebx
mov byte [esp + 0x294], 1
je 0x5098fd
push edi
mov dword [esi + 4], ebx
mov dword [esi + 8], 1
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
cmp eax, ebx
mov dword [esi], eax
jne 0x5098ff
cmp edi, ebx
je 0x5098ff
push 0x8007000e
call fcn.0051f3e0
jmp 0x5098ff
xor esi, esi
cmp esi, ebx
mov byte [esp + 0x294], bl
mov dword [esp + 0x18], esi
jne 0x509918
push 0x8007000e
call fcn.0051f3e0
push 0xc
mov byte [esp + 0x298], 2
call fcn.005101d3
mov esi, eax
add esp, 4
mov dword [esp + 0x20], esi
cmp esi, ebx
mov byte [esp + 0x294], 3
je 0x50996c
push str.Scanning
mov dword [esi + 4], ebx
mov dword [esi + 8], 1
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
cmp eax, ebx
mov dword [esi], eax
jne 0x50996e
mov eax, str.Scanning
test eax, eax
je 0x50996e
push 0x8007000e
call fcn.0051f3e0
jmp 0x50996e
xor esi, esi
cmp esi, ebx
mov byte [esp + 0x294], 2
mov dword [esp + 0x14], esi
jne 0x509988
push 0x8007000e
call fcn.0051f3e0
lea ecx, [esp + 0x18]
lea edx, [esp + 0x24]
push ecx
push edx
lea ecx, [esp + 0x1c]
mov byte [esp + 0x29c], 4
call fcn.004fda30
mov eax, dword [eax]
mov byte [esp + 0x294], 5
cmp eax, ebx
je 0x5099b5
mov edi, dword [eax]
jmp 0x5099b7
xor edi, edi
mov eax, dword [esp + 0x2a4]
lea esi, [eax + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [esp + 0x2a4]
call fcn.004fdbd0
push 0xc
call fcn.005101d3
add esp, 4
mov dword [esp + 0x20], eax
cmp eax, ebx
mov byte [esp + 0x294], 6
je 0x5099f8
push edi
mov ecx, eax
call fcn.004fdc20
jmp 0x5099fa
xor eax, eax
mov edi, dword [esp + 0x2a4]
push esi
mov dword [edi], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x24]
cmp ecx, ebx
je 0x509a1b
call fcn.004fdce0
mov dword [esp + 0x24], ebx
mov ecx, dword [esp + 0x14]
cmp ecx, ebx
je 0x509a2c
call fcn.004fdce0
mov dword [esp + 0x14], ebx
mov eax, dword [esp + 0x18]
mov byte [esp + 0x294], bl
cmp eax, ebx
je 0x509a5c
mov esi, eax
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x509a58
cmp esi, ebx
je 0x509a58
push 1
mov ecx, esi
call fcn.004fe8e0
mov dword [esp + 0x18], ebx
mov ecx, dword [esp + 0x29c]
push edi
push ebp
push ecx
call fcn.00509740
add esp, 0xc
mov edx, dword [esp + 0x28]
mov dword [esp + 0x294], 0xffffffff
push edx
call fcn.0051097b
mov edi, dword [esp + 0x2a0]
mov esi, dword [esp + 0x34]
add esp, 4
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x3c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
je 0x509ac4
mov edx, dword [esp + 0x2a4]
push ebx
mov eax, dword [edx + 8]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x5097c9
mov byte [esp + 0x13], 1
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
mov cl, byte [esp + 0x13]
xor eax, eax
cmp cl, bl
pop ebp
sete al
mov ecx, dword [esp + 0x288]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x288
ret