{"type": "func", "start": 8758376, "end": 8758968, "name": "GJBaseGameLayer::processItems", "pseudocode": "// \n// GJBaseGameLayer::processItems from 0x85a468 to 0x85a6b8 (592 bytes)\n// \n// 2 xrefs:\n// > PlayLayer::levelComplete @ 0x5d1214\n// > <???> @ 0x92b80\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid GJBaseGameLayer::processItems(GJBaseGameLayer *a1)\n{\n  unsigned int v2; // w19\n  cocos2d::CCArray *v3; // x22\n  cocos2d::CCString *v4; // x0\n  char *CString; // x0\n  cocos2d::CCDictionary *m_collectedItems; // x20\n  int *v7; // x20\n  char *v8; // x0\n  int v9; // w0\n  const char *v10; // x20\n  GameStatsManager *v11; // x0\n  GameStatsManager *v12; // x0\n  GameStatsManager *v13; // x0\n  const char *CoinKey; // x20\n  GameStatsManager *v15; // x0\n  GameStatsManager *v16; // x0\n  GameStatsManager *v17; // x0\n  unsigned int *v18; // x1\n  int v19; // w2\n  GameStatsManager *v20; // x0\n  GameStatsManager *v21; // x0\n  std::string v22; // [xsp+70h] [xbp+70h] BYREF\n\n  v2 = 0;\n  v3 = cocos2d::CCDictionary::allKeys(a1->m_collectedItems);\n  if ( (unsigned int)cocos2d::CCArray::count(v3) )\n  {\n    do\n    {\n      v4 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v3, v2);\n      CString = (char *)cocos2d::CCString::getCString(v4);\n      m_collectedItems = a1->m_collectedItems;\n      sub_D153B8((int)&v22, CString);\n      v7 = (int *)cocos2d::CCDictionary::objectForKey(m_collectedItems, &v22);\n      v8 = (char *)v22.m_data.m_data - 24;\n      if ( (__int64 *)v22.m_data.m_data - 3 != &qword_124B6B0 )\n      {\n        if ( &pthread_create )\n        {\n          v18 = (unsigned int *)((char *)v22.m_data.m_data - 8);\n          do\n            v19 = __ldaxr(v18);\n          while ( __stlxr(v19 - 1, v18) );\n        }\n        else\n        {\n          v19 = *((_DWORD *)v22.m_data.m_data - 2);\n          *((_DWORD *)v22.m_data.m_data - 2) = v19 - 1;\n        }\n        if ( v19 <= 0 )\n          operator delete(v8);\n      }\n      v9 = (*(__int64 (__fastcall **)(int *))(*(_QWORD *)v7 + 1784LL))(v7);\n      if ( v9 == 22 )\n      {\n        CoinKey = GJGameLevel::getCoinKey(a1->m_level, v7[444]);\n        v15 = GameStatsManager::sharedState();\n        if ( !GameStatsManager::hasSecretCoin(v15, CoinKey) )\n        {\n          v16 = GameStatsManager::sharedState();\n          ++v2;\n          GameStatsManager::storeSecretCoin(v16, CoinKey);\n          v17 = GameStatsManager::sharedState();\n          GameStatsManager::incrementStat(v17, \"8\");\n          continue;\n        }\n      }\n      else if ( v9 == 31 )\n      {\n        v10 = GJGameLevel::getCoinKey(a1->m_level, v7[444]);\n        if ( a1->m_level->m_coinsVerified.random == a1->m_level->m_coinsVerified.seed )\n        {\n          v20 = GameStatsManager::sharedState();\n          if ( !GameStatsManager::hasPendingUserCoin(v20, v10) )\n          {\n            v21 = GameStatsManager::sharedState();\n            ++v2;\n            GameStatsManager::storePendingUserCoin(v21, v10);\n            continue;\n          }\n        }\n        else\n        {\n          v11 = GameStatsManager::sharedState();\n          if ( !GameStatsManager::hasUserCoin(v11, v10) )\n          {\n            v12 = GameStatsManager::sharedState();\n            ++v2;\n            GameStatsManager::storeUserCoin(v12, v10);\n            v13 = GameStatsManager::sharedState();\n            GameStatsManager::incrementStat(v13, \"12\");\n            continue;\n          }\n        }\n      }\n      ++v2;\n    }\n    while ( v2 < (unsigned int)cocos2d::CCArray::count(v3) );\n  }\n}", "assembly": "; \n; GJBaseGameLayer::processItems from 0x85a468 to 0x85a6b8 (592 bytes)\n; \n; 2 xrefs:\n; > PlayLayer::levelComplete @ 0x5d1214\n; > <???> @ 0x92b80\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             X29, X30, [SP,#var_80]!                                ; +0x0, 0x85a468\nMOV             X29, SP                                                ; +0x4, 0x85a46c\nSTP             X27, X28, [SP,#0x80+var_30]                            ; +0x8, 0x85a470\nADRP            X27, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x85a474\nADD             X28, X29, #0x80+var_18                                 ; +0x10, 0x85a478\nSTP             X23, X24, [SP,#0x80+var_50]                            ; +0x14, 0x85a47c\nMOV             X23, X0                                                ; +0x18, 0x85a480\nLDR             X0, [X0,#0x3278]; this                                 ; +0x1c, 0x85a484\nLDR             X1, [X27,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x85a488\nADRP            X24, #off_122EFE8@PAGE                                 ; +0x24, 0x85a48c\nSTP             X21, X22, [SP,#0x80+var_60]                            ; +0x28, 0x85a490\nSTP             X25, X26, [SP,#0x80+var_40]                            ; +0x2c, 0x85a494\nLDR             X1, [X1]                                               ; +0x30, 0x85a498\nADRP            X26, #(aReachPathOfLav_6+0x18)@PAGE; \"8\"               ; +0x34, 0x85a49c\nSTP             X19, X20, [SP,#0x80+var_70]                            ; +0x38, 0x85a4a0\nSTR             X1, [X29,#0x80+var_8]                                  ; +0x3c, 0x85a4a4\nMOV             W19, #0                                                ; +0x40, 0x85a4a8\nBL              _ZN7cocos2d12CCDictionary7allKeysEv; cocos2d::CCDictionary::allKeys(void) ; +0x44, 0x85a4ac\nMOV             X22, X0                                                ; +0x48, 0x85a4b0\nMOV             X0, X22; this                                          ; +0x4c, 0x85a4b4\nADD             X21, X29, #0x80+var_10                                 ; +0x50, 0x85a4b8\nADD             X25, X29, #0x80+var_20                                 ; +0x54, 0x85a4bc\nADD             X26, X26, #(aReachPathOfLav_6+0x18)@PAGEOFF; \"8\"       ; +0x58, 0x85a4c0\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x5c, 0x85a4c4\nCMP             W19, W0                                                ; +0x60, 0x85a4c8\nB.CS            loc_85A584                                             ; +0x64, 0x85a4cc\nMOV             W1, W19; unsigned int                                  ; +0x68, 0x85a4d0\nMOV             X0, X22; this                                          ; +0x6c, 0x85a4d4\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x70, 0x85a4d8\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x74, 0x85a4dc\nMOV             X1, X0; char *                                         ; +0x78, 0x85a4e0\nMOV             X2, X25                                                ; +0x7c, 0x85a4e4\nMOV             X0, X21; int                                           ; +0x80, 0x85a4e8\nLDR             X20, [X23,#0x3278]                                     ; +0x84, 0x85a4ec\nBL              sub_D153B8                                             ; +0x88, 0x85a4f0\nMOV             X0, X20                                                ; +0x8c, 0x85a4f4\nMOV             X1, X21                                                ; +0x90, 0x85a4f8\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x94, 0x85a4fc\nLDR             X1, [X21]                                              ; +0x98, 0x85a500\nMOV             X20, X0                                                ; +0x9c, 0x85a504\nLDR             X2, [X24,#off_122EFE8@PAGEOFF]; qword_124B6B0          ; +0xa0, 0x85a508\nSUB             X0, X1, #0x18; p                                       ; +0xa4, 0x85a50c\nCMP             X0, X2                                                 ; +0xa8, 0x85a510\nB.NE            loc_85A61C                                             ; +0xac, 0x85a514\nLDR             X1, [X20]                                              ; +0xb0, 0x85a518\nMOV             X0, X20                                                ; +0xb4, 0x85a51c\nLDR             X1, [X1,#0x6F8]                                        ; +0xb8, 0x85a520\nBLR             X1                                                     ; +0xbc, 0x85a524\nCMP             W0, #0x16                                              ; +0xc0, 0x85a528\nB.EQ            loc_85A5D8                                             ; +0xc4, 0x85a52c\nCMP             W0, #0x1F                                              ; +0xc8, 0x85a530\nB.NE            loc_85A570                                             ; +0xcc, 0x85a534\nLDR             W1, [X20,#0x6F0]; int                                  ; +0xd0, 0x85a538\nLDR             X0, [X23,#0x8A0]; this                                 ; +0xd4, 0x85a53c\nBL              _ZN11GJGameLevel10getCoinKeyEi; GJGameLevel::getCoinKey(int) ; +0xd8, 0x85a540\nMOV             X20, X0                                                ; +0xdc, 0x85a544\nLDR             X0, [X23,#0x8A0]                                       ; +0xe0, 0x85a548\nLDR             W1, [X0,#0x2C4]                                        ; +0xe4, 0x85a54c\nLDR             W0, [X0,#0x2C8]; this                                  ; +0xe8, 0x85a550\nCMP             W1, W0                                                 ; +0xec, 0x85a554\nB.EQ            loc_85A650                                             ; +0xf0, 0x85a558\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0xf4, 0x85a55c\nMOV             X1, X20; char *                                        ; +0xf8, 0x85a560\nBL              _ZN16GameStatsManager11hasUserCoinEPKc; GameStatsManager::hasUserCoin(char const*) ; +0xfc, 0x85a564\nUXTB            W0, W0; this                                           ; +0x100, 0x85a568\nCBZ             W0, loc_85A5B4                                         ; +0x104, 0x85a56c\nADD             W19, W19, #1                                           ; +0x108, 0x85a570\nMOV             X0, X22; this                                          ; +0x10c, 0x85a574\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x110, 0x85a578\nCMP             W19, W0                                                ; +0x114, 0x85a57c\nB.CC            loc_85A4D0                                             ; +0x118, 0x85a580\nLDR             X27, [X27,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x11c, 0x85a584\nLDR             X1, [X29,#0x80+var_8]                                  ; +0x120, 0x85a588\nLDR             X0, [X27]                                              ; +0x124, 0x85a58c\nCMP             X1, X0                                                 ; +0x128, 0x85a590\nB.NE            loc_85A6B4                                             ; +0x12c, 0x85a594\nLDP             X19, X20, [SP,#0x80+var_70]                            ; +0x130, 0x85a598\nLDP             X21, X22, [SP,#0x80+var_60]                            ; +0x134, 0x85a59c\nLDP             X23, X24, [SP,#0x80+var_50]                            ; +0x138, 0x85a5a0\nLDP             X25, X26, [SP,#0x80+var_40]                            ; +0x13c, 0x85a5a4\nLDP             X27, X28, [SP,#0x80+var_30]                            ; +0x140, 0x85a5a8\nLDP             X29, X30, [SP+0x80+var_80],#0x80                       ; +0x144, 0x85a5ac\nRET                                                                    ; +0x148, 0x85a5b0\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x14c, 0x85a5b4\nADD             W19, W19, #1                                           ; +0x150, 0x85a5b8\nMOV             X1, X20; char *                                        ; +0x154, 0x85a5bc\nBL              _ZN16GameStatsManager13storeUserCoinEPKc; GameStatsManager::storeUserCoin(char const*) ; +0x158, 0x85a5c0\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x15c, 0x85a5c4\nADRL            X1, (aRsaSha512+8); char *                             ; +0x160, 0x85a5c8\nBL              _ZN16GameStatsManager13incrementStatEPKc; GameStatsManager::incrementStat(char const*) ; +0x168, 0x85a5d0\nB               loc_85A574                                             ; +0x16c, 0x85a5d4\nLDR             W1, [X20,#0x6F0]; int                                  ; +0x170, 0x85a5d8\nLDR             X0, [X23,#0x8A0]; this                                 ; +0x174, 0x85a5dc\nBL              _ZN11GJGameLevel10getCoinKeyEi; GJGameLevel::getCoinKey(int) ; +0x178, 0x85a5e0\nMOV             X20, X0                                                ; +0x17c, 0x85a5e4\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x180, 0x85a5e8\nMOV             X1, X20; char *                                        ; +0x184, 0x85a5ec\nBL              _ZN16GameStatsManager13hasSecretCoinEPKc; GameStatsManager::hasSecretCoin(char const*) ; +0x188, 0x85a5f0\nUXTB            W0, W0; this                                           ; +0x18c, 0x85a5f4\nCBNZ            W0, loc_85A570                                         ; +0x190, 0x85a5f8\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x194, 0x85a5fc\nADD             W19, W19, #1                                           ; +0x198, 0x85a600\nMOV             X1, X20; char *                                        ; +0x19c, 0x85a604\nBL              _ZN16GameStatsManager15storeSecretCoinEPKc; GameStatsManager::storeSecretCoin(char const*) ; +0x1a0, 0x85a608\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x1a4, 0x85a60c\nMOV             X1, X26; char *                                        ; +0x1a8, 0x85a610\nBL              _ZN16GameStatsManager13incrementStatEPKc; GameStatsManager::incrementStat(char const*) ; +0x1ac, 0x85a614\nB               loc_85A574                                             ; +0x1b0, 0x85a618\nADRP            X2, #pthread_create_ptr_0@PAGE                         ; +0x1b4, 0x85a61c\nLDR             X2, [X2,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x1b8, 0x85a620\nCBZ             X2, loc_85A678                                         ; +0x1bc, 0x85a624\nSUB             X1, X1, #8                                             ; +0x1c0, 0x85a628\nLDAXR           W2, [X1]                                               ; +0x1c4, 0x85a62c\nSUB             W3, W2, #1                                             ; +0x1c8, 0x85a630\nSTLXR           W4, W3, [X1]                                           ; +0x1cc, 0x85a634\nCBNZ            W4, loc_85A62C                                         ; +0x1d0, 0x85a638\nCMP             W2, WZR                                                ; +0x1d4, 0x85a63c\nB.GT            loc_85A518                                             ; +0x1d8, 0x85a640\nMOV             X1, X28                                                ; +0x1dc, 0x85a644\nBL              j__ZdlPv; operator delete(void *)                      ; +0x1e0, 0x85a648\nB               loc_85A518                                             ; +0x1e4, 0x85a64c\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x1e8, 0x85a650\nMOV             X1, X20; char *                                        ; +0x1ec, 0x85a654\nBL              _ZN16GameStatsManager18hasPendingUserCoinEPKc; GameStatsManager::hasPendingUserCoin(char const*) ; +0x1f0, 0x85a658\nUXTB            W0, W0; this                                           ; +0x1f4, 0x85a65c\nCBNZ            W0, loc_85A570                                         ; +0x1f8, 0x85a660\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x1fc, 0x85a664\nADD             W19, W19, #1                                           ; +0x200, 0x85a668\nMOV             X1, X20; char *                                        ; +0x204, 0x85a66c\nBL              _ZN16GameStatsManager20storePendingUserCoinEPKc; GameStatsManager::storePendingUserCoin(char const*) ; +0x208, 0x85a670\nB               loc_85A574                                             ; +0x20c, 0x85a674\nLDUR            W2, [X1,#-8]                                           ; +0x210, 0x85a678\nSUB             W3, W2, #1                                             ; +0x214, 0x85a67c\nSTUR            W3, [X1,#-8]                                           ; +0x218, 0x85a680\nB               loc_85A63C                                             ; +0x21c, 0x85a684\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x220, 0x85a688\nMOV             X19, X0                                                ; +0x224, 0x85a68c\nLDR             X0, [X29,#0x80+var_10]                                 ; +0x228, 0x85a690\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x22c, 0x85a694\nSUB             X0, X0, #0x18                                          ; +0x230, 0x85a698\nCMP             X0, X1                                                 ; +0x234, 0x85a69c\nB.EQ            loc_85A6AC                                             ; +0x238, 0x85a6a0\nADD             X1, X29, #0x80+var_18                                  ; +0x23c, 0x85a6a4\nBL              sub_4DC320                                             ; +0x240, 0x85a6a8\nMOV             X0, X19                                                ; +0x244, 0x85a6ac\nBL              _Unwind_Resume                                         ; +0x248, 0x85a6b0\nBL              .__stack_chk_fail                                      ; +0x24c, 0x85a6b4", "xrefs": ["PlayLayer::levelComplete @ 0x5d1214", "<???> @ 0x92b80"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}