Function at 0x49c740
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x844
mov eax, dword [0x5153d4]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [0x7732a0], 0
push ebx
mov ebx, ecx
mov dword [0x6f27ac], 0
jne 0x49c77d
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b557b
mov esp, ebp
pop ebp
ret
push esi
mov esi, 0x7c7ad8
mov ecx, dword [esi]
test ecx, ecx
je 0x49c795
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov dword [esi], 0
add esi, 4
cmp esi, 0x7c7ed8
jl 0x49c783
mov eax, dword [0x7ccd70]
add eax, 0x2e4
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49c7c5
mov dword [0x7ccd70], 0
call fcn.00489cf0
push edi
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x804]
push 0
push eax
push 0x2e4
push 0x6f2d90
push ebx
call edi
mov eax, dword [0x7ccd70]
add eax, 4
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49c805
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0x804]
push eax
push 4
push 0x6f2d84
push ebx
call edi
mov esi, dword [0x6f2d84]
test esi, esi
je 0x49c9ad
mov eax, dword [0x7cc7e8]
shl esi, 3
cmp esi, eax
jg 0x49cc21
mov ecx, dword [0x748da0]
sub eax, esi
add dword [0x7cc7f0], esi
mov dword [0x7cc7e8], eax
mov dword [ebp - 0x810], ecx
lea eax, [ecx + esi]
mov dword [0x6f2d88], ecx
mov dword [0x748da0], eax
mov eax, dword [0x7ccd70]
add eax, esi
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49c885
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov ecx, dword [ebp - 0x810]
push 0
lea eax, [ebp - 0x804]
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 0x49c8b6
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0x804]
push eax
push 4
lea eax, [ebp - 0x808]
push eax
push ebx
call edi
mov eax, dword [ebp - 0x808]
test eax, eax
je 0x49c9ad
lea esi, [eax*4]
mov eax, dword [0x7ccd70]
add eax, esi
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49c902
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0x804]
push eax
push esi
lea eax, [ebp - 0x800]
push eax
push ebx
call edi
cmp byte [0x77333e], 0
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
je 0x49c960
push str.datagmain.sfx
push 0x50f46c
push 0x7d1178
call ebx
add esp, 0xc
push 0
push 0x80
push 3
push 0
push 0
push DirectSoundEnumerateA
push 0x7d1178
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov dword [ebp - 0x838], esi
jmp 0x49c999
push str.datamain.sfx
push 0x50f46c
push 0x7d1178
call ebx
add esp, 0xc
push 0
push 0x80
push 3
push 0
push 0
push DirectSoundEnumerateA
push 0x7d1178
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov dword [ebp - 0x838], eax
cmp esi, 0xffffffff
jne 0x49c9c0
push str.Could_not_open_MAIN.SFX_file
push 0x748fb8
call ebx
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b557b
mov esp, ebp
pop ebp
ret
xor ebx, ebx
mov dword [ebp - 0x83c], 0
cmp dword [ebp - 0x808], ebx
jle 0x49cbfa
nop dword [eax + eax]
mov eax, dword [0x7ccd70]
add eax, 0x2c
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49ca03
mov dword [0x7ccd70], 0
call fcn.00489cf0
push 0
lea eax, [ebp - 0x804]
push eax
push 0x2c
lea eax, [ebp - 0x30]
push eax
push esi
call edi
cmp dword [ebp - 0x30], 0x46464952
jne 0x49c9ad
cmp dword [ebp - 0x28], 0x45564157
jne 0x49c9ad
cmp dword [ebp - 0xc], 0x61746164
jne 0x49c9ad
mov eax, dword [ebp - 8]
mov dword [ebp - 0x840], eax
lea edi, [eax + 1]
xor eax, eax
mov word [ebp - 0xc], ax
and edi, 0xfffffffe
mov eax, dword [ebp - 0x83c]
cmp dword [ebp + ebx*4 - 0x800], eax
jne 0x49cbd6
mov eax, dword [0x7cc7e8]
lea esi, [edi + 3]
and esi, 0xfffffffc
cmp esi, eax
jg 0x49cc21
mov ecx, dword [0x748da0]
sub eax, esi
add dword [0x7cc7f0], esi
mov dword [0x7cc7e8], eax
mov dword [ebp - 0x844], ecx
lea eax, [ecx + esi]
mov dword [0x748da0], eax
mov eax, dword [0x7ccd70]
add eax, edi
mov dword [0x7ccd70], eax
cmp eax, 0x4000
jbe 0x49cab8
mov dword [0x7ccd70], 0
call fcn.00489cf0
mov ecx, dword [ebp - 0x844]
push 0
lea eax, [ebp - 0x804]
push eax
push edi
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
push ecx
push dword [ebp - 0x838]
call edi
cmp dword [0x7732a0], 0
je 0x49c9ad
cmp ebx, 0x100
jg 0x49c9ad
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x834], 0x24
mov dword [ebp - 0x824], eax
lea edx, [ebx*4 + 0x7c7ad8]
mov eax, dword [ebp - 0x840]
mov dword [ebp - 0x82c], eax
mov eax, dword [0x6f45c4]
push 0
push edx
mov dword [ebp - 0x830], 0xe2
lea edx, [ebp - 0x834]
mov dword [ebp - 0x828], 0
mov ecx, dword [eax]
push edx
push eax
call dword [ecx + 0xc]
test eax, eax
js 0x49c9ad
mov eax, dword [ebx*4 + 0x7c7ad8]
lea edx, [ebp - 0x80c]
push 0
push 0
push 0
mov ecx, dword [eax]
push edx
lea edx, [ebp - 0x810]
push edx
push dword [ebp - 0x840]
push 0
push eax
call dword [ecx + 0x2c]
test eax, eax
js 0x49c9ad
push dword [ebp - 0x80c]
push dword [ebp - 0x844]
push dword [ebp - 0x810]
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebx*4 + 0x7c7ad8]
add esp, 0xc
mov ecx, dword [eax]
push 0
push 0
push dword [ebp - 0x80c]
push dword [ebp - 0x810]
push eax
call dword [ecx + 0x4c]
test eax, eax
js 0x49c9ad
mov eax, dword [ebp - 0x18]
sub dword [0x748da0], esi
add dword [0x7cc7e8], esi
sub dword [0x7cc7f0], esi
mov esi, dword [ebp - 0x838]
mov dword [ebx*4 + 0x7c7ed8], eax
inc ebx
jmp 0x49cbe8
push 1
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
inc dword [ebp - 0x83c]
cmp ebx, dword [ebp - 0x808]
jl 0x49c9e0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
mov dword [0x6f27ac], 1
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