//
// MusicDownloadManager::tryUpdateSFXLibrary from 0x10065f250 to 0x10065f3b7 (359 bytes)
//
// 3 xrefs:
// > SFXBrowser::onUpdateLibrary @ 0x10042e2d0
// > SFXBrowser::setupSFXBrowser @ 0x1004302d0
// > SFXBrowser::musicActionFinished @ 0x100431283
//
// This function is hookable on this platform (idp: pc, 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:34:55 +0000
//
void __fastcall MusicDownloadManager::tryUpdateSFXLibrary(__int64 a1)
{
unsigned int v1; // eax
char *v2; // rbx
char v3; // r12
char *Request; // r15
void *v5[3]; // [rsp+8h] [rbp-88h] BYREF
_WORD v6[8]; // [rsp+20h] [rbp-70h] BYREF
void *v7; // [rsp+30h] [rbp-60h]
__int128 v8; // [rsp+38h] [rbp-58h] BYREF
void *v9; // [rsp+48h] [rbp-48h]
__int128 v10; // [rsp+50h] [rbp-40h] BYREF
void *v11; // [rsp+60h] [rbp-30h]
v1 = *(unsigned __int8 *)(a1 + 368);
if ( (v1 & 1) != 0 )
{
if ( !*(_QWORD *)(a1 + 376) )
return;
}
else if ( !(v1 >> 1) )
{
return;
}
if ( !MusicDownloadManager::getDLObject(a1, "v_sfx_l") )
{
*(_BYTE *)(a1 + 432) = 1;
v2 = (char *)operator new(0x20u);
strcpy(v2, "/sfx/sfxlibrary_version.txt");
sub_10001AD30(v5, v2, 0x1Bu);
MusicDownloadManager::generateCustomContentURL((size_t *)&v8, a1);
if ( ((__int64)v5[0] & 1) != 0 )
operator delete(v5[2]);
v3 = v8;
if ( (v8 & 1) != 0 )
{
sub_10001AD30(&v10, v9, *((unsigned __int64 *)&v8 + 1));
}
else
{
v11 = v9;
v10 = v8;
}
v6[0] = 0;
Request = MusicDownloadManager::ProcessHttpGetRequest(
a1,
(__int64)&v10,
(__int64)v6,
(__int64)MusicDownloadManager::onTryUpdateSFXLibraryCompleted,
0,
0,
0);
if ( (v6[0] & 1) != 0 )
operator delete(v7);
if ( (v10 & 1) != 0 )
operator delete(v11);
MusicDownloadManager::addDLToActive(a1, "v_sfx_l", (__int64)Request);
if ( (v3 & 1) != 0 )
operator delete(v9);
operator delete(v2);
}
}