Function at 0x403656
Capabilities:
Check if file exists
Get file attributes
Get file size
Read file on windows

Disassembly:
mov eax, 0x4cbf18
call fcn.0046fad0
sub esp, 0x78
push ebx
xor ebx, ebx
cmp dword [ebp + 8], ebx
push esi
push edi
je 0x403899
cmp dword [ebp + 0xc], ebx
je 0x403899
and byte [ebp - 0x28], bl
xor eax, eax
lea edi, [ebp - 0x27]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x28]
push eax
push dword [ebp + 0xc]
call fcn.004038ac
test eax, eax
je 0x403899
push 1
pop esi
lea eax, [ebp - 0x84]
push eax
call fcn.00439b83
cmp esi, ebx
pop ecx
jle 0x4036ca
mov edi, esi
lea eax, [ebp - 0x28]
push 0x10
push eax
lea eax, [ebp - 0x84]
push eax
call fcn.00439bc1
add esp, 0xc
dec edi
jne 0x4036b2
lea eax, [ebp - 0x84]
push eax
lea eax, [ebp - 0x28]
push eax
call fcn.0043a715
inc esi
pop ecx
cmp esi, 0xc
pop ecx
jl 0x40369f
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x403899
push ebx
push eax
push 3
push ebx
push 1
push SysReAllocStringLen
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x403899
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
je 0x403892
cmp esi, 0x7fffffff
ja 0x403892
lea ecx, [ebp - 0x14]
call sub.MFC42.DLL_CString::CString_4
push esi
lea ecx, [ebp - 0x14]
mov dword [ebp - 4], ebx
call sub.MFC42.DLL_CString::GetBuffer
and dword [ebp - 0x18], 0
mov ebx, eax
lea eax, [ebp - 0x18]
push 0
push eax
push esi
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403887
cmp dword [ebp - 0x18], esi
jne 0x403887
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x10]
call sub.MFC42.DLL_CString::CString_4
push esi
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 1
call sub.MFC42.DLL_CString::GetBuffer
lea ecx, [ebp + 0xc]
mov dword [ebp + 0xc], esi
push ecx
push eax
lea eax, [ebp - 0x28]
push eax
push esi
push ebx
call fcn.0043999a
xor ebx, ebx
add esp, 0x14
cmp dword [ebp + 0xc], ebx
mov edi, eax
jge 0x4037ab
mov dword [ebp + 0xc], ebx
push dword [ebp + 0xc]
lea ecx, [ebp - 0x10]
call sub.MFC42.DLL_CString::ReleaseBuffer
push esi
lea ecx, [ebp - 0x14]
call sub.MFC42.DLL_CString::ReleaseBuffer
cmp edi, ebx
je 0x403883
cmp dword [ebp + 0xc], ebx
je 0x403883
push dword [ebp + 0xc]
lea ecx, [ebp - 0x10]
call sub.MFC42.DLL_CString::GetBuffer
push 2
mov esi, eax
mov eax, dword [ebp + 0xc]
pop ecx
cmp eax, ecx
jae 0x4037eb
xor esi, esi
jmp 0x40385e
mov edi, dword [ebp + 0x10]
mov dx, word [esi]
mov word [edi], dx
lea edx, [eax - 2]
cmp edx, ecx
jb 0x4037e7
mov edi, dword [ebp + 0x14]
mov dx, word [esi + 2]
mov word [edi], dx
lea edx, [eax - 4]
cmp edx, 4
jb 0x4037e7
mov edi, dword [ebp + 0x18]
mov edx, dword [esi + 4]
mov dword [edi], edx
lea edx, [eax - 8]
cmp edx, ecx
jb 0x4037e7
mov edi, dword [ebp + 0x1c]
mov dx, word [esi + 8]
mov word [edi], dx
lea edx, [eax - 0xa]
cmp edx, ecx
jb 0x4037e7
movzx edi, word [esi + 0xa]
lea ecx, [eax - 0xc]
cmp ecx, edi
jl 0x4037e7
mov ecx, dword [ebp + 0x20]
push edi
call sub.MFC42.DLL_CString::GetBuffer
add esi, 0xc
push edi
push esi
push eax
call sub.MSVCRT.dll_memcpy
mov ecx, dword [ebp + 0x20]
add esp, 0xc
push edi
call sub.MFC42.DLL_CString::ReleaseBuffer
mov eax, dword [ebp + 0xc]
push 1
pop esi
push eax
lea ecx, [ebp - 0x10]
call sub.MFC42.DLL_CString::ReleaseBuffer
and byte [ebp - 4], 0
lea ecx, [ebp - 0x10]
call sub.MFC42.DLL_CString::CString
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call sub.MFC42.DLL_CString::CString
mov eax, esi
jmp 0x40389b
xor esi, esi
jmp 0x403867
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
jmp 0x403873
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 0x1c