Function at 0x408e50
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push 0xffffffffffffffff
push 0x4e230b
mov eax, dword fs:[0]
push eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x53fa2c]
xor eax, esp
push eax
lea eax, [esp + 0x14]
mov dword fs:[0], eax
mov esi, ecx
mov edi, dword [esp + 0x24]
mov eax, dword [edi]
mov ecx, dword [eax - 0xc]
test ecx, ecx
je 0x40906e
mov ebp, dword [esp + 0x28]
test ebp, ebp
je 0x40906e
cmp dword [esp + 0x2c], 0
je 0x40906e
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x408eae
test al, 0x10
jne 0x408ec3
push 0xa1
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, 0xa1
jmp 0x40907b
push edi
mov ecx, esi
call fcn.00408420
test eax, eax
je 0x408ed7
push edi
mov ecx, esi
call fcn.00408640
call fcn.00407d50
mov eax, dword [edi]
push 0
push 0x42000000
push 3
push 0
push 3
push 1
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x408f11
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, esi
jmp 0x40907b
push 0x105c
call sub.mfc90.dll_Ordinal_798
add esp, 4
mov dword [esp + 0x24], eax
mov dword [esp + 0x1c], 0
test eax, eax
je 0x408f59
mov ecx, dword [esi + 0x48]
mov edx, dword [esp + 0x38]
push ecx
mov ecx, dword [esp + 0x38]
push edx
movzx edx, byte [esi + 0x44]
push ecx
mov ecx, dword [esp + 0x3c]
push edx
mov edx, dword [esp + 0x3c]
push ecx
push ebp
push edx
push edi
push ebx
mov ecx, eax
call fcn.004081c0
mov edi, eax
jmp 0x408f5b
xor edi, edi
mov dword [esp + 0x1c], 0xffffffff
test edi, edi
jne 0x408f7e
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea eax, [edi + 0xe]
jmp 0x40907b
mov eax, dword [esi + 4]
push 0
push edi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
mov dword [esi + 4], eax
test eax, eax
jne 0x408fb9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, edi
mov esi, eax
call fcn.004082f0
push edi
call sub.mfc90.dll_Ordinal_800
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, esi
jmp 0x40907b
cmp dword [esi + 8], 0
jne 0x409012
push 0
push 0
push 0
push 0
push esi
push 0x408920
call sub.mfc90.dll_Ordinal_1062
test eax, eax
jne 0x408ff9
mov ecx, edi
call fcn.004082f0
push edi
call sub.mfc90.dll_Ordinal_800
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 4
call esi
test eax, eax
je 0x409067
call esi
jmp 0x40907b
mov ecx, dword [eax + 0x2c]
mov dword [esi + 8], ecx
mov edx, dword [eax + 0x30]
mov dword [esi + 0xc], edx
mov dword [eax + 0x28], 1
cmp dword [esi + 8], 0
je 0x40905c
mov eax, dword [esi + 4]
push eax
mov ecx, edi
call fcn.00407a10
mov ebx, eax
test ebx, ebx
je 0x40903e
mov ecx, edi
call fcn.004082f0
push edi
call sub.mfc90.dll_Ordinal_800
add esp, 4
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, ebx
jmp 0x40907b
mov ecx, dword [esp + 0x2c]
push esi
call fcn.00408cf0
push edi
mov ecx, esi
call fcn.00407e50
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40907b
push 0xa4
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, 0xa4
jmp 0x40907b
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, 0x57
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18