Function at 0x5157e4
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff4
push ebx
push esi
push edi
mov dword [ebp - 4], edx
mov edi, eax
mov eax, dword [ebp - 4]
call fcn.004040c8
xor eax, eax
push ebp
push 0x515a34
push dword fs:[eax]
mov dword fs:[eax], esp
xor ebx, ebx
mov eax, dword [ebp - 4]
call fcn.00408adc
test al, al
je 0x515a1e
cmp byte [edi + 0x4c], 0
je 0x515827
mov eax, edi
call fcn.00515adc
push 0
push 0x80
push 3
push 0
push 3
push 0x80000000
mov eax, dword [ebp - 4]
call fcn.004040d8
push eax
call sub.kernel32.dll_CreateFileA_1
mov esi, eax
cmp esi, 0xffffffff
je 0x515a1e
push 0
lea eax, [ebp - 8]
push eax
push 4
lea eax, [ebp - 0xc]
push eax
push esi
call sub.kernel32.dll_ReadFile_1
test eax, eax
jne 0x515890
lea eax, [edi + 0x1054]
mov edx, 0x515a4c
call fcn.00403ce8
push edi
push fcn.00515744
mov eax, edi
call fcn.00417db0
push esi
call sub.kernel32.dll_CloseHandle_1
jmp 0x515a1e
cmp dword [ebp - 8], 4
je 0x5158be
lea eax, [edi + 0x1054]
mov edx, 0x515a70
call fcn.00403ce8
push edi
push fcn.00515744
mov eax, edi
call fcn.00417db0
push esi
call sub.kernel32.dll_CloseHandle_1
jmp 0x515a1e
push esi
call sub.kernel32.dll_CloseHandle_1
xor eax, eax
mov dword [ebp - 8], eax
push 0
push 0x8000080
push 3
push 0
push 3
push 0x80000000
mov eax, dword [ebp - 4]
call fcn.004040d8
push eax
call sub.kernel32.dll_CreateFileA_1
mov esi, eax
mov dword [edi + 0x3c], esi
cmp esi, 0xffffffff
jne 0x515915
lea eax, [edi + 0x1054]
mov edx, 0x515a9c
call fcn.00403ce8
push edi
push fcn.00515744
mov eax, edi
call fcn.00417db0
jmp 0x515a1e
lea eax, [ebp - 0xc]
push eax
movsx eax, byte [edi + 0x34]
push eax
call sub.XPlayDLL.dll_X_PlayM4_GetFileHeadLength
mov dword [edi + 0x44], eax
push 0
push edi
mov eax, 0x515694
push eax
push 0x2800
movsx eax, byte [edi + 0x34]
push eax
call sub.XPlayDLL.dll_X_PlayM4_SetSourceBufCallBack
push 1
movsx eax, byte [edi + 0x34]
push eax
call sub.XPlayDLL.dll_X_PlayM4_SetStreamOpenMode
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [edi + 0x44]
push eax
lea eax, [edi + 0x54]
push eax
mov eax, dword [edi + 0x3c]
push eax
call sub.kernel32.dll_ReadFile_1
test eax, eax
jne 0x515990
lea eax, [edi + 0x1054]
mov edx, 0x515a4c
call fcn.00403ce8
push edi
push fcn.00515744
mov eax, edi
call fcn.00417db0
mov eax, dword [edi + 0x3c]
push eax
call sub.kernel32.dll_CloseHandle_1
jmp 0x515a1e
mov eax, dword [ebp - 8]
cmp eax, dword [edi + 0x44]
je 0x5159b7
lea eax, [edi + 0x1054]
mov edx, 0x515a70
call fcn.00403ce8
push edi
push fcn.00515744
mov eax, edi
call fcn.00417db0
jmp 0x515a1e
mov eax, dword [edi + 0x44]
push eax
lea eax, [edi + 0x54]
push eax
movsx eax, byte [edi + 0x34]
push eax
call sub.XPlayDLL.dll_X_PlayM4_OpenStream
test eax, eax
jne 0x5159f5
lea eax, [edi + 0x1054]
mov edx, 0x515ac0
call fcn.00403ce8
push edi
push fcn.00515744
mov eax, edi
call fcn.00417db0
mov eax, dword [edi + 0x3c]
push eax
call sub.kernel32.dll_CloseHandle_1
jmp 0x515a1e
push 0
movsx eax, byte [edi + 0x34]
push eax
call sub.XPlayDLL.dll_X_PlayM4_ThrowBFrameNum
mov byte [edi + 0x4c], 4
push 0
push 0
push 0xffffffffffffffff
push 0
call sub.kernel32.dll_CreateEventA
mov dword [edi + 0x50], eax
mov eax, edi
call fcn.00515b30
mov bl, 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x515a3b
lea eax, [ebp - 4]
call fcn.00403c94
ret