Function at 0x1012939
Capabilities:
Enumerate files on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x58
mov eax, dword [0x1023018]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
push edi
xor edi, edi
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x1c], edi
cmp eax, edi
jne 0x101296b
mov eax, 0x80070057
jmp 0x1012b77
push ebx
push esi
mov esi, 0x1002fbc
push esi
lea eax, [ebp - 0x58]
push eax
call dword [sym.imp.ntdll.dll_RtlInitUnicodeString]
lea eax, [ebp - 0x58]
mov dword [ebp - 0x48], eax
lea eax, [ebp - 0x50]
push eax
push 1
lea eax, [ebp - 0x28]
push eax
mov dword [ebp - 0x50], 0x18
mov dword [ebp - 0x4c], edi
mov dword [ebp - 0x44], 0x40
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x3c], edi
call dword [sym.imp.ntdll.dll_NtOpenDirectoryObject]
cmp eax, edi
jl 0x1012b52
push 0x400
push 8
mov dword [ebp - 0x30], edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
mov dword [ebp - 0x24], ebx
cmp ebx, edi
je 0x1012afe
mov byte [ebp - 0x2c], 1
mov dword [ebp - 0x20], edi
push edi
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 0x2c]
push 1
push 0x400
push ebx
push dword [ebp - 0x28]
call dword [sym.imp.ntdll.dll_NtQueryDirectoryObject]
mov esi, eax
cmp esi, edi
jl 0x1012ab6
mov esi, 0x1002fa8
lea edi, [ebp - 0x18]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
xor eax, eax
movsw word es:[edi], word [esi]
mov byte [ebp - 0x2c], 0
cmp ax, word [ebx]
je 0x1012aa0
mov eax, dword [ebx + 4]
test eax, eax
je 0x1012aa0
lea ecx, [ebp - 0x18]
push ecx
push eax
call fcn.01014a3d
test eax, eax
je 0x1012aa0
mov ecx, dword [ebx + 4]
mov eax, ecx
lea esi, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
test dx, dx
jne 0x1012a3a
sub eax, esi
sar eax, 1
cmp eax, 8
jbe 0x1012aa0
xor ebx, ebx
lea esi, [ecx + 0x10]
xor eax, eax
inc ebx
mov edi, esi
cmp ax, word [esi]
je 0x1012a81
test ebx, ebx
je 0x1012a9d
movzx eax, word [edi]
push 4
push eax
call dword [sym.imp.msvcrt.dll_iswctype]
pop ecx
pop ecx
test eax, eax
jne 0x1012a74
xor ebx, ebx
inc edi
inc edi
xor eax, eax
cmp ax, word [edi]
jne 0x1012a5c
test ebx, ebx
je 0x1012a9d
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x38]
mov eax, dword [ebp - 0x24]
push dword [eax + 4]
push esi
call dword [sym.imp.msvcrt.dll__wtoi]
pop ecx
push eax
call dword [ebp - 0x34]
mov dword [ebp - 0x1c], eax
mov ebx, dword [ebp - 0x24]
xor edi, edi
cmp dword [ebp - 0x1c], edi
jl 0x1012b34
cmp dword [ebp - 0x20], edi
je 0x10129dd
jmp 0x1012b34
cmp esi, 0x8000001a
jne 0x1012ac7
mov dword [ebp - 0x20], 1
jmp 0x1012aa2
push esi
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
cmp eax, edi
jle 0x1012adc
and eax, 0xffff
or eax, 0x80070000
push esi
push 0x1002fbc
push 0x1002f28
push 0x20001ec
push 0x102373c
mov dword [ebp - 0x1c], eax
call fcn.0100a7d5
add esp, 0x14
jmp 0x1012aa2
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, edi
jle 0x1012b16
and eax, 0xffff
or eax, 0x80070000
cmp eax, edi
jge 0x1012b2d
call esi
cmp eax, edi
jle 0x1012b28
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x1c], eax
jmp 0x1012b34
mov dword [ebp - 0x1c], 0x80004005
push dword [ebp - 0x28]
call dword [sym.imp.ntdll.dll_NtClose]
cmp ebx, edi
je 0x1012b72
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x1012b72
push eax
push esi
push 0x1002ea8
push 0x20001ed
push 0x102373c
mov dword [ebp - 0x1c], 0x80004005
call fcn.0100a7d5
add esp, 0x14
mov eax, dword [ebp - 0x1c]
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop edi
call fcn.0100b8c5
leave
ret 8