//
// MusicDownloadManager::getSongInfo from 0x56ea28 to 0x56ebb2 (394 bytes)
//
// 3 xrefs:
// > CustomSongWidget::onGetSongInfo @ 0x4e25e6
// > CustomSongWidget::processNextMultiAsset @ 0x4e5870
// > CustomSongWidget::onDownload @ 0x4e5c66
//
// 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:35 +0000
//
unsigned int __fastcall MusicDownloadManager::getSongInfo(MusicDownloadManager *this, const char *a2, int a3)
{
const char *v3; // r10
cocos2d::CCDictionary *SongInfoObject; // r0
SongInfoObject *v8; // r7
int v9; // r6
unsigned int result; // r0
const char *SongInfoKey; // r6
int v12; // r2
int v13; // r3
GameLevelManager *v14; // r0
cocos2d::CCString *v15; // r0
int CString; // r0
cocos2d::CCString *v17; // r0
char *v18; // r0
size_t v19; // r0
cocos2d::CCString *v20; // r0
const char *v21; // r10
size_t v22; // r0
char *v23[3]; // [sp+14h] [bp-34h] BYREF
int v24[3]; // [sp+20h] [bp-28h] BYREF
int v25[3]; // [sp+2Ch] [bp-1Ch] BYREF
int v26; // [sp+38h] [bp-10h] BYREF
int v27; // [sp+3Ch] [bp-Ch]
int v28; // [sp+40h] [bp-8h]
SongInfoObject = MusicDownloadManager::getSongInfoObject(this, a2);
v8 = SongInfoObject;
if ( SongInfoObject && (*((_BYTE *)SongInfoObject + 329) || !a3) )
{
std::string::basic_string(&v26, (int)SongInfoObject + 292);
v9 = (v26 & 1) != 0 ? v27 : (int)(unsigned __int8)v26 >> 1;
std::string::~string((int)&v26);
if ( v9 )
return MusicDownloadManager::loadSongInfoFinished((cocos2d::CCArray **)this, v8);
}
SongInfoKey = (const char *)MusicDownloadManager::getSongInfoKey(this, a2);
result = MusicDownloadManager::isDLActive(this, SongInfoKey);
if ( !result )
{
v14 = (GameLevelManager *)MusicDownloadManager::addDLToActive(this, SongInfoKey, v12, v13);
GameLevelManager::sharedState(v14);
GameLevelManager::getBasePostString((GameLevelManager *)v23);
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&a1i2r3e45s789g[9]);
CString = cocos2d::CCString::getCString(v15);
v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&songID=%i&secret=%s",
a2,
CString);
v18 = (char *)cocos2d::CCString::getCString(v17);
std::string::append(v23, v18);
memset(v24, 0, sizeof(v24));
std::string::__init(v24, "https://www.boomlings.com/database/getGJSongInfo.php", 0x34u);
if ( ((int)v23[0] & 1) == 0 )
v3 = (char *)v23 + 1;
v25[0] = 0;
if ( ((int)v23[0] & 1) != 0 )
v3 = v23[2];
v25[1] = 0;
v25[2] = 0;
v19 = strlen(v3);
std::string::__init(v25, v3, v19);
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a2);
v21 = (const char *)cocos2d::CCString::getCString(v20);
v26 = 0;
v27 = 0;
v28 = 0;
v22 = strlen(v21);
std::string::__init(&v26, v21, v22);
MusicDownloadManager::ProcessHttpRequest(this, (int)v24, (int)v25, (int)&v26, 21);
std::string::~string((int)&v26);
std::string::~string((int)v25);
std::string::~string((int)v24);
return std::string::~string((int)v23);
}
return result;
}