// // GameLevelManager::rewardItemFromResponse from 0x4c9414 to 0x4c96d6 (706 bytes) // // 2 xrefs: // > GameLevelManager::onClaimNotificationRewardCompleted @ 0x4c975c // > GameLevelManager::onGetGJSecretRewardCompleted @ 0x4c97f4 // // 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:36 +0000 // int __fastcall GameLevelManager::rewardItemFromResponse(int a1, unsigned __int8 *a2, int *a3) { _BOOL4 v5; // r4 int Reward; // r10 cocos2d::CCArray *v7; // r5 cocos2d::CCString *v8; // r0 const char *CString; // r6 size_t v10; // r0 cocos2d::CCString *v11; // r0 const char *v12; // r6 size_t v13; // r0 int v14; // r0 int v15; // r1 _BYTE *v16; // r2 cocos2d::CCString *v17; // r0 char *v18; // r0 char *v19; // r7 const void *v20; // r0 unsigned __int8 *v21; // r3 char *v22; // r2 size_t v23; // r0 cocos2d::CCArray *v24; // r8 cocos2d::CCString *v25; // r0 GameManager *v26; // r10 int v27; // r0 cocos2d::CCString *v28; // r0 cocos2d::CCString *v29; // r0 int v30; // r10 cocos2d::CCString *v31; // r0 const char *v32; // r11 size_t v33; // r0 GameStatsManager *v34; // r0 int v35; // r11 int v37; // [sp+10h] [bp-BCh] int v38; // [sp+18h] [bp-B4h] BYREF int v39; // [sp+1Ch] [bp-B0h] _BYTE *v40; // [sp+20h] [bp-ACh] int v41[3]; // [sp+24h] [bp-A8h] BYREF int v42; // [sp+30h] [bp-9Ch] BYREF int v43; // [sp+34h] [bp-98h] _BYTE *v44; // [sp+38h] [bp-94h] int v45[3]; // [sp+3Ch] [bp-90h] BYREF int v46[3]; // [sp+48h] [bp-84h] BYREF _DWORD v47[3]; // [sp+54h] [bp-78h] BYREF int v48[3]; // [sp+60h] [bp-6Ch] BYREF int v49[3]; // [sp+6Ch] [bp-60h] BYREF int v50[3]; // [sp+78h] [bp-54h] BYREF unsigned __int8 v51[20]; // [sp+84h] [bp-48h] BYREF unsigned __int8 v52[44]; // [sp+98h] [bp-34h] BYREF memset(v50, 0, sizeof(v50)); std::string::__init(v50, "-1", 2u); v5 = sub_4A9CC4(a2, (unsigned __int8 *)v50); std::string::~string((int)v50); if ( v5 ) return 0; v7 = sub_4C1A88(a2, "|"); if ( cocos2d::CCArray::count(v7) <= 1u ) return 0; v8 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v7, 0); v38 = 0; v39 = 0; v40 = nullptr; CString = (const char *)cocos2d::CCString::getCString(v8); v10 = strlen(CString); std::string::__init(&v38, CString, v10); v11 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v7, 1u); v12 = (const char *)cocos2d::CCString::getCString(v11); memset(v41, 0, sizeof(v41)); v13 = strlen(v12); std::string::__init(v41, v12, v13); std::string::basic_string(&v42, (unsigned __int8 *)&v38, 5u, 0xFFFFFFFF); if ( (v38 & 1) != 0 ) { *v40 = 0; v39 = 0; } else { LOWORD(v38) = 0; } std::string::reserve(&v38, 0); v14 = v42; v15 = v43; v16 = v44; v42 = 0; v43 = 0; v44 = nullptr; v38 = v14; v39 = v15; v40 = v16; std::string::~string((int)&v42); std::string::basic_string(v45, (int)&v38); v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat( (cocos2d::CCString *)"%c%s%s%c%c%s", (const char *)&dword_70, "C26", "fpYa", 81, 67, "tg"); v18 = (char *)cocos2d::CCString::getCString(v17); std::string::append(v45, v18); if ( (v45[0] & 1) != 0 ) v19 = (char *)v45[2]; else v19 = (char *)v45 + 1; v20 = (const void *)strlen(v19); rtsha1::calc((rtsha1 *)v19, v20, (int)v51, v21); rtsha1::toHexString((rtsha1 *)v51, v52, v22); memset(v46, 0, sizeof(v46)); v23 = strlen((const char *)v52); std::string::__init(v46, v52, v23); Reward = sub_4A9CC4((unsigned __int8 *)v46, (unsigned __int8 *)v41); std::string::~string((int)v46); if ( Reward ) { memset(v48, 0, sizeof(v48)); std::string::__init(v48, "59182", 5u); cocos2d::ZipUtils::base64DecodeEnc(v47, &v38, v48); std::string::~string((int)v48); v24 = sub_4C1A88(v47, ":"); if ( cocos2d::CCArray::count(v24) > 4u && (v25 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 1u), v26 = (GameManager *)cocos2d::CCString::intValue(v25), v27 = GameManager::sharedState(v26), v26 == (GameManager *)(*(_DWORD *)(v27 + 696) - *(_DWORD *)(v27 + 700))) ) { v28 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 2u); *a3 = cocos2d::CCString::intValue(v28); v29 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 3u); v30 = cocos2d::CCString::intValue(v29); v31 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 4u); v32 = (const char *)cocos2d::CCString::getCString(v31); memset(v49, 0, sizeof(v49)); v33 = strlen(v32); v34 = (GameStatsManager *)std::string::__init(v49, v32, v33); v35 = GameStatsManager::sharedState(v34); v37 = *a3; std::string::basic_string(v50, (int)v49); Reward = GameStatsManager::createReward(v35, v30, v37, (int)v50); std::string::~string((int)v50); std::string::~string((int)v49); } else { Reward = 0; } std::string::~string((int)v47); } std::string::~string((int)v45); std::string::~string((int)v41); std::string::~string((int)&v38); return Reward; }
GD Web Decomp Icon

GD Web Decomp

Raw Source