{"type": "func", "start": 4298367324, "end": 4298367544, "name": "GameStatsManager::unlockGoldChest", "pseudocode": "// \n// GameStatsManager::unlockGoldChest from 0x10033e15c to 0x10033e238 (220 bytes)\n// \n// 1 xrefs:\n// > SecretRewardsLayer::onGoldChest @ 0x1002e9dc4\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\nGJRewardItem *__fastcall GameStatsManager::unlockGoldChest(GameStatsManager *a1, int a2)\n{\n  GJRewardItem *v4; // x19\n  int Stat; // w0\n  cocos2d::CCDictionary *m_treasureRoomChests; // x21\n  cocos2d::CCString *v7; // x0\n  char *CString; // x0\n  void *__p[2]; // [xsp+8h] [xbp-38h] BYREF\n  char v11; // [xsp+1Fh] [xbp-21h]\n\n  if ( GameStatsManager::isSecretChestUnlocked(a1, a2) )\n    return nullptr;\n  v4 = (GJRewardItem *)cocos2d::CCDictionary::objectForKey(a1->m_allTreasureRoomChests, a2);\n  if ( !v4 )\n    return v4;\n  Stat = GameStatsManager::getStat(a1, \"43\");\n  if ( Stat < 1 )\n    return nullptr;\n  GameStatsManager::setStat(a1, \"43\", Stat - 1);\n  GameStatsManager::preProcessReward(a1, v4);\n  GameStatsManager::registerRewardsFromItem(a1, v4);\n  m_treasureRoomChests = a1->m_treasureRoomChests;\n  v7 = (cocos2d::CCString *)sub_100268F4C(\"%i\", a2);\n  CString = (char *)cocos2d::CCString::getCString(v7);\n  sub_100009900(__p, CString);\n  cocos2d::CCDictionary::setObject_1(m_treasureRoomChests, v4, __p);\n  if ( v11 < 0 )\n    operator delete(__p[0]);\n  return v4;\n}", "assembly": "; \n; GameStatsManager::unlockGoldChest from 0x10033e15c to 0x10033e238 (220 bytes)\n; \n; 1 xrefs:\n; > SecretRewardsLayer::onGoldChest @ 0x1002e9dc4\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\nSUB             SP, SP, #0x50                                          ; +0x0, 0x10033e15c\nSTP             X22, X21, [SP,#0x40+var_20]                            ; +0x4, 0x10033e160\nSTP             X20, X19, [SP,#0x40+var_10]                            ; +0x8, 0x10033e164\nSTP             X29, X30, [SP,#0x40+var_s0]                            ; +0xc, 0x10033e168\nADD             X29, SP, #0x40                                         ; +0x10, 0x10033e16c\nMOV             X20, X1                                                ; +0x14, 0x10033e170\nMOV             X21, X0                                                ; +0x18, 0x10033e174\nBL              GameStatsManager__isSecretChestUnlocked                ; +0x1c, 0x10033e178\nTBZ             W0, #0, loc_10033E188                                  ; +0x20, 0x10033e17c\nMOV             X19, #0                                                ; +0x24, 0x10033e180\nB               loc_10033E220                                          ; +0x28, 0x10033e184\nLDR             X0, [X21,#0x158]                                       ; +0x2c, 0x10033e188\nSXTW            X1, W20                                                ; +0x30, 0x10033e18c\nBL              cocos2d__CCDictionary__objectForKey                    ; +0x34, 0x10033e190\nMOV             X19, X0                                                ; +0x38, 0x10033e194\nCBZ             X0, loc_10033E220                                      ; +0x3c, 0x10033e198\nADRL            X1, a43; \"43\"                                          ; +0x40, 0x10033e19c\nMOV             X0, X21; int                                           ; +0x48, 0x10033e1a4\nBL              GameStatsManager__getStat                              ; +0x4c, 0x10033e1a8\nSUBS            W2, W0, #1                                             ; +0x50, 0x10033e1ac\nB.LT            loc_10033E180                                          ; +0x54, 0x10033e1b0\nADRL            X1, a43; \"43\"                                          ; +0x58, 0x10033e1b4\nMOV             X0, X21                                                ; +0x60, 0x10033e1bc\nBL              GameStatsManager__setStat                              ; +0x64, 0x10033e1c0\nMOV             X0, X21                                                ; +0x68, 0x10033e1c4\nMOV             X1, X19                                                ; +0x6c, 0x10033e1c8\nBL              GameStatsManager__preProcessReward                     ; +0x70, 0x10033e1cc\nMOV             X0, X21                                                ; +0x74, 0x10033e1d0\nMOV             X1, X19                                                ; +0x78, 0x10033e1d4\nBL              GameStatsManager__registerRewardsFromItem              ; +0x7c, 0x10033e1d8\nLDR             X21, [X21,#0x2F0]                                      ; +0x80, 0x10033e1dc\nSTR             X20, [SP,#0x40+var_40]                                 ; +0x84, 0x10033e1e0\nADRL            X0, aI; \"%i\"                                           ; +0x88, 0x10033e1e4\nBL              sub_100268F4C                                          ; +0x90, 0x10033e1ec\nBL              cocos2d__CCString__getCString                          ; +0x94, 0x10033e1f0\nMOV             X1, X0; __s                                            ; +0x98, 0x10033e1f4\nADD             X0, SP, #0x40+__p; int                                 ; +0x9c, 0x10033e1f8\nBL              sub_100009900                                          ; +0xa0, 0x10033e1fc\nADD             X2, SP, #0x40+__p                                      ; +0xa4, 0x10033e200\nMOV             X0, X21                                                ; +0xa8, 0x10033e204\nMOV             X1, X19                                                ; +0xac, 0x10033e208\nBL              cocos2d__CCDictionary__setObject_1                     ; +0xb0, 0x10033e20c\nLDRSB           W8, [SP,#0x40+var_21]                                  ; +0xb4, 0x10033e210\nTBZ             W8, #0x1F, loc_10033E220                               ; +0xb8, 0x10033e214\nLDR             X0, [SP,#0x40+__p]; __p                                ; +0xbc, 0x10033e218\nBL              __ZdlPv; operator delete(void *)                       ; +0xc0, 0x10033e21c\nMOV             X0, X19                                                ; +0xc4, 0x10033e220\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0xc8, 0x10033e224\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0xcc, 0x10033e228\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0xd0, 0x10033e22c\nADD             SP, SP, #0x50 ; 'P'                                    ; +0xd4, 0x10033e230\nRET                                                                    ; +0xd8, 0x10033e234", "xrefs": ["SecretRewardsLayer::onGoldChest @ 0x1002e9dc4"], "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"}