//
// MusicDownloadManager::onDownloadSFXLibraryCompleted from 0x572348 to 0x5723f6 (174 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:52:38 +0000
//
unsigned int __fastcall MusicDownloadManager::onDownloadSFXLibraryCompleted(
MusicDownloadManager *this,
cocos2d::extension::CCHttpClient *a2,
cocos2d::extension::CCHttpResponse *a3,
int a4)
{
char *v6; // r0
FILE *v7; // r8
_DWORD v9[2]; // [sp+0h] [bp-10h] BYREF
char *filename; // [sp+8h] [bp-8h]
int v11; // [sp+Ch] [bp-4h]
v9[0] = this;
v9[1] = a2;
filename = (char *)a3;
v11 = a4;
MusicDownloadManager::removeDLFromActive(this, "dl_sfx_l");
if ( !a3 || !*((_BYTE *)a3 + 56) )
return MusicDownloadManager::musicActionFailed((int)this, 1);
MusicDownloadManager::pathForSFXFolder((MusicDownloadManager *)v9, this, 0);
std::string::append(v9, "sfxlibrary.dat");
if ( (v9[0] & 1) != 0 )
v6 = filename;
else
v6 = (char *)v9 + 1;
v7 = fopen(v6, "wb");
if ( v7 )
{
fwrite(*((const void **)a3 + 15), 1u, *((_DWORD *)a3 + 16) - *((_DWORD *)a3 + 15), v7);
fclose(v7);
MusicDownloadManager::parseSFXLibrary((cocos2d::CCArray **)this);
MusicDownloadManager::musicActionFinished((int)this, 1);
}
else
{
MusicDownloadManager::musicActionFailed((int)this, 1);
}
return std::string::~string((int)v9);
}