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

Disassembly:
mov eax, 0x4e73c0
call fcn.00475fe0
sub esp, 0x78
push ebx
xor ebx, ebx
cmp dword [ebp + 8], ebx
push esi
push edi
je 0x4038c2
cmp dword [ebp + 0xc], ebx
je 0x4038c2
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.004038d5
test eax, eax
je 0x4038c2
push 1
pop esi
lea eax, [ebp - 0x84]
push eax
call fcn.0043f8a5
cmp esi, ebx
pop ecx
jle 0x4036f3
mov edi, esi
lea eax, [ebp - 0x28]
push 0x10
push eax
lea eax, [ebp - 0x84]
push eax
call fcn.0043f8e3
add esp, 0xc
dec edi
jne 0x4036db
lea eax, [ebp - 0x84]
push eax
lea eax, [ebp - 0x28]
push eax
call fcn.00440437
inc esi
pop ecx
cmp esi, 0xc
pop ecx
jl 0x4036c8
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x4038c2
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 0x4038c2
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
je 0x4038bb
cmp esi, 0x7fffffff
ja 0x4038bb
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 0x4038b0
cmp dword [ebp - 0x18], esi
jne 0x4038b0
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.0043f6bc
xor ebx, ebx
add esp, 0x14
cmp dword [ebp + 0xc], ebx
mov edi, eax
jge 0x4037d4
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 0x4038ac
cmp dword [ebp + 0xc], ebx
je 0x4038ac
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 0x403814
xor esi, esi
jmp 0x403887
mov edi, dword [ebp + 0x10]
mov dx, word [esi]
mov word [edi], dx
lea edx, [eax - 2]
cmp edx, ecx
jb 0x403810
mov edi, dword [ebp + 0x14]
mov dx, word [esi + 2]
mov word [edi], dx
lea edx, [eax - 4]
cmp edx, 4
jb 0x403810
mov edi, dword [ebp + 0x18]
mov edx, dword [esi + 4]
mov dword [edi], edx
lea edx, [eax - 8]
cmp edx, ecx
jb 0x403810
mov edi, dword [ebp + 0x1c]
mov dx, word [esi + 8]
mov word [edi], dx
lea edx, [eax - 0xa]
cmp edx, ecx
jb 0x403810
movzx edi, word [esi + 0xa]
lea ecx, [eax - 0xc]
cmp ecx, edi
jl 0x403810
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 0x4038c4
xor esi, esi
jmp 0x403890
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
jmp 0x40389c
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