{"type": "func", "start": 4298325892, "end": 4298326064, "name": "GameStatsManager::completedChallenge", "pseudocode": "// \n// GameStatsManager::completedChallenge from 0x100333f84 to 0x100334030 (172 bytes)\n// \n// 1 xrefs:\n// > ChallengesPage::claimItem @ 0x100032cb8\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 __fastcall GameStatsManager::completedChallenge(GameStatsManager *a1, GJChallengeItem *a2)\n{\n  int v4; // w20\n  cocos2d::CCDictionary *m_challengeDiamonds; // x22\n  cocos2d::CCObject *v6; // x23\n  void *__p[2]; // [xsp+8h] [xbp-48h] BYREF\n  char v8; // [xsp+1Fh] [xbp-31h]\n\n  if ( a2->m_canClaim && !GameStatsManager::hasCompletedChallenge(a1, a2) )\n  {\n    v4 = a2->m_reward.random - a2->m_reward.seed;\n    m_challengeDiamonds = a1->m_challengeDiamonds;\n    v6 = sub_100268F4C(\"%i\", v4);\n    GameStatsManager::getChallengeKey((__int64)a2, __p);\n    cocos2d::CCDictionary::setObject_1(m_challengeDiamonds, v6, __p);\n    if ( v8 < 0 )\n      operator delete(__p[0]);\n    GameStatsManager::incrementStat(a1, \"13\", v4);\n  }\n}", "assembly": "; \n; GameStatsManager::completedChallenge from 0x100333f84 to 0x100334030 (172 bytes)\n; \n; 1 xrefs:\n; > ChallengesPage::claimItem @ 0x100032cb8\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, #0x60                                          ; +0x0, 0x100333f84\nSTP             X24, X23, [SP,#0x50+var_30]                            ; +0x4, 0x100333f88\nSTP             X22, X21, [SP,#0x50+var_20]                            ; +0x8, 0x100333f8c\nSTP             X20, X19, [SP,#0x50+var_10]                            ; +0xc, 0x100333f90\nSTP             X29, X30, [SP,#0x50+var_s0]                            ; +0x10, 0x100333f94\nADD             X29, SP, #0x50                                         ; +0x14, 0x100333f98\nLDRB            W8, [X1,#0x64]                                         ; +0x18, 0x100333f9c\nCMP             W8, #1                                                 ; +0x1c, 0x100333fa0\nB.NE            loc_100334018                                          ; +0x20, 0x100333fa4\nMOV             X21, X1                                                ; +0x24, 0x100333fa8\nMOV             X19, X0                                                ; +0x28, 0x100333fac\nBL              GameStatsManager__hasCompletedChallenge                ; +0x2c, 0x100333fb0\nTBNZ            W0, #0, loc_100334018                                  ; +0x30, 0x100333fb4\nLDP             W8, W9, [X21,#0x48]                                    ; +0x34, 0x100333fb8\nSUB             W20, W8, W9                                            ; +0x38, 0x100333fbc\nLDR             X22, [X19,#0x2C8]                                      ; +0x3c, 0x100333fc0\nSTR             X20, [SP,#0x50+var_50]                                 ; +0x40, 0x100333fc4\nADRL            X0, aI; \"%i\"                                           ; +0x44, 0x100333fc8\nBL              sub_100268F4C                                          ; +0x4c, 0x100333fd0\nMOV             X23, X0                                                ; +0x50, 0x100333fd4\nADD             X8, SP, #0x50+__p                                      ; +0x54, 0x100333fd8\nMOV             X1, X21                                                ; +0x58, 0x100333fdc\nBL              GameStatsManager__getChallengeKey                      ; +0x5c, 0x100333fe0\nADD             X2, SP, #0x50+__p                                      ; +0x60, 0x100333fe4\nMOV             X0, X22                                                ; +0x64, 0x100333fe8\nMOV             X1, X23                                                ; +0x68, 0x100333fec\nBL              cocos2d__CCDictionary__setObject_1                     ; +0x6c, 0x100333ff0\nLDRSB           W8, [SP,#0x50+var_31]                                  ; +0x70, 0x100333ff4\nTBZ             W8, #0x1F, loc_100334004                               ; +0x74, 0x100333ff8\nLDR             X0, [SP,#0x50+__p]; __p                                ; +0x78, 0x100333ffc\nBL              __ZdlPv; operator delete(void *)                       ; +0x7c, 0x100334000\nADRL            X1, a13; \"13\"                                          ; +0x80, 0x100334004\nMOV             X0, X19; int                                           ; +0x88, 0x10033400c\nMOV             X2, X20                                                ; +0x8c, 0x100334010\nBL              GameStatsManager__incrementStat                        ; +0x90, 0x100334014\nLDP             X29, X30, [SP,#0x50+var_s0]                            ; +0x94, 0x100334018\nLDP             X20, X19, [SP,#0x50+var_10]                            ; +0x98, 0x10033401c\nLDP             X22, X21, [SP,#0x50+var_20]                            ; +0x9c, 0x100334020\nLDP             X24, X23, [SP,#0x50+var_30]                            ; +0xa0, 0x100334024\nADD             SP, SP, #0x60 ; '`'                                    ; +0xa4, 0x100334028\nRET                                                                    ; +0xa8, 0x10033402c", "xrefs": ["ChallengesPage::claimItem @ 0x100032cb8"], "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"}