//
// GameLevelManager::rateDemon from 0x82105c to 0x8213c0 (868 bytes)
//
// 2 xrefs:
// > RateDemonLayer::onRate @ 0xa84088
// > ??> @ 0x6e980
//
// 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:55:01 +0000
//
__int64 __fastcall GameLevelManager::rateDemon(GameLevelManager *this, char *a2, unsigned int a3, unsigned __int8 a4)
{
unsigned int v5; // w23
int v6; // w22
cocos2d::CCString *v9; // x0
const char *CString; // x0
char *v11; // x25
size_t v12; // x0
__int64 v13; // x26
__int64 v14; // x26
cocos2d::CCNode *v15; // x0
__int64 v16; // x27
cocos2d::CCObject *v17; // x26
size_t v18; // x0
cocos2d::CCString *v19; // x0
__int64 v20; // x0
cocos2d::CCString *v21; // x0
size_t v22; // x0
const char *v23; // x1
size_t v24; // x0
size_t v25; // x0
char *v26; // [xsp+68h] [xbp+68h]
char *v27; // [xsp+68h] [xbp+68h]
__int64 v28[2]; // [xsp+78h] [xbp+78h] BYREF
void *v29; // [xsp+88h] [xbp+88h]
__int64 v30[2]; // [xsp+90h] [xbp+90h] BYREF
void *v31; // [xsp+A0h] [xbp+A0h]
__int64 v32[2]; // [xsp+A8h] [xbp+A8h] BYREF
void *v33; // [xsp+B8h] [xbp+B8h]
cocos2d::CCNode *v34; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v35; // [xsp+C8h] [xbp+C8h]
void *v36; // [xsp+D0h] [xbp+D0h]
v5 = (unsigned int)a2;
v6 = a4;
if ( !a4 )
{
if ( GameLevelManager::hasRatedDemon(this, a2) )
return 0;
GameLevelManager::markLevelAsRatedDemon((cocos2d::CCDictionary **)this, v5);
}
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"rd_%i_%i", (const char *)v5, a3);
CString = (const char *)cocos2d::CCString::getCString(v9);
v34 = nullptr;
v11 = (char *)CString;
v35 = 0;
v36 = nullptr;
v12 = strlen(CString);
v13 = *((_QWORD *)this + 136);
std::string::__init((__int64 *)&v34, v11, v12);
v14 = cocos2d::CCDictionary::objectForKey(v13, &v34);
v15 = (cocos2d::CCNode *)(unsigned __int8)v34;
if ( ((unsigned __int8)v34 & 1) != 0 )
{
operator delete(v36);
if ( v14 )
return 0;
}
else if ( v14 )
{
return 0;
}
v16 = *((_QWORD *)this + 136);
v17 = (cocos2d::CCObject *)cocos2d::CCNode::create(v15);
v34 = nullptr;
v35 = 0;
v36 = nullptr;
v18 = strlen(v11);
std::string::__init((__int64 *)&v34, v11, v18);
cocos2d::CCDictionary::setObject(v16, v17);
if ( ((unsigned __int8)v34 & 1) != 0 )
operator delete(v36);
GameLevelManager::getBasePostString(v28);
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfp",
"3879",
103,
99,
"3");
v20 = cocos2d::CCString::getCString(v19);
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&levelID=%i&rating=%i&secret=%s",
(const char *)v5,
a3,
v20);
v26 = (char *)cocos2d::CCString::getCString(v21);
v22 = strlen(v26);
std::string::append((__int64)v28, v26, v22);
if ( v6 )
std::string::append((__int64)v28, "&mode=1", 7u);
v30[0] = 0;
v30[1] = 0;
v31 = nullptr;
std::string::__init(v30, "https://www.boomlings.com/database/rateGJDemon21.php", 0x34u);
v23 = (char *)v28 + 1;
if ( (v28[0] & 1) != 0 )
v23 = (const char *)v29;
v27 = (char *)v23;
v32[0] = 0;
v32[1] = 0;
v33 = nullptr;
v24 = strlen(v23);
std::string::__init(v32, v27, v24);
v34 = nullptr;
v35 = 0;
v36 = nullptr;
v25 = strlen(v11);
std::string::__init((__int64 *)&v34, v11, v25);
GameLevelManager::ProcessHttpRequest(this, v30, (__int64)v32, (char *)&v34, 56);
if ( ((unsigned __int8)v34 & 1) != 0 )
operator delete(v36);
if ( (v32[0] & 1) != 0 )
operator delete(v33);
if ( (v30[0] & 1) != 0 )
operator delete(v31);
if ( (v28[0] & 1) != 0 )
operator delete(v29);
return 1;
}