//
// GameLevelManager::rateStars from 0x8206f4 to 0x820cc0 (1484 bytes)
//
// 2 xrefs:
// > RateStarsLayer::onRate @ 0x957914
// > ??> @ 0x65110
//
// 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::rateStars(cocos2d::CCDictionary **this, unsigned int a2, unsigned int a3)
{
GameManager *v6; // x0
cocos2d::CCString *v8; // x0
__int64 CString; // x0
cocos2d::CCString *v10; // x0
size_t v11; // x0
const char *v12; // x1
size_t v13; // x0
char *v14; // x26
__int64 v15; // x0
int v16; // w28
GameManager *v17; // x0
unsigned int v18; // w28
__int64 v19; // x2
char v20; // w0
GameManager *v21; // x0
__int64 v22; // x1
char *v23; // x25
__int64 v24; // x0
unsigned int v25; // w27
cocos2d::CCString *v26; // x0
__int64 v27; // x0
cocos2d::CCString *v28; // x0
const char *v29; // x0
size_t v30; // x0
char *v31; // x25
unsigned int v32; // w0
unsigned __int8 *v33; // x3
char *v34; // x2
size_t v35; // x0
size_t v36; // x2
char *v37; // x1
const char *v38; // x1
size_t v39; // x0
cocos2d::CCString *v40; // x0
size_t v41; // x0
char *v42; // [xsp+68h] [xbp+68h]
char *v43; // [xsp+68h] [xbp+68h]
char *v44; // [xsp+68h] [xbp+68h]
char *v45; // [xsp+68h] [xbp+68h]
char *v46; // [xsp+68h] [xbp+68h]
__int64 v47[2]; // [xsp+70h] [xbp+70h] BYREF
char *v48; // [xsp+80h] [xbp+80h]
__int64 v49[2]; // [xsp+88h] [xbp+88h] BYREF
char *v50; // [xsp+98h] [xbp+98h]
__int64 v51[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v52; // [xsp+B0h] [xbp+B0h]
GameManager *v53; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v54; // [xsp+C0h] [xbp+C0h]
void *v55; // [xsp+C8h] [xbp+C8h]
void *v56[2]; // [xsp+D0h] [xbp+D0h] BYREF
void *v57; // [xsp+E0h] [xbp+E0h]
__int64 v58[2]; // [xsp+E8h] [xbp+E8h] BYREF
void *v59; // [xsp+F8h] [xbp+F8h]
__int64 v60[2]; // [xsp+100h] [xbp+100h] BYREF
void *v61; // [xsp+110h] [xbp+110h]
__int64 v62[2]; // [xsp+118h] [xbp+118h] BYREF
void *v63; // [xsp+128h] [xbp+128h]
__int64 v64[2]; // [xsp+130h] [xbp+130h] BYREF
void *v65; // [xsp+140h] [xbp+140h]
__int64 v66[2]; // [xsp+148h] [xbp+148h] BYREF
void *v67; // [xsp+158h] [xbp+158h]
unsigned __int8 v68[24]; // [xsp+160h] [xbp+160h] BYREF
unsigned __int8 v69[48]; // [xsp+178h] [xbp+178h] BYREF
v6 = (GameManager *)GameManager::sharedState(_stack_chk_guard);
GameManager::reportAchievementWithID(v6, "geometry.ach.rateDiff", 100, 0);
if ( !GameLevelManager::hasRatedLevelStars((GameLevelManager *)this, (const char *)a2) )
{
GameLevelManager::markLevelAsRatedStars(this, a2);
GameLevelManager::getBasePostString(v47);
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
CString = cocos2d::CCString::getCString(v8);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&levelID=%i&stars=%i&secret=%s",
(const char *)a2,
a3,
CString);
v42 = (char *)cocos2d::CCString::getCString(v10);
v11 = strlen(v42);
std::string::append((__int64)v47, v42, v11);
gen_random(10, v49);
std::string::append((__int64)v47, "&rs=", 4u);
v12 = (char *)v49 + 1;
if ( (v49[0] & 1) != 0 )
v12 = v50;
v43 = (char *)v12;
v13 = strlen(v12);
std::string::append((__int64)v47, v43, v13);
v14 = (char *)v49 + 1;
if ( (v49[0] & 1) != 0 )
v14 = v50;
v15 = GJAccountManager::sharedState((GJAccountManager *)LOBYTE(v49[0]));
v16 = *(_DWORD *)(v15 + 352);
v17 = (GameManager *)*(unsigned int *)(v15 + 356);
v18 = v16 - (_DWORD)v17;
v19 = GameManager::sharedState(v17) + 608;
v20 = *(_BYTE *)v19;
v53 = nullptr;
v54 = 0;
v55 = nullptr;
if ( (v20 & 1) != 0 )
{
std::string::__init((__int64 *)&v53, *(void **)(v19 + 16), *(_QWORD *)(v19 + 8));
}
else
{
v21 = *(GameManager **)v19;
v22 = *(_QWORD *)(v19 + 8);
v55 = *(void **)(v19 + 16);
v53 = v21;
v54 = v22;
}
v23 = (char *)&v53 + 1;
if ( ((unsigned __int8)v53 & 1) != 0 )
v23 = (char *)v55;
v24 = GameManager::sharedState((GameManager *)(unsigned __int8)v53);
v25 = *(_DWORD *)(v24 + 660) - *(_DWORD *)(v24 + 664);
v26 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_78 + 1,
"sg6",
"pUrt",
106,
110,
"0J");
v27 = cocos2d::CCString::getCString(v26);
v28 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i%i%s%i%s%i%s",
(const char *)a2,
a3,
v14,
v18,
v23,
v25,
v27);
v29 = (const char *)cocos2d::CCString::getCString(v28);
v51[0] = 0;
v51[1] = 0;
v44 = (char *)v29;
v52 = nullptr;
v30 = strlen(v29);
std::string::__init(v51, v44, v30);
if ( ((unsigned __int8)v53 & 1) != 0 )
operator delete(v55);
v31 = (char *)v51 + 1;
if ( (v51[0] & 1) != 0 )
v31 = (char *)v52;
v32 = strlen(v31);
rtsha1::calc((rtsha1 *)v31, (const void *)v32, (__int64)v68, v33);
rtsha1::toHexString((rtsha1 *)v68, v69, v34);
v58[0] = 0;
v58[1] = 0;
v59 = nullptr;
v35 = strlen((const char *)v69);
std::string::__init(v58, v69, v35);
v60[0] = 0;
v60[1] = 0;
v61 = nullptr;
std::string::__init(v60, "58281", 5u);
cocos2d::ZipUtils::base64EncodeEnc(v56, v58, v60);
if ( (v60[0] & 1) != 0 )
operator delete(v61);
if ( (v58[0] & 1) != 0 )
operator delete(v59);
std::string::append((__int64)v47, "&chk=", 5u);
if ( ((__int64)v56[0] & 1) != 0 )
{
v37 = (char *)v57;
v36 = (size_t)v56[1];
}
else
{
v36 = LOBYTE(v56[0]) >> 1;
v37 = (char *)v56 + 1;
}
std::string::append((__int64)v47, v37, v36);
v62[0] = 0;
v62[1] = 0;
v63 = nullptr;
std::string::__init(v62, "https://www.boomlings.com/database/rateGJStars211.php", 0x35u);
v38 = (char *)v47 + 1;
if ( (v47[0] & 1) != 0 )
v38 = v48;
v45 = (char *)v38;
v64[0] = 0;
v64[1] = 0;
v65 = nullptr;
v39 = strlen(v38);
std::string::__init(v64, v45, v39);
v40 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)a2);
v46 = (char *)cocos2d::CCString::getCString(v40);
v66[0] = 0;
v66[1] = 0;
v67 = nullptr;
v41 = strlen(v46);
std::string::__init(v66, v46, v41);
GameLevelManager::ProcessHttpRequest((cocos2d::CCObject *)this, v62, (__int64)v64, (char *)v66, 6);
if ( (v66[0] & 1) != 0 )
operator delete(v67);
if ( (v64[0] & 1) != 0 )
operator delete(v65);
if ( (v62[0] & 1) != 0 )
operator delete(v63);
if ( ((__int64)v56[0] & 1) != 0 )
operator delete(v57);
if ( (v51[0] & 1) != 0 )
operator delete(v52);
if ( (v49[0] & 1) != 0 )
operator delete(v50);
if ( (v47[0] & 1) != 0 )
operator delete(v48);
}
return _stack_chk_guard;
}