//
// MusicDownloadManager::getSongInfo from 0x140482950 to 0x140482c23 (723 bytes)
//
// 4 xrefs:
// > CustomSongWidget::onGetSongInfo @ 0x14016b797
// > CustomSongWidget::onDownload @ 0x14016bb01
// > CustomSongWidget::processNextMultiAsset @ 0x14016e669
// > ??> @ 0x1409289f4
//
// 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 11:32:45 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall MusicDownloadManager::getSongInfo(cocos2d::CCObject *a1, __int64 a2, char a3)
{
unsigned int v4; // r15d
char v6; // di
__int64 SongInfoObject; // rax
__int64 v8; // rbx
bool v9; // si
cocos2d::CCString *v10; // rax
const char *CString; // rbx
__int64 v12; // rdx
__int64 v13; // rcx
__int64 v14; // rax
__int64 v15; // rcx
cocos2d::CCString *v16; // rax
const char *v17; // rax
cocos2d::CCString *v18; // rax
char *v19; // rax
size_t v20; // rbx
size_t v21; // r8
cocos2d::CCString *v22; // rax
const char *v23; // rax
size_t v24; // r8
_QWORD *v25; // rdx
void *v26; // [rsp+40h] [rbp-69h]
__int128 v27; // [rsp+48h] [rbp-61h] BYREF
__int64 v28; // [rsp+58h] [rbp-51h]
__int64 v29; // [rsp+60h] [rbp-49h]
__int128 v30; // [rsp+68h] [rbp-41h] BYREF
__int64 v31; // [rsp+78h] [rbp-31h]
__int64 v32; // [rsp+80h] [rbp-29h]
__int128 *v33; // [rsp+88h] [rbp-21h]
__int128 v34; // [rsp+98h] [rbp-11h] BYREF
__int64 v35; // [rsp+A8h] [rbp-1h]
__int64 v36; // [rsp+B0h] [rbp+7h]
_QWORD Src[4]; // [rsp+B8h] [rbp+Fh] BYREF
v4 = a2;
v6 = 0;
SongInfoObject = MusicDownloadManager::getSongInfoObject(a1, a2);
v8 = SongInfoObject;
v9 = false;
if ( SongInfoObject && (*(_BYTE *)(SongInfoObject + 473) || !a3) )
{
sub_14003F4F0((__int64)&v34, SongInfoObject + 392);
v6 = 3;
if ( v35 )
v9 = true;
}
if ( (v6 & 1) != 0 )
sub_14003D310((__int64)&v34);
if ( v9 )
{
MusicDownloadManager::loadSongInfoFinished(a1, v8);
}
else
{
v10 = cocos2d::CCString::createWithFormat("i_%i", v4);
CString = cocos2d::CCString::getCString(v10);
if ( !AchievementManager::getAchievementsWithID((__int64)a1, (__int64)CString) )
{
v14 = cocos2d::CCNode::create(v13, v12);
MusicDownloadManager::addDLToActive(a1, CString, v14);
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v26 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v26);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
}
GameLevelManager::getBasePostString(v15, Src);
v16 = cocos2d::CCString::createWithFormat(
"%c%s%s%c%c%s",
87,
"mfd",
"2893",
103,
98,
(const char *)&word_14070D040);
v17 = cocos2d::CCString::getCString(v16);
v18 = cocos2d::CCString::createWithFormat("&songID=%i&secret=%s", v4, v17);
v19 = (char *)cocos2d::CCString::getCString(v18);
v20 = -1;
v21 = -1;
do
++v21;
while ( v19[v21] );
sub_140044D80(Src, v19, v21);
v33 = &v34;
v22 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, v4);
v23 = cocos2d::CCString::getCString(v22);
v30 = 0;
v31 = 0;
v32 = 0;
v24 = -1;
do
++v24;
while ( v23[v24] );
sub_14003D230(&v30, v23, v24);
v25 = Src;
if ( Src[3] > 0xFu )
v25 = (_QWORD *)Src[0];
v34 = 0;
v35 = 0;
v36 = 0;
do
++v20;
while ( *((_BYTE *)v25 + v20) );
sub_14003D230(&v34, v25, v20);
v27 = 0;
*(_QWORD *)&v27 = sub_14003D460(0x40u);
v28 = 52;
v29 = 63;
strcpy((char *)v27, "https://www.boomlings.com/database/getGJSongInfo.php");
MusicDownloadManager::ProcessHttpRequest(a1, (const char *)&v27, (const char *)&v34, (const char *)&v30, 21);
sub_14003D310((__int64)Src);
}
}
}