Function at 0x508109
Capabilities:
Enumerate files on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x298
mov eax, dword [0x55c054]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
push ebx
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x25c], edx
cmp ecx, edi
je 0x508156
mov al, byte [ecx]
cmp al, 0x2f
je 0x508150
cmp al, 0x5c
je 0x508150
cmp al, 0x3a
je 0x508150
push ecx
push edi
call fcn.0050f500
pop ecx
pop ecx
mov ecx, eax
cmp ecx, edi
jne 0x508133
mov edx, dword [ebp - 0x25c]
mov al, byte [ecx]
mov byte [ebp - 0x255], al
cmp al, 0x3a
jne 0x508182
lea eax, [edi + 1]
cmp ecx, eax
je 0x50817c
push edx
xor ebx, ebx
push ebx
push ebx
push edi
call fcn.00508058
add esp, 0x10
jmp 0x508380
mov al, byte [ebp - 0x255]
xor ebx, ebx
cmp al, 0x2f
je 0x508192
cmp al, 0x5c
je 0x508192
cmp al, 0x3a
mov al, bl
jne 0x508194
mov al, 1
sub ecx, edi
movzx eax, al
inc ecx
mov dword [ebp - 0x28c], ebx
neg eax
mov dword [ebp - 0x288], ebx
push esi
sbb eax, eax
mov dword [ebp - 0x284], ebx
and eax, ecx
mov dword [ebp - 0x280], ebx
mov dword [ebp - 0x290], eax
mov dword [ebp - 0x27c], ebx
mov byte [ebp - 0x278], bl
call fcn.004f9939
push eax
lea eax, [ebp - 0x28c]
push eax
push edi
call fcn.004f991c
add esp, 0xc
lea ecx, [ebp - 0x254]
neg eax
sbb eax, eax
push ebx
push ebx
push ebx
push ecx
not eax
and eax, dword [ebp - 0x284]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileExW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x508234
push dword [ebp - 0x25c]
push ebx
push ebx
push edi
call fcn.00508058
add esp, 0x10
mov esi, eax
cmp byte [ebp - 0x278], bl
je 0x50822d
push dword [ebp - 0x284]
call fcn.004ff93d
pop ecx
mov eax, esi
jmp 0x50837f
mov eax, dword [ebp - 0x25c]
mov ecx, dword [eax + 4]
sub ecx, dword [eax]
sar ecx, 2
mov dword [ebp - 0x294], ecx
mov dword [ebp - 0x274], ebx
mov dword [ebp - 0x270], ebx
mov dword [ebp - 0x26c], ebx
mov dword [ebp - 0x268], ebx
mov dword [ebp - 0x264], ebx
mov byte [ebp - 0x260], bl
call fcn.004f9939
push eax
lea eax, [ebp - 0x255]
push eax
lea eax, [ebp - 0x274]
push eax
lea eax, [ebp - 0x228]
push eax
call fcn.00507e15
add esp, 0x10
neg eax
sbb eax, eax
not eax
and eax, dword [ebp - 0x26c]
cmp byte [eax], 0x2e
jne 0x5082b1
mov cl, byte [eax + 1]
test cl, cl
je 0x5082d1
cmp cl, 0x2e
jne 0x5082b1
cmp byte [eax + 2], bl
je 0x5082d1
push dword [ebp - 0x25c]
push dword [ebp - 0x290]
push edi
push eax
call fcn.00508058
add esp, 0x10
mov dword [ebp - 0x298], eax
test eax, eax
jne 0x50834a
cmp byte [ebp - 0x260], bl
je 0x5082e5
push dword [ebp - 0x26c]
call fcn.004ff93d
pop ecx
lea eax, [ebp - 0x254]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x508248
mov eax, dword [ebp - 0x25c]
mov ecx, dword [ebp - 0x294]
mov edx, dword [eax]
mov eax, dword [eax + 4]
sub eax, edx
sar eax, 2
cmp ecx, eax
je 0x50832b
push 0x507dfd
sub eax, ecx
push 4
push eax
lea eax, [edx + ecx*4]
push eax
call fcn.004ecf00
add esp, 0x10
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp byte [ebp - 0x278], bl
je 0x508346
push dword [ebp - 0x284]
call fcn.004ff93d
pop ecx
xor eax, eax
jmp 0x50837f
cmp byte [ebp - 0x260], bl
je 0x50835e
push dword [ebp - 0x26c]
call fcn.004ff93d
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp byte [ebp - 0x278], bl
je 0x508379
push dword [ebp - 0x284]
call fcn.004ff93d
pop ecx
mov eax, dword [ebp - 0x298]
pop esi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.004e7a8e
leave
ret