Function at 0x4be445
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
push ebx
push esi
push edi
mov dword [ebp - 4], ecx
call fcn.004be641
mov esi, dword [ebp + 8]
test esi, esi
je 0x4be492
push esi
call sub.MSVCRT.dll_strlen
test eax, eax
pop ecx
je 0x4be492
push 0x5c987c
push esi
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp + 8], eax
test eax, eax
pop ecx
jne 0x4be49b
push 0x38
push str.E:CQ2ClientRelease_17.1.93DGameMapAoxPuzzle.cpp
push esi
push str.ERROR:_file__s_not_found_at__s___d
call fcn.005185c3
add esp, 0x10
xor al, al
pop edi
pop esi
pop ebx
leave
ret 4
mov esi, str.TqTerrain
lea edi, [ebp - 0x24]
movsd dword es:[edi], dword [esi]
push dword [ebp + 8]
xor eax, eax
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
lea edi, [ebp - 0x1a]
mov esi, dword [sym.imp.MSVCRT.dll_fread]
stosd dword es:[edi], eax
push 0x10
push 1
stosw word es:[edi], ax
pop ebx
lea eax, [ebp - 0x24]
push ebx
push eax
call esi
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x24]
push eax
call sub.MSVCRT.dll_strcmp
add esp, 0x18
test eax, eax
jne 0x4be492
mov edi, dword [ebp + 8]
lea eax, [ebp - 0x14]
push edi
push ebx
push 4
push eax
mov dword [ebp - 0x14], 0x3e8
call esi
add esp, 0x10
cmp dword [ebp - 0x14], 0x3e8
jne 0x4be492
mov eax, dword [ebp - 4]
push edi
add eax, 8
push ebx
push 4
push eax
call esi
mov eax, dword [ebp - 4]
push edi
add eax, 0xc
push ebx
push 4
push eax
call esi
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 4]
add esp, 0x20
push dword [eax + 0xc]
add eax, 8
push dword [eax]
call fcn.004be745
mov ecx, dword [ebp - 4]
push edi
call fcn.004be7bc
mov ecx, dword [ebp - 4]
push edi
call fcn.004bebac
and dword [ebp - 8], 0
push edi
push ebx
lea eax, [ebp - 8]
push 4
push eax
call esi
and dword [ebp - 0xc], 0
add esp, 0x10
cmp dword [ebp - 8], 0
jbe 0x4be5ba
and byte [ebp + 0xb], 0
push edi
push ebx
lea eax, [ebp + 0xb]
push ebx
push eax
call esi
and dword [ebp - 0x10], 0
add esp, 0x10
cmp byte [ebp + 0xb], 0
jbe 0x4be5af
lea ecx, [ebp - 0x38]
call fcn.004c0401
push edi
push ebx
lea eax, [ebp - 0x38]
push 2
push eax
call esi
push edi
push ebx
lea eax, [ebp - 0x34]
push 4
push eax
call esi
mov ecx, dword [ebp - 0xc]
add esp, 0x20
lea eax, [ebp - 0x38]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c]
mov ecx, dword [eax + ecx*4]
call fcn.004c0437
movzx eax, byte [ebp + 0xb]
inc dword [ebp - 0x10]
cmp dword [ebp - 0x10], eax
jb 0x4be56f
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 8]
jb 0x4be555
and dword [ebp - 8], 0
push edi
push ebx
lea eax, [ebp - 8]
push 4
push eax
call esi
and dword [ebp - 0x10], 0
add esp, 0x10
cmp dword [ebp - 8], 0
jbe 0x4be632
mov eax, dword [ebp - 4]
add eax, 0x28
mov dword [ebp - 4], eax
or byte [ebp + 8], 0xff
push edi
push ebx
lea eax, [ebp - 0xc]
push 4
push eax
call esi
push edi
push ebx
lea eax, [ebp + 8]
push ebx
push eax
call esi
push edi
push ebx
lea eax, [ebp + 9]
push ebx
push eax
call esi
push edi
push ebx
lea eax, [ebp + 0xa]
push ebx
push eax
call esi
add esp, 0x40
lea eax, [ebp + 0xb]
push edi
push ebx
push ebx
push eax
call esi
mov ecx, dword [ebp - 4]
add esp, 0x10
lea eax, [ebp - 0xc]
push eax
call fcn.004c0302
mov ecx, dword [ebp + 8]
inc dword [ebp - 0x10]
mov dword [eax], ecx
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 8]
jb 0x4be5de
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
mov al, bl
jmp 0x4be494