Function at 0x10040390
Capabilities:
Check if file exists
Enumerate files on windows
Enumerate files recursively

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x101e7020
mov eax, dword fs:[0]
push eax
sub esp, 0x4ac
mov eax, dword [0x1025e344]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x4b4], ecx
mov eax, dword [ebp + 0x10]
xor ebx, ebx
mov dword [ebp - 0x480], eax
mov dword [ebp - 0x478], ebx
mov dword [ebp - 4], 1
push dword [ebp + 8]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
or edi, 0xffffffff
test eax, eax
je 0x10040618
mov dword [ebp - 0x498], ebx
mov dword [ebp - 0x494], ebx
mov dword [ebp - 0x490], ebx
mov byte [ebp - 4], 2
lea eax, [ebp + 0xc]
push eax
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0x484]
push eax
call fcn.1000b620
mov byte [ebp - 4], 3
push 0x10200568
push eax
lea eax, [ebp - 0x4a0]
push eax
call fcn.10007a90
add esp, 0x18
mov byte [ebp - 4], 5
mov eax, edi
mov edx, dword [ebp - 0x484]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040454
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, 0x5c
mov dword [ebp - 0x18], 0
mov word [ebp - 0x1c], ax
mov dword [ebp - 0x14], 0
mov byte [ebp - 4], 7
mov esi, dword [ebp - 0x4a0]
mov dword [ebp - 0x14], 0
test esi, esi
jne 0x10040487
mov esi, 0x10200834
jmp 0x10040495
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, 0x104
jge 0x10040508
push esi
lea eax, [ebp - 0x448]
push 0x104
push eax
call fcn.101b1c9a
push eax
call fcn.10003fa0
add esp, 0x10
lea eax, [ebp - 0x474]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x10040508
push 0
lea eax, [ebp - 0x224]
push eax
push 0x104
push esi
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
test eax, eax
jne 0x10040673
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x10040500
cmp eax, 0xffffffff
je 0x10040500
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
mov dword [ebp - 0x18], 0
push 0x7b
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp - 0x494]
mov ebx, dword [ebp - 0x498]
mov dword [ebp - 0x47c], eax
cmp ebx, eax
je 0x100405c3
mov eax, dword [ebx]
sub eax, 0x10
push eax
call fcn.100041a0
add esp, 4
lea esi, [eax + 0x10]
mov dword [ebp - 0x4b8], esi
mov byte [ebp - 4], 0x1d
push dword [ebp - 0x480]
push ecx
mov edi, esp
mov dword [ebp - 0x4b0], esp
push eax
mov dword [ebp - 0x4ac], edi
call fcn.100041a0
add eax, 0x10
mov dword [edi], eax
mov byte [ebp - 4], 0x1f
mov edi, esp
mov dword [ebp - 0x4a4], edi
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov dword [ebp - 0x4a8], esp
push eax
call fcn.100041a0
add eax, 0x10
add esp, 4
mov dword [edi], eax
mov byte [ebp - 4], 0x21
mov byte [ebp - 4], 0x1d
mov ecx, dword [ebp - 0x4b4]
call fcn.10040390
mov byte [ebp - 4], 7
or edi, 0xffffffff
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x100405b4
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
add ebx, 4
cmp ebx, dword [ebp - 0x47c]
jne 0x10040522
mov byte [ebp - 4], 5
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], 0
test eax, eax
je 0x100405e8
cmp eax, 0xffffffff
je 0x100405e8
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
mov dword [ebp - 0x18], 0
mov byte [ebp - 4], 2
mov eax, edi
mov edx, dword [ebp - 0x4a0]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040609
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x498]
call fcn.10007990
mov byte [ebp - 4], 0
mov eax, edi
mov edx, dword [ebp + 8]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040636
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp + 0xc]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], edi
dec edi
test edi, edi
jg 0x10040655
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.100d02f2
mov esp, ebp
pop ebp
ret 0xc
lea eax, [ebp - 0x224]
push 0x5c
push eax
call fcn.101a0a0a
mov esi, eax
lea eax, [ebp - 0x224]
push 0x2f
push eax
call fcn.101a0a0a
mov ecx, eax
add esp, 0x10
test ecx, ecx
jne 0x100406a4
test esi, esi
je 0x100406bf
lea ecx, [ebp - 0x224]
test esi, esi
lea eax, [ebp - 0x224]
cmovne eax, esi
cmp ecx, eax
jb 0x100406ba
xor eax, eax
mov word [ecx], ax
jmp 0x100406bf
xor ecx, ecx
mov word [eax], cx
mov eax, 1
mov dword [ebp - 0x14], eax
test eax, eax
je 0x10040a91
mov ecx, dword [ebp - 0x474]
shr ecx, 4
and ecx, 1
je 0x1004070b
cmp word [ebp - 0x448], 0x2e
jne 0x1004070b
mov dx, word [ebp - 0x446]
test dx, dx
je 0x10040a91
cmp dx, 0x2e
jne 0x1004070b
cmp word [ebp - 0x444], 0
je 0x10040a91
test ecx, ecx
je 0x10040a91
mov eax, dword [ebp + 0xc]
lea ecx, [ebp - 0x474]
cmp dword [eax - 0xc], 0
jle 0x100407fd
lea eax, [ebp - 0x4ac]
push eax
call fcn.100402e0
mov esi, eax
mov byte [ebp - 4], 8
lea eax, [ebp + 0xc]
push dword [0x1025e108]
push eax
lea eax, [ebp - 0x4a8]
push eax
call fcn.10007a90
mov byte [ebp - 4], 9
push esi
push eax
lea eax, [ebp - 0x4a4]
push eax
call fcn.1000b620
add esp, 0x18
mov ecx, eax
mov byte [ebp - 4], 0xa
mov esi, dword [ebp - 0x480]
mov eax, dword [esi + 4]
mov dword [ebp - 0x48c], eax
cmp dword [esi + 8], eax
je 0x100407a6
mov dword [ebp - 0x47c], eax
mov eax, dword [ecx]
sub eax, 0x10
push eax
call fcn.100041a0
mov ecx, dword [ebp - 0x48c]
add eax, 0x10
add esp, 4
mov dword [ecx], eax
mov byte [ebp - 4], 0xa
add dword [esi + 4], 4
jmp 0x100407af
push ecx
push eax
mov ecx, esi
call fcn.10007500
mov byte [ebp - 4], 9
mov eax, edi
mov edx, dword [ebp - 0x4a4]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x100407d0
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 8
mov eax, edi
mov edx, dword [ebp - 0x4a8]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x100407f1
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 7
mov edx, dword [ebp - 0x4ac]
jmp 0x10040859
lea eax, [ebp - 0x4b0]
push eax
call fcn.100402e0
mov ecx, eax
mov byte [ebp - 4], 0xf
mov eax, dword [ebp - 0x480]
mov esi, dword [eax + 4]
cmp dword [eax + 8], esi
je 0x10040846
mov eax, dword [ecx]
sub eax, 0x10
mov dword [ebp - 0x47c], esi
push eax
call fcn.100041a0
add eax, 0x10
add esp, 4
mov dword [esi], eax
mov byte [ebp - 4], 0xf
mov eax, dword [ebp - 0x480]
add dword [eax + 4], 4
jmp 0x1004084f
push ecx
push esi
mov ecx, eax
call fcn.10007500
mov byte [ebp - 4], 7
mov edx, dword [ebp - 0x4b0]
mov eax, edi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040870
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0x12
call fcn.100049d0
test eax, eax
je 0x10040ac2
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x49c], esi
mov byte [ebp - 4], 0x12
or ebx, 1
mov dword [ebp - 0x478], ebx
cmp dword [ebp - 0x14], 0
je 0x100408d8
lea ecx, [ebp - 0x448]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100408b0
sub ecx, edx
lea eax, [ebp - 0x448]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x49c]
call fcn.10006ab0
mov esi, dword [ebp - 0x49c]
mov edi, dword [0x1025e108]
mov byte [ebp - 4], 0x14
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax - 0x10]
test ecx, ecx
je 0x100408f5
mov eax, dword [ecx]
call dword [eax + 0x10]
test eax, eax
jne 0x10040909
call fcn.100049d0
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
test eax, eax
je 0x10040ac2
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x484], eax
mov byte [ebp - 4], 0x14
or ebx, 2
mov dword [ebp - 0x478], ebx
test edi, edi
jne 0x1004092e
xor ecx, ecx
jmp 0x10040942
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10040933
sub ecx, edx
sar ecx, 1
mov eax, dword [ebp + 0xc]
push ecx
push edi
push dword [eax - 0xc]
push eax
lea eax, [ebp - 0x484]
push eax
call fcn.10004210
add esp, 0x14
mov byte [ebp - 4], 0x16
mov edi, dword [ebp - 0x484]
mov ecx, dword [edi - 0x10]
lea eax, [edi - 0x10]
mov dword [ebp - 0x47c], eax
test ecx, ecx
je 0x1004097d
mov eax, dword [ecx]
call dword [eax + 0x10]
test eax, eax
jne 0x10040991
call fcn.100049d0
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
test eax, eax
je 0x10040ac2
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x488], eax
mov byte [ebp - 4], 0x16
or ebx, 4
mov dword [ebp - 0x478], ebx
lea eax, [ebp - 0x488]
push dword [esi - 0xc]
push esi
push dword [edi - 0xc]
push edi
push eax
call fcn.10004210
mov eax, dword [ebp - 0x494]
add esp, 0x14
mov edi, dword [ebp - 0x488]
mov dword [ebp - 0x48c], eax
cmp dword [ebp - 0x490], eax
je 0x10040a09
mov dword [ebp - 0x4b8], eax
lea eax, [edi - 0x10]
push eax
call fcn.100041a0
mov ecx, dword [ebp - 0x48c]
add eax, 0x10
add esp, 4
mov dword [ecx], eax
mov byte [ebp - 4], 0x16
add dword [ebp - 0x494], 4
jmp 0x10040a1c
lea ecx, [ebp - 0x488]
push ecx
push eax
lea ecx, [ebp - 0x498]
call fcn.10007500
and ebx, 0xfffffffb
mov dword [ebp - 0x478], ebx
mov byte [ebp - 4], 0x14
lea edx, [edi - 0x10]
or edi, 0xffffffff
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040a43
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
and ebx, 0xfffffffd
mov dword [ebp - 0x478], ebx
mov byte [ebp - 4], 0x12
mov eax, edi
mov edx, dword [ebp - 0x47c]
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040a6a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
and ebx, 0xfffffffe
mov dword [ebp - 0x478], ebx
mov byte [ebp - 4], 7
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10040a8e
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x18]
test ecx, ecx
je 0x10040508
test eax, eax
je 0x10040508
lea eax, [ebp - 0x474]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x100406cf
jmp 0x10040508
push 0x80004005
call fcn.10004040
int3