{"type": "func", "start": 4295591828, "end": 4295592172, "name": "GameLevelManager::getCompletedEventLevels", "pseudocode": "// \n// GameLevelManager::getCompletedEventLevels from 0x100098794 to 0x1000988ec (344 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::updateUserScore @ 0x1000a2044\n// > GameLevelManager::updateUserScore @ 0x1000a21ec\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\nint __fastcall GameLevelManager::getCompletedEventLevels(GameLevelManager *a1, int a2, int a3)\n{\n  cocos2d::CCArray *v6; // x0\n  cocos2d::ccArray *data; // x9\n  __int64 num; // x8\n  int v9; // w22\n  cocos2d::CCString **arr; // x27\n  unsigned __int64 v11; // x28\n  cocos2d::CCString *v12; // x25\n  cocos2d::CCDictionary *m_dailyLevels; // x26\n  char *CString; // x0\n  const void *v15; // x0\n  GJGameLevel *v16; // x25\n  int v17; // w8\n  GameStatsManager *v18; // x0\n  void *__p[2]; // [xsp+8h] [xbp-68h] BYREF\n  char v21; // [xsp+1Fh] [xbp-51h]\n\n  v6 = cocos2d::CCDictionary::allKeys(a1->m_dailyLevels);\n  if ( v6 )\n  {\n    data = v6->data;\n    num = data->num;\n    if ( (_DWORD)num )\n    {\n      v9 = 0;\n      arr = (cocos2d::CCString **)data->arr;\n      v11 = (unsigned __int64)&arr[num - 1];\n      while ( 1 )\n      {\n        v12 = *arr;\n        if ( !*arr )\n          return v9;\n        if ( cocos2d::CCString::intValue(*arr) >= 200001 )\n        {\n          m_dailyLevels = a1->m_dailyLevels;\n          CString = (char *)cocos2d::CCString::getCString(v12);\n          sub_100009900(__p, CString);\n          v15 = (const void *)cocos2d::CCDictionary::objectForKey_1(m_dailyLevels, __p);\n          if ( v15 )\n            v16 = (GJGameLevel *)__dynamic_cast(\n                                   v15,\n                                   (const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,\n                                   (const struct __class_type_info *)&`typeinfo for'GJGameLevel,\n                                   0);\n          else\n            v16 = nullptr;\n          if ( v21 < 0 )\n          {\n            operator delete(__p[0]);\n            if ( v16 )\n            {\nLABEL_13:\n              v17 = v16->m_stars.random - v16->m_stars.seed;\n              if ( v17 >= a2 && v17 <= a3 && v16->m_normalPercent.random - v16->m_normalPercent.seed == 100 )\n              {\n                v18 = GameStatsManager::sharedState();\n                v9 += GameStatsManager::hasCompletedLevel(v18, v16);\n              }\n            }\n          }\n          else if ( v16 )\n          {\n            goto LABEL_13;\n          }\n        }\n        if ( (unsigned __int64)++arr > v11 )\n          return v9;\n      }\n    }\n  }\n  return 0;\n}", "assembly": "; \n; GameLevelManager::getCompletedEventLevels from 0x100098794 to 0x1000988ec (344 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::updateUserScore @ 0x1000a2044\n; > GameLevelManager::updateUserScore @ 0x1000a21ec\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, #0x80                                          ; +0x0, 0x100098794\nSTP             X28, X27, [SP,#0x70+var_50]                            ; +0x4, 0x100098798\nSTP             X26, X25, [SP,#0x70+var_40]                            ; +0x8, 0x10009879c\nSTP             X24, X23, [SP,#0x70+var_30]                            ; +0xc, 0x1000987a0\nSTP             X22, X21, [SP,#0x70+var_20]                            ; +0x10, 0x1000987a4\nSTP             X20, X19, [SP,#0x70+var_10]                            ; +0x14, 0x1000987a8\nSTP             X29, X30, [SP,#0x70+var_s0]                            ; +0x18, 0x1000987ac\nADD             X29, SP, #0x70                                         ; +0x1c, 0x1000987b0\nMOV             X19, X2                                                ; +0x20, 0x1000987b4\nMOV             X20, X1                                                ; +0x24, 0x1000987b8\nMOV             X21, X0                                                ; +0x28, 0x1000987bc\nLDR             X0, [X0,#0x1C0]                                        ; +0x2c, 0x1000987c0\nBL              cocos2d__CCDictionary__allKeys                         ; +0x30, 0x1000987c4\nCBZ             X0, loc_1000988C4                                      ; +0x34, 0x1000987c8\nLDR             X9, [X0,#0x38]                                         ; +0x38, 0x1000987cc\nLDR             W8, [X9]                                               ; +0x3c, 0x1000987d0\nCBZ             W8, loc_1000988C4                                      ; +0x40, 0x1000987d4\nMOV             W22, #0                                                ; +0x44, 0x1000987d8\nLDR             X27, [X9,#0x10]                                        ; +0x48, 0x1000987dc\nADD             X8, X27, X8,LSL#3                                      ; +0x4c, 0x1000987e0\nSUB             X28, X8, #8                                            ; +0x50, 0x1000987e4\nMOV             W23, #0x30D41                                          ; +0x54, 0x1000987e8\nADRL            X24, _ZTI11GJGameLevel; `typeinfo for'GJGameLevel      ; +0x5c, 0x1000987f0\nLDR             X25, [X27]                                             ; +0x64, 0x1000987f8\nCBZ             X25, loc_1000988C8                                     ; +0x68, 0x1000987fc\nMOV             X0, X25                                                ; +0x6c, 0x100098800\nBL              cocos2d__CCString__intValue                            ; +0x70, 0x100098804\nCMP             W0, W23                                                ; +0x74, 0x100098808\nB.LT            loc_1000988B4                                          ; +0x78, 0x10009880c\nLDR             X26, [X21,#0x1C0]                                      ; +0x7c, 0x100098810\nMOV             X0, X25                                                ; +0x80, 0x100098814\nBL              cocos2d__CCString__getCString                          ; +0x84, 0x100098818\nMOV             X1, X0; __s                                            ; +0x88, 0x10009881c\nADD             X0, SP, #0x70+__p; int                                 ; +0x8c, 0x100098820\nBL              sub_100009900                                          ; +0x90, 0x100098824\nADD             X1, SP, #0x70+__p                                      ; +0x94, 0x100098828\nMOV             X0, X26                                                ; +0x98, 0x10009882c\nBL              cocos2d__CCDictionary__objectForKey_1                  ; +0x9c, 0x100098830\nCBZ             X0, loc_100098854                                      ; +0xa0, 0x100098834\nADRL            X1, _ZTIN7cocos2d8CCObjectE; lpstype                   ; +0xa4, 0x100098838\nMOV             X2, X24; lpdtype                                       ; +0xac, 0x100098840\nMOV             X3, #0; s2d                                            ; +0xb0, 0x100098844\nBL              ___dynamic_cast                                        ; +0xb4, 0x100098848\nMOV             X25, X0                                                ; +0xb8, 0x10009884c\nB               loc_100098858                                          ; +0xbc, 0x100098850\nMOV             X25, #0                                                ; +0xc0, 0x100098854\nLDRSB           W8, [SP,#0x70+var_51]                                  ; +0xc4, 0x100098858\nTBNZ            W8, #0x1F, loc_100098868                               ; +0xc8, 0x10009885c\nCBNZ            X25, loc_100098874                                     ; +0xcc, 0x100098860\nB               loc_1000988B4                                          ; +0xd0, 0x100098864\nLDR             X0, [SP,#0x70+__p]; __p                                ; +0xd4, 0x100098868\nBL              __ZdlPv; operator delete(void *)                       ; +0xd8, 0x10009886c\nCBZ             X25, loc_1000988B4                                     ; +0xdc, 0x100098870\nLDR             W8, [X25,#0x340]                                       ; +0xe0, 0x100098874\nLDR             W9, [X25,#0x344]                                       ; +0xe4, 0x100098878\nSUB             W8, W8, W9                                             ; +0xe8, 0x10009887c\nCMP             W8, W20                                                ; +0xec, 0x100098880\nB.LT            loc_1000988B4                                          ; +0xf0, 0x100098884\nCMP             W8, W19                                                ; +0xf4, 0x100098888\nB.GT            loc_1000988B4                                          ; +0xf8, 0x10009888c\nLDR             W8, [X25,#0x2E8]                                       ; +0xfc, 0x100098890\nLDR             W9, [X25,#0x2E4]                                       ; +0x100, 0x100098894\nSUB             W8, W8, W9                                             ; +0x104, 0x100098898\nCMP             W8, #0x64 ; 'd'                                        ; +0x108, 0x10009889c\nB.NE            loc_1000988B4                                          ; +0x10c, 0x1000988a0\nBL              GameStatsManager__sharedState                          ; +0x110, 0x1000988a4\nMOV             X1, X25                                                ; +0x114, 0x1000988a8\nBL              GameStatsManager__hasCompletedLevel                    ; +0x118, 0x1000988ac\nADD             W22, W22, W0                                           ; +0x11c, 0x1000988b0\nADD             X27, X27, #8                                           ; +0x120, 0x1000988b4\nCMP             X27, X28                                               ; +0x124, 0x1000988b8\nB.LS            loc_1000987F8                                          ; +0x128, 0x1000988bc\nB               loc_1000988C8                                          ; +0x12c, 0x1000988c0\nMOV             W22, #0                                                ; +0x130, 0x1000988c4\nMOV             X0, X22                                                ; +0x134, 0x1000988c8\nLDP             X29, X30, [SP,#0x70+var_s0]                            ; +0x138, 0x1000988cc\nLDP             X20, X19, [SP,#0x70+var_10]                            ; +0x13c, 0x1000988d0\nLDP             X22, X21, [SP,#0x70+var_20]                            ; +0x140, 0x1000988d4\nLDP             X24, X23, [SP,#0x70+var_30]                            ; +0x144, 0x1000988d8\nLDP             X26, X25, [SP,#0x70+var_40]                            ; +0x148, 0x1000988dc\nLDP             X28, X27, [SP,#0x70+var_50]                            ; +0x14c, 0x1000988e0\nADD             SP, SP, #0x80                                          ; +0x150, 0x1000988e4\nRET                                                                    ; +0x154, 0x1000988e8", "xrefs": ["GameLevelManager::updateUserScore @ 0x1000a2044", "GameLevelManager::updateUserScore @ 0x1000a21ec"], "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"}