//
// GameLevelManager::rateDemon from 0x4b6d0c to 0x4b6ece (450 bytes)
//
// 1 xrefs:
// > RateDemonLayer::onRate @ 0x616664
//
// 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:50:09 +0000
//
int __fastcall GameLevelManager::rateDemon(GameLevelManager *this, const char *a2, int a3, int a4)
{
int v8; // r2
int v9; // r3
cocos2d::CCString *v11; // r0
const char *CString; // r0
int v13; // r7
const char *v14; // r9
size_t v15; // r0
int v16; // r7
cocos2d::CCNode *v17; // r0
cocos2d::CCObject *v18; // r0
size_t v19; // r0
cocos2d::CCString *v20; // r0
int v21; // r0
cocos2d::CCString *v22; // r0
char *v23; // r0
const char *v24; // r1
size_t v25; // r0
size_t v26; // r0
cocos2d::CCObject *v27; // [sp+10h] [bp-44h]
cocos2d::CCObject *v28; // [sp+10h] [bp-44h]
int v29; // [sp+14h] [bp-40h]
char *v30[3]; // [sp+1Ch] [bp-38h] BYREF
int v31[3]; // [sp+28h] [bp-2Ch] BYREF
int v32[3]; // [sp+34h] [bp-20h] BYREF
int v33; // [sp+40h] [bp-14h] BYREF
int v34; // [sp+44h] [bp-10h]
int v35; // [sp+48h] [bp-Ch]
if ( !a4 )
{
if ( GameLevelManager::hasRatedDemon(this, a2) )
return 0;
GameLevelManager::markLevelAsRatedDemon((cocos2d::CCDictionary **)this, a2, v8, v9);
}
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"rd_%i_%i", a2, a3);
CString = (const char *)cocos2d::CCString::getCString(v11);
v33 = 0;
v34 = 0;
v35 = 0;
v13 = *((_DWORD *)this + 187);
v14 = CString;
v15 = strlen(CString);
std::string::__init(&v33, v14, v15);
v16 = cocos2d::CCDictionary::objectForKey(v13, &v33);
v17 = (cocos2d::CCNode *)std::string::~string((int)&v33);
if ( v16 )
return 0;
v29 = *((_DWORD *)this + 187);
v18 = (cocos2d::CCObject *)cocos2d::CCNode::create(v17);
v33 = 0;
v34 = 0;
v35 = 0;
v27 = v18;
v19 = strlen(v14);
std::string::__init(&v33, v14, v19);
cocos2d::CCDictionary::setObject(v29, v27);
std::string::~string((int)&v33);
GameLevelManager::getBasePostString((GameLevelManager *)v30);
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfp",
"3879",
103,
99,
&a1i2r3e45s789g[4]);
v21 = cocos2d::CCString::getCString(v20);
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&levelID=%i&rating=%i&secret=%s",
a2,
a3,
v21);
v23 = (char *)cocos2d::CCString::getCString(v22);
std::string::append(v30, v23);
if ( a4 )
std::string::append(v30, "&mode=1");
memset(v31, 0, sizeof(v31));
std::string::__init(v31, "https://www.boomlings.com/database/rateGJDemon21.php", 0x34u);
v32[0] = 0;
v32[1] = 0;
if ( ((int)v30[0] & 1) == 0 )
v24 = (char *)v30 + 1;
v32[2] = 0;
if ( ((int)v30[0] & 1) != 0 )
v24 = v30[2];
v28 = (cocos2d::CCObject *)v24;
v25 = strlen(v24);
std::string::__init(v32, v28, v25);
v33 = 0;
v34 = 0;
v35 = 0;
v26 = strlen(v14);
std::string::__init(&v33, v14, v26);
GameLevelManager::ProcessHttpRequest(this, v31, (int)v32, (int)&v33, 56);
std::string::~string((int)&v33);
std::string::~string((int)v32);
std::string::~string((int)v31);
std::string::~string((int)v30);
return 1;
}