Function at 0x49bd10
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [0x5153d4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x7ccd70]
push ebx
add eax, 4
mov ebx, ecx
mov dword [ebp - 0x14], ebx
mov dword [0x7ccd70], eax
push esi
push edi
cmp eax, 0x4000
jbe 0x49bd4b
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 8]
push 0
push eax
push 4
push 0x6e0cc8
push ebx
call edi
mov eax, dword [0x6e0cc8]
lea esi, [eax*8]
mov eax, dword [0x7cc7e8]
cmp esi, eax
jg 0x49c042
mov ecx, dword [0x748da0]
sub eax, esi
add dword [0x7cc7f0], esi
mov dword [0x7cc7e8], eax
mov dword [ebp - 0x10], ecx
lea eax, [ecx + esi]
mov dword [0x6e0c98], ecx
mov dword [0x748da0], eax
mov eax, dword [0x7ccd70]
add eax, esi
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49bdc3
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov ecx, dword [ebp - 0x10]
push 0
lea eax, [ebp - 8]
push eax
push esi
push ecx
push ebx
call edi
mov eax, dword [0x6e0cc8]
shl eax, 3
cmp dword [ebp - 8], eax
je 0x49bde5
push str.LoadBoxes__:_Unable_to_load_boxes
jmp 0x49c024
mov eax, dword [0x7ccd70]
add eax, 4
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49be08
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 8]
push eax
push 4
lea eax, [ebp - 0xc]
push eax
push ebx
call edi
mov eax, dword [ebp - 0xc]
mov ecx, dword [0x7cc7e8]
lea edx, [eax + eax]
lea eax, [edx + 3]
mov dword [ebp - 0x10], edx
and eax, 0xfffffffc
cmp eax, ecx
jle 0x49be37
push ecx
push eax
jmp 0x49c044
add dword [0x7cc7f0], eax
sub ecx, eax
mov esi, dword [0x748da0]
add eax, esi
mov dword [0x748da0], eax
mov eax, dword [0x7ccd70]
add eax, edx
mov dword [0x7cc7e8], ecx
mov dword [0x6e0cc4], esi
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49be7d
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov edx, dword [ebp - 0x10]
push 0
lea eax, [ebp - 8]
push eax
push edx
push esi
push ebx
call edi
mov eax, dword [ebp - 0xc]
add eax, eax
cmp dword [ebp - 8], eax
je 0x49be9c
push str.LoadBoxes__:_Unable_to_load_box_overlaps
jmp 0x49c024
mov ecx, dword [0x6e0cc8]
xor edi, edi
mov dword [ebp - 0x10], edi
nop word [eax + eax]
xor esi, esi
lea edi, [edi + 0x6e0ca4]
nop dword [eax + eax]
lea ebx, [ecx + ecx]
mov ecx, dword [0x7cc7e8]
lea eax, [ebx + 3]
and eax, 0xfffffffc
cmp eax, ecx
jg 0x49be30
mov edx, dword [0x748da0]
sub ecx, eax
add dword [0x7cc7f0], eax
add eax, edx
mov dword [0x748da0], eax
mov eax, dword [0x7ccd70]
add eax, ebx
mov dword [ebp - 0x18], edx
mov dword [0x7cc7e8], ecx
mov dword [edi], edx
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49bf1c
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov edx, dword [ebp - 0x18]
push 0
lea eax, [ebp - 8]
push eax
push ebx
push edx
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [0x6e0cc8]
lea ebx, [ecx + ecx]
cmp dword [ebp - 8], ebx
jne 0x49c01f
inc esi
add edi, 8
cmp esi, 4
jl 0x49bec0
mov ecx, dword [0x7cc7e8]
lea eax, [ebx + 3]
and eax, 0xfffffffc
cmp eax, ecx
jg 0x49be30
add dword [0x7cc7f0], eax
sub ecx, eax
mov esi, dword [0x748da0]
add eax, esi
mov edi, dword [ebp - 0x10]
mov dword [0x748da0], eax
mov eax, dword [0x7ccd70]
add eax, ebx
mov dword [0x7cc7e8], ecx
mov dword [edi + 0x6e0c9c], esi
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49bfa6
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 8]
push eax
push ebx
mov ebx, dword [ebp - 0x14]
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [0x6e0cc8]
lea eax, [ecx + ecx]
cmp dword [ebp - 8], eax
jne 0x49c018
add edi, 4
mov dword [ebp - 0x10], edi
cmp edi, 8
jl 0x49beb0
xor esi, esi
test ecx, ecx
jle 0x49c002
mov edx, dword [0x6e0c98]
add edx, 6
movzx eax, word [edx]
test ax, ax
jns 0x49bffa
or eax, 0x4000
mov word [edx], ax
mov ecx, dword [0x6e0cc8]
inc esi
add edx, 8
cmp esi, ecx
jl 0x49bfe4
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b557b
mov esp, ebp
pop ebp
ret
push str.LoadBoxes__:_Unable_to_load_fly_zone
jmp 0x49c024
push str.LoadBoxes__:_Unable_to_load_ground_zone
push 0x748fb8
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004b557b
mov esp, ebp
pop ebp
ret
push eax
push esi
push str.game_malloc__:_OUT_OF_MEMORY._Needed:__d__Free:__d
push 0x748fb8
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
mov ecx, 0x748fb8
call fcn.004ad960
int3