Function at 0x406850
Capabilities:
Check if file exists
Enumerate files on windows
Get file attributes

Disassembly:
push 0xffffffffffffffff
push 0x41af83
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x87c
push ebx
push ebp
push esi
mov esi, dword [esp + 0x898]
lea eax, [esp + 0x788]
push edi
lea ecx, [esp + 0x688]
push eax
lea edx, [esp + 0x288]
push ecx
lea eax, [esp + 0x1c]
push edx
push eax
push esi
call dword [sym.imp.MSVCRT.dll__splitpath]
mov ecx, 0x50
xor eax, eax
lea edi, [esp + 0x158]
add esp, 0x14
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x144]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov ebx, dword [esp + 0x8a0]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x18], edi
mov eax, 1
je 0x406a4e
xor esi, esi
cmp eax, esi
je 0x406a50
lea edx, [esp + 0x488]
lea eax, [esp + 0x384]
push edx
lea ecx, [esp + 0x58c]
push eax
lea edx, [esp + 0x44]
push ecx
lea eax, [esp + 0x17c]
push edx
push eax
call dword [sym.imp.MSVCRT.dll__splitpath]
lea ecx, [esp + 0x49c]
lea edx, [esp + 0x398]
push ecx
lea eax, [esp + 0x29c]
push edx
lea ecx, [esp + 0x30]
push eax
lea edx, [esp + 0x60]
push ecx
push edx
call dword [sym.imp.MSVCRT.dll__makepath]
add esp, 0x28
lea eax, [esp + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x406a3a
test al, 0x10
jne 0x406a3a
mov cl, byte [esp + 0x13]
push esi
mov byte [esp + 0x20], cl
lea ecx, [esp + 0x20]
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov dl, byte [esp + 0x13]
push esi
lea ecx, [esp + 0x30]
mov dword [esp + 0x898], esi
mov byte [esp + 0x30], dl
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
lea edi, [esp + 0x40]
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x898], 1
mov ebp, ecx
lea ecx, [esp + 0x20]
push ebp
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x4069d2
mov edi, dword [esp + 0x20]
mov ecx, ebp
mov eax, ecx
lea esi, [esp + 0x40]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x24], ebp
xor esi, esi
mov byte [ecx + ebp], 0
mov eax, dword [ebx + 8]
lea edx, [esp + 0x1c]
push edx
push 1
push eax
mov ecx, ebx
call fcn.00408c40
push 1
lea ecx, [esp + 0x30]
mov dword [esp + 0x898], 2
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x894], 0xffffffff
cmp ecx, esi
je 0x406a2a
mov al, byte [ecx - 1]
test al, al
je 0x406a20
cmp al, 0xff
je 0x406a20
dec al
mov byte [ecx - 1], al
jmp 0x406a2a
dec ecx
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov edi, dword [esp + 0x18]
mov dword [esp + 0x20], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x28], esi
lea eax, [esp + 0x144]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
jmp 0x4068d7
xor esi, esi
push edi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ecx, dword [ebx + 4]
cmp ecx, esi
jne 0x406a62
xor eax, eax
jmp 0x406a6a
mov eax, dword [ebx + 8]
sub eax, ecx
sar eax, 5
mov ecx, dword [esp + 0x88c]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x888
ret