//
// MusicDownloadManager::onDownloadSFXLibraryCompleted from 0x96c9d0 to 0x96cb08 (312 bytes)
//
// 3 xrefs:
// > ??> @ 0xe67a0
// > MusicDownloadManager::downloadSFXLibrary @ 0x9695a0
// > ??> @ 0x1546ef8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:57:39 +0000
//
__int64 __fastcall MusicDownloadManager::onDownloadSFXLibraryCompleted(
MusicDownloadManager *this,
cocos2d::extension::CCHttpClient *a2,
const void **a3)
{
const char *v6; // x0
FILE *v7; // x21
char v8; // [xsp+30h] [xbp+30h] BYREF
_BYTE v9[7]; // [xsp+31h] [xbp+31h] BYREF
void *v10; // [xsp+40h] [xbp+40h]
MusicDownloadManager::removeDLFromActive(this, "dl_sfx_l");
if ( a3 && *((_BYTE *)a3 + 64) )
{
MusicDownloadManager::pathForSFXFolder(this, 0, (__int64)&v8);
std::string::append((__int64)&v8, "sfxlibrary.dat", 0xEu);
v6 = v9;
if ( (v8 & 1) != 0 )
v6 = (const char *)v10;
v7 = fopen(v6, "wb");
if ( v7 )
{
fwrite(a3[9], 1u, (_BYTE *)a3[10] - (_BYTE *)a3[9], v7);
fclose(v7);
MusicDownloadManager::parseSFXLibrary((cocos2d::CCArray **)this);
MusicDownloadManager::musicActionFinished((__int64)this, 1u);
}
else
{
MusicDownloadManager::musicActionFailed((__int64)this, 1u);
}
if ( (v8 & 1) != 0 )
operator delete(v10);
}
else
{
MusicDownloadManager::musicActionFailed((__int64)this, 1u);
}
return _stack_chk_guard;
}