Function at 0x511508
Capabilities:
Enumerate files on windows

Disassembly:
push 0x2c4
mov eax, 0x792428
call fcn.00700ca1
mov edi, dword [ebp + 8]
lea ecx, [ebp - 0x40]
mov esi, dword [ebp + 0xc]
xor eax, eax
mov dword [ebp - 0x2d0], edi
mov dword [ebp - 0x2cc], eax
push 0x80b940
mov dword [ebp - 4], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], 7
mov word [ebp - 0x40], ax
call fcn.004c097f
push 0x5c
lea eax, [ebp - 0x40]
mov dword [ebp - 4], 1
push eax
lea eax, [ebp - 0x70]
push esi
push eax
call fcn.005126ee
add esp, 0x10
mov eax, dword [ebp - 0x2c]
push 8
pop ebx
mov byte [ebp - 4], 3
cmp eax, ebx
jb 0x5115b8
mov ecx, dword [ebp - 0x40]
lea eax, [eax*2 + 2]
mov dword [ebp - 0x2c4], eax
mov dword [ebp - 0x2c8], ecx
cmp eax, 0x1000
jb 0x5115af
lea eax, [ebp - 0x2c4]
push eax
lea eax, [ebp - 0x2c8]
push eax
call fcn.004343f0
mov eax, dword [ebp - 0x2c4]
pop ecx
pop ecx
mov ecx, dword [ebp - 0x2c8]
push eax
push ecx
call fcn.007009b8
pop ecx
pop ecx
xor ecx, ecx
mov dword [ebp - 0x2c], 7
xor eax, eax
mov dword [ebp - 0x30], ecx
mov word [ebp - 0x40], ax
mov dword [edi], ecx
mov dword [edi + 4], ecx
mov dword [edi + 8], ecx
push 0x250
push ecx
lea eax, [ebp - 0x2c0]
mov dword [ebp - 0x2cc], 1
push eax
call fcn.00719250
add esp, 0xc
lea ecx, [ebp - 0x2c0]
cmp dword [ebp - 0x5c], ebx
lea eax, [ebp - 0x70]
cmovae eax, dword [ebp - 0x70]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x5117d7
and dword [ebp - 0x18], 0
lea ecx, [ebp - 0x28]
xor eax, eax
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
lea eax, [ebp - 0x294]
push eax
call fcn.004c097f
test byte [ebp - 0x2c0], 0x10
mov byte [ebp - 4], 4
je 0x511714
push 0x806ac4
lea ecx, [ebp - 0x28]
call fcn.004d2b1c
test al, al
jne 0x511714
push 0x80b948
lea ecx, [ebp - 0x28]
call fcn.004d2b1c
test al, al
jne 0x511714
and dword [ebp - 0x48], 0
lea ecx, [ebp - 0x58]
xor eax, eax
mov dword [ebp - 0x44], 7
mov word [ebp - 0x58], ax
lea eax, [ebp - 0x294]
push eax
call fcn.004c097f
mov eax, dword [edi + 4]
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 5
push ecx
cmp eax, dword [edi + 8]
je 0x5116ae
mov ecx, eax
call fcn.004c2b5d
push 0x18
pop eax
add dword [edi + 4], eax
jmp 0x5116b6
push eax
mov ecx, edi
call fcn.004f9e43
mov eax, dword [ebp - 0x44]
cmp eax, ebx
jb 0x511704
mov ecx, dword [ebp - 0x58]
lea eax, [eax*2 + 2]
mov dword [ebp - 0x2c8], eax
mov dword [ebp - 0x2c4], ecx
cmp eax, 0x1000
jb 0x5116fb
lea eax, [ebp - 0x2c8]
push eax
lea eax, [ebp - 0x2c4]
push eax
call fcn.004343f0
mov eax, dword [ebp - 0x2c8]
pop ecx
pop ecx
mov ecx, dword [ebp - 0x2c4]
push eax
push ecx
call fcn.007009b8
pop ecx
pop ecx
mov eax, dword [edi + 4]
sub eax, dword [edi]
push 0x18
cdq
pop ecx
idiv ecx
cmp eax, dword [ebp + 0x10]
jae 0x511781
lea eax, [ebp - 0x2c0]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x14]
je 0x511788
cmp eax, ebx
jb 0x511614
mov ecx, dword [ebp - 0x28]
lea eax, [eax*2 + 2]
mov dword [ebp - 0x2c8], eax
mov dword [ebp - 0x2c4], ecx
cmp eax, 0x1000
jb 0x511773
lea eax, [ebp - 0x2c8]
push eax
lea eax, [ebp - 0x2c4]
push eax
call fcn.004343f0
mov eax, dword [ebp - 0x2c8]
pop ecx
pop ecx
mov ecx, dword [ebp - 0x2c4]
push eax
push ecx
call fcn.007009b8
pop ecx
pop ecx
jmp 0x511614
mov eax, dword [ebp - 0x14]
mov byte [ebp - 4], 3
cmp eax, ebx
jb 0x5117d3
mov ecx, dword [ebp - 0x28]
lea eax, [eax*2 + 2]
mov dword [ebp - 0x2c4], ecx
mov dword [ebp - 0x2c8], eax
cmp eax, 0x1000
jb 0x5117ca
lea eax, [ebp - 0x2c8]
push eax
lea eax, [ebp - 0x2c4]
push eax
call fcn.004343f0
mov eax, dword [ebp - 0x2c8]
pop ecx
pop ecx
mov ecx, dword [ebp - 0x2c4]
push eax
push ecx
call fcn.007009b8
pop ecx
pop ecx
test esi, esi
je 0x5117de
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
push dword [edi + 4]
push dword [edi]
call fcn.005080b5
pop ecx
pop ecx
lea ecx, [ebp - 0x70]
call fcn.004c0931
mov eax, edi
call fcn.00700c4b
ret