//
// GameLevelManager::rateStars from 0x3d041c to 0x3d067e (610 bytes)
//
// 1 xrefs:
// > RateStarsLayer::onRate @ 0x4558c0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GameLevelManager::rateStars(GameLevelManager *a1, int a2, int a3)
{
GameManager *v6; // r0
cocos2d::CCString *v7; // r0
const char *CString; // r0
cocos2d::CCString *v9; // r0
char *v10; // r0
char *v11; // r7
GJAccountManager *v12; // r0
int v13; // r6
int v14; // r10
GameManager *v15; // r0
int v16; // r5
cocos2d::CCString *v17; // r0
const char *v18; // r0
cocos2d::CCString *v19; // r0
char *v20; // r0
const void *v21; // r0
unsigned __int8 *v22; // r3
char *v23; // r2
cocos2d::CCString *v24; // r0
char *v25; // r0
char *v26; // [sp+2Ch] [bp-70h] BYREF
char *v27; // [sp+30h] [bp-6Ch] BYREF
char *v28; // [sp+34h] [bp-68h] BYREF
int v29; // [sp+38h] [bp-64h] BYREF
cocos2d::ZipUtils v30; // [sp+3Ch] [bp-60h] BYREF
std::string v31; // [sp+40h] [bp-5Ch] BYREF
_BYTE v32[4]; // [sp+44h] [bp-58h] BYREF
char *v33; // [sp+48h] [bp-54h] BYREF
const char *v34; // [sp+4Ch] [bp-50h] BYREF
char *v35; // [sp+50h] [bp-4Ch] BYREF
unsigned __int8 v36[20]; // [sp+54h] [bp-48h] BYREF
unsigned __int8 v37[44]; // [sp+68h] [bp-34h] BYREF
v6 = GameManager::sharedState();
GameManager::reportAchievementWithID(v6, "geometry.ach.rateDiff", 100, 0);
if ( !GameLevelManager::hasRatedLevelStars(a1, a2) )
{
GameLevelManager::markLevelAsRatedStars(a1, a2);
GameLevelManager::getBasePostString((GameLevelManager *)&v26);
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&aO1i2r3e45s7t89[10]);
CString = cocos2d::CCString::getCString(v7);
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&levelID=%i&stars=%i&secret=%s",
(const char *)a2,
a3,
CString);
v10 = (char *)cocos2d::CCString::getCString(v9);
sub_774544((int)&v26, v10);
gen_random((int)&v27, 10);
sub_774544((int)&v26, "&rs=");
sub_774544((int)&v26, v27);
v11 = v27;
v12 = GJAccountManager::sharedState();
v13 = v12->m_accountID - v12->m_unkInt1;
GameManager::sharedState();
sub_775C20(&v29);
v14 = v29;
v15 = GameManager::sharedState();
v16 = v15->m_playerUserID.random - v15->m_playerUserID.seed;
v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_78 + 1,
"sg6",
"pUrt",
106,
110,
"0J");
v18 = cocos2d::CCString::getCString(v17);
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i%i%s%i%s%i%s",
(const char *)a2,
a3,
v11,
v13,
v14,
v16,
v18);
v20 = (char *)cocos2d::CCString::getCString(v19);
sub_776584((int)&v28, v20);
sub_774008(&v29);
v21 = (const void *)strlen(v28);
rtsha1::calc((rtsha1 *)v28, v21, (int)v36, v22);
rtsha1::toHexString((rtsha1 *)v36, v37, v23);
sub_776584((int)&v31, (char *)v37);
sub_776584((int)v32, "58281");
cocos2d::ZipUtils::base64EncodeEnc(&v30, &v31, (std::string)v32);
sub_774008(v32);
sub_774008(&v31);
sub_774544((int)&v26, "&chk=");
sub_77441C(&v26, &v30);
sub_776584((int)&v33, "https://www.boomlings.com/database/rateGJStars211.php");
sub_776584((int)&v34, v26);
v24 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)a2);
v25 = (char *)cocos2d::CCString::getCString(v24);
sub_776584((int)&v35, v25);
GameLevelManager::ProcessHttpRequest(a1, &v33, &v34, &v35, 6);
sub_774008(&v35);
sub_774008(&v34);
sub_774008(&v33);
sub_774008(&v30);
sub_774008(&v28);
sub_774008(&v27);
sub_774008(&v26);
}
}