Function at 0x49cc50
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc4
mov eax, dword [0x5153d4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
mov esi, edx
push ecx
push 0x50f46c
push 0x7d1178
call edi
add esp, 0xc
xor ecx, ecx
mov al, byte [ecx + 0x7d1178]
lea ecx, [ecx + 1]
mov byte [ecx + 0x7cc667], al
test al, al
jne 0x49cc80
mov eax, dword [0x74771c]
push 0
push 0x8000080
push 3
push 0
push 0
push DirectSoundEnumerateA
mov dword [0x748da0], eax
mov eax, dword [0x7cc7ec]
push 0x7d1178
mov dword [0x7cc7e8], eax
mov dword [0x7cc7f0], 0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x49ccfd
push esi
push 0x7d1178
push str.LoadLevel__:_Could_not_open__s__level__d_
push 0x748fb8
call edi
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b557b
mov esp, ebp
pop ebp
ret
mov eax, dword [0x7ccd70]
add eax, 4
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49cd20
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0xb8]
push 0
push eax
push 4
lea eax, [ebp - 0xbc]
push eax
push ebx
call edi
mov eax, dword [0x7ccd70]
add eax, 0x300
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49cd60
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0xac]
push eax
push 0x300
push 0x7cc368
push ebx
call edi
mov word [0x7cc368], 0
mov eax, 3
mov byte [0x7cc36a], 0
nop dword [eax + eax]
shl byte [eax + 0x7cc368], 2
inc eax
cmp eax, 0x300
jb 0x49cd90
mov eax, dword [0x7ccd70]
add eax, 0x400
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49cdc4
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0xac]
push eax
push 0x400
push 0x6f71d8
push ebx
call edi
xor eax, eax
mov dword [0x666dc8], 0
xor edx, edx
mov ecx, 0x6f71da
xor esi, esi
nop
cmp byte [ecx - 2], 0
jne 0x49ce05
cmp byte [ecx - 1], 0
mov eax, edx
jne 0x49ce05
cmp byte [ecx], 0
mov eax, esi
je 0x49ce19
inc eax
add ecx, 4
mov dword [0x666dc8], eax
mov edx, eax
mov esi, eax
cmp eax, 0x100
jbe 0x49cdf0
mov ecx, ebx
mov byte [0x54d162], 1
call fcn.0049a5f0
test eax, eax
je 0x49ccea
mov eax, dword [0x7ccd70]
add eax, 4
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49ce52
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0xb8]
push eax
push 4
lea eax, [ebp - 0xc0]
push eax
push ebx
call edi
mov ecx, ebx
call fcn.0049a7b0
test eax, eax
je 0x49ccea
mov ecx, ebx
call fcn.0049b180
test eax, eax
je 0x49ccea
mov ecx, ebx
call fcn.0049bb10
test eax, eax
je 0x49ccea
mov eax, dword [0x7ccd70]
add eax, 4
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49ceb7
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0xb0]
push eax
push 4
push 0x7475f0
push ebx
call edi
mov esi, dword [0x7475f0]
test esi, esi
je 0x49cf49
mov eax, dword [0x7cc7e8]
shl esi, 4
cmp esi, eax
jg 0x49d3ca
mov ecx, dword [0x748da0]
sub eax, esi
add dword [0x7cc7f0], esi
mov dword [0x7cc7e8], eax
mov dword [ebp - 0xac], ecx
mov dword [0x6e0d34], ecx
lea eax, [ecx + esi]
mov dword [0x748da0], eax
test ecx, ecx
je 0x49ccea
mov eax, dword [0x7ccd70]
add eax, esi
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49cf3b
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov ecx, dword [ebp - 0xac]
push 0
lea eax, [ebp - 0xb0]
push eax
push esi
push ecx
push ebx
call edi
mov eax, dword [0x7ccd70]
add eax, 4
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49cf6c
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0xac]
push eax
push 4
push 0x6e5d74
push ebx
call edi
mov esi, dword [0x6e5d74]
test esi, esi
je 0x49cffe
mov eax, dword [0x7cc7e8]
shl esi, 4
cmp esi, eax
jg 0x49d3ca
mov ecx, dword [0x748da0]
sub eax, esi
add dword [0x7cc7f0], esi
mov dword [0x7cc7e8], eax
mov dword [ebp - 0xb0], ecx
mov dword [0x6e5d78], ecx
lea eax, [ecx + esi]
mov dword [0x748da0], eax
test ecx, ecx
je 0x49ccea
mov eax, dword [0x7ccd70]
add eax, esi
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49cff0
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov ecx, dword [ebp - 0xb0]
push 0
lea eax, [ebp - 0xac]
push eax
push esi
push ecx
push ebx
call edi
mov ecx, ebx
call fcn.0049bd10
test eax, eax
je 0x49ccea
mov ecx, ebx
call fcn.0049c070
test eax, eax
je 0x49ccea
mov ecx, ebx
call fcn.0049c330
test eax, eax
je 0x49ccea
mov eax, dword [0x7ccd70]
add eax, 0x2000
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49d050
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0xb4]
push eax
push 0x2000
push 0x7ccd78
push ebx
call edi
mov eax, 0x7ccd78
nop dword [eax + eax]
mov byte [eax], 0
add eax, 0x100
cmp eax, 0x7cee78
jl 0x49d070
mov ecx, 0x40
mov esi, 0x7ce578
mov edi, 0x7ced78
rep movsd dword es:[edi], dword [esi]
xor edi, edi
mov ecx, 0x7ccd78
nop word [eax + eax]
lea edx, [edi + 0x7cee78]
mov esi, 0x100
nop dword [eax + eax]
mov al, byte [ecx]
lea edx, [edx + 0x20]
inc ecx
mov byte [edx - 0x20], al
sub esi, 1
jne 0x49d0b0
inc edi
cmp ecx, 0x7ced78
jl 0x49d0a0
nop word [eax + eax]
movzx ecx, byte [esi + 0x7cc368]
mov eax, 0x55555556
add ecx, ecx
imul ecx
movzx ecx, byte [esi + 0x7cc369]
mov eax, edx
add ecx, ecx
shr eax, 0x1f
add eax, edx
mov byte [esi + 0x7d0e78], al
mov eax, 0x55555556
imul ecx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov byte [esi + 0x7d0e79], al
mov al, byte [esi + 0x7cc36a]
mov byte [esi + 0x7d0e7a], al
add esi, 3
cmp esi, 0x300
jl 0x49d0d0
mov eax, dword [0x7ccd70]
add eax, 2
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49d144
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0xac]
push 0
push eax
push 2
push 0x6e0d58
push ebx
call edi
mov ax, word [0x6e0d58]
test ax, ax
je 0x49d1d8
movsx esi, ax
mov eax, dword [0x7cc7e8]
shl esi, 4
cmp esi, eax
jg 0x49d3ca
mov ecx, dword [0x748da0]
sub eax, esi
add dword [0x7cc7f0], esi
mov dword [0x7cc7e8], eax
mov dword [ebp - 0xb0], ecx
lea eax, [ecx + esi]
mov dword [0x6e0d74], ecx
mov dword [0x748da0], eax
mov eax, dword [0x7ccd70]
add eax, esi
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49d1ca
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov ecx, dword [ebp - 0xb0]
push 0
lea eax, [ebp - 0xac]
push eax
push esi
push ecx
push ebx
call edi
mov eax, dword [0x7cc7e8]
mov dword [0x6e0e88], 0
cmp eax, 0x3860
jge 0x49d1f9
push eax
push 0x3860
jmp 0x49d3cc
mov ecx, dword [0x748da0]
sub eax, 0x3860
add dword [0x7cc7f0], 0x3860
mov dword [0x7cc7e8], eax
mov dword [0x6e0e8c], ecx
lea eax, [ecx + 0x3860]
mov dword [0x748da0], eax
mov eax, dword [0x7ccd70]
add eax, 2
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49d247
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0xb0]
push eax
push 2
lea eax, [ebp - 0xac]
push eax
push ebx
call edi
mov ax, word [ebp - 0xac]
test ax, ax
je 0x49d2b2
movsx esi, ax
mov eax, dword [0x6e0e8c]
mov dword [ebp - 0xb4], eax
mov eax, dword [0x7ccd70]
add eax, esi
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49d298
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0xb0]
push eax
push esi
push dword [ebp - 0xb4]
push ebx
call edi
mov eax, 1
jmp 0x49d2b4
xor eax, eax
mov dword [0x6e0e84], eax
xor ecx, ecx
nop dword [eax + eax]
mov al, byte [ecx + 0x7d1178]
lea ecx, [ecx + 1]
mov byte [ebp + ecx - 0xa9], al
test al, al
jne 0x49d2c0
mov ecx, ebx
call fcn.0049c740
test eax, eax
je 0x49ccea
xor ecx, ecx
nop word [eax + eax]
mov al, byte [ebp + ecx - 0xa8]
lea ecx, [ecx + 1]
mov byte [ebp + ecx - 0x59], al
test al, al
jne 0x49d2f0
mov cl, byte [ebp - 0x58]
lea eax, [ebp - 0x58]
test cl, cl
je 0x49d31d
nop dword [eax]
cmp cl, 0x2e
je 0x49d31d
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x49d310
push 0
push 0x80
push 3
push 0
mov dword [eax], 0x4d45442e
push 0
mov byte [eax + 4], 0
lea eax, [ebp - 0x58]
push DirectSoundEnumerateA
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x49d3ad
mov ecx, dword [0x7ccd70]
mov eax, dword [0x6e0e8c]
add ecx, 0x3860
mov dword [ebp - 0xb4], eax
mov dword [0x7ccd70], ecx
cmp ecx, 0x4000
jbe 0x49d384
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov eax, dword [ebp - 0xb4]
push 0
lea ecx, [ebp - 0xb0]
push ecx
push 0x3860
push eax
push esi
call edi
xor eax, eax
cmp dword [ebp - 0xb0], eax
push esi
setne al
mov dword [0x6e0e84], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004b557b
mov esp, ebp
pop ebp
ret
push eax
push esi
mov eax, dword [sym.imp.USER32.dll_wsprintfA]
push str.game_malloc__:_OUT_OF_MEMORY._Needed:__d__Free:__d
push 0x748fb8
call eax
add esp, 0x10
mov ecx, 0x748fb8
call fcn.004ad960
int3