//
// GameLevelManager::getGJSecretReward from 0x3d3bac to 0x3d3d3a (398 bytes)
//
// 1 xrefs:
// > SecretLayer5::onSubmit @ 0x59ecd4
//
// 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
//
int __fastcall GameLevelManager::getGJSecretReward(GameLevelManager *a1, const char **a2)
{
GameManager *v3; // r0
cocos2d::CCString *v4; // r0
char *CString; // r0
const char *v6; // r8
cocos2d::CCString *v7; // r0
const char *v8; // r9
cocos2d::CCString *v9; // r0
char *v10; // r0
char *v13; // [sp+1Ch] [bp-28h] BYREF
std::string v14; // [sp+20h] [bp-24h] BYREF
int v15; // [sp+24h] [bp-20h] BYREF
_BYTE v16[4]; // [sp+28h] [bp-1Ch] BYREF
int v17; // [sp+2Ch] [bp-18h] BYREF
char *v18; // [sp+30h] [bp-14h] BYREF
const char *v19; // [sp+34h] [bp-10h] BYREF
char *v20; // [sp+38h] [bp-Ch] BYREF
if ( GameLevelManager::isDLActive(a1, "get_sreward") )
return 0;
GameLevelManager::addDLToActive(a1, "get_sreward");
GameLevelManager::getBasePostString((GameLevelManager *)&v13);
v3 = GameManager::sharedState();
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(v3->m_chk.random - v3->m_chk.seed));
CString = (char *)cocos2d::CCString::getCString(v4);
sub_776584((int)&v14, CString);
sub_776584((int)v16, "59182");
cocos2d::ZipUtils::base64EncodeEnc((cocos2d::ZipUtils *)&v15, &v14, (std::string)v16);
sub_774008(v16);
v6 = *a2;
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]);
v8 = cocos2d::CCString::getCString(v7);
gen_random((int)&v17, 5);
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&rewardKey=%s&secret=%s&chk=%s%s",
v6,
v8,
v17,
v15);
v10 = (char *)cocos2d::CCString::getCString(v9);
sub_774544((int)&v13, v10);
sub_774008(&v17);
sub_776584((int)&v18, "https://www.boomlings.com/database/getGJSecretReward.php");
sub_776584((int)&v19, v13);
sub_776584((int)&v20, "get_sreward");
GameLevelManager::ProcessHttpRequest(a1, &v18, &v19, &v20, 64);
sub_774008(&v20);
sub_774008(&v19);
sub_774008(&v18);
sub_774008(&v15);
sub_774008(&v14);
sub_774008(&v13);
return 1;
}