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

Disassembly:
mov eax, 0x4d8e60
call fcn.00471450
sub esp, 0x78
push ebx
xor ebx, ebx
cmp dword [ebp + 8], ebx
push esi
push edi
je 0x4038ca
cmp dword [ebp + 0xc], ebx
je 0x4038ca
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.004038dd
test eax, eax
je 0x4038ca
push 1
pop esi
lea eax, [ebp - 0x84]
push eax
call fcn.0043b6eb
cmp esi, ebx
pop ecx
jle 0x4036fb
mov edi, esi
lea eax, [ebp - 0x28]
push 0x10
push eax
lea eax, [ebp - 0x84]
push eax
call fcn.0043b729
add esp, 0xc
dec edi
jne 0x4036e3
lea eax, [ebp - 0x84]
push eax
lea eax, [ebp - 0x28]
push eax
call fcn.0043c27d
inc esi
pop ecx
cmp esi, 0xc
pop ecx
jl 0x4036d0
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x4038ca
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 0x4038ca
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
je 0x4038c3
cmp esi, 0x7fffffff
ja 0x4038c3
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 0x4038b8
cmp dword [ebp - 0x18], esi
jne 0x4038b8
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.0043b502
xor ebx, ebx
add esp, 0x14
cmp dword [ebp + 0xc], ebx
mov edi, eax
jge 0x4037dc
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 0x4038b4
cmp dword [ebp + 0xc], ebx
je 0x4038b4
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 0x40381c
xor esi, esi
jmp 0x40388f
mov edi, dword [ebp + 0x10]
mov dx, word [esi]
mov word [edi], dx
lea edx, [eax - 2]
cmp edx, ecx
jb 0x403818
mov edi, dword [ebp + 0x14]
mov dx, word [esi + 2]
mov word [edi], dx
lea edx, [eax - 4]
cmp edx, 4
jb 0x403818
mov edi, dword [ebp + 0x18]
mov edx, dword [esi + 4]
mov dword [edi], edx
lea edx, [eax - 8]
cmp edx, ecx
jb 0x403818
mov edi, dword [ebp + 0x1c]
mov dx, word [esi + 8]
mov word [edi], dx
lea edx, [eax - 0xa]
cmp edx, ecx
jb 0x403818
movzx edi, word [esi + 0xa]
lea ecx, [eax - 0xc]
cmp ecx, edi
jl 0x403818
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 0x4038cc
xor esi, esi
jmp 0x403898
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
jmp 0x4038a4
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