//
// MusicDownloadManager::onDownloadMusicLibraryCompleted from 0x978c4c to 0x978d94 (328 bytes)
//
// 3 xrefs:
// > ??> @ 0xe4958
// > MusicDownloadManager::downloadMusicLibrary @ 0x968c94
// > ??> @ 0x1546de8
//
// 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:45 +0000
//
__int64 __fastcall MusicDownloadManager::onDownloadMusicLibraryCompleted(
MusicDownloadManager *this,
cocos2d::extension::CCHttpClient *a2,
const void **a3)
{
const char *v6; // x0
FILE *v7; // x22
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_music_l");
if ( a3 && *((_BYTE *)a3 + 64) )
{
MusicDownloadManager::pathForSongFolder(this, 0, (__int64)&v8);
std::string::append((__int64)&v8, "musiclibrary.dat", 0x10u);
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::parseMusicLibrary(this),
MusicDownloadManager::isMusicLibraryLoaded(this)) )
{
MusicDownloadManager::musicActionFinished((__int64)this, 7u);
}
else
{
MusicDownloadManager::musicActionFailed((__int64)this, 7u);
}
if ( (v8 & 1) != 0 )
operator delete(v10);
}
else
{
MusicDownloadManager::musicActionFailed((__int64)this, 7u);
}
return _stack_chk_guard;
}