{"type": "func", "start": 5370053872, "end": 5370054390, "name": "GameLevelManager::getCompletedWeeklyLevels", "pseudocode": "// \n// GameLevelManager::getCompletedWeeklyLevels from 0x1401484f0 to 0x1401486f6 (518 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::updateUserScore @ 0x14015649e\n// > <???> @ 0x1406ca644\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\n// Hidden C++ exception states: #wind=2\nint GameLevelManager::getCompletedWeeklyLevels(GameLevelManager *a1)\n{\n  int v2; // esi\n  struct cocos2d::CCArray *v3; // rax\n  cocos2d::ccArray *data; // rdi\n  __int64 num; // rax\n  cocos2d::CCString **arr; // rdi\n  cocos2d::CCString **i; // rbp\n  cocos2d::CCString *v8; // rbx\n  int v9; // eax\n  const char *CString; // rax\n  size_t v11; // r8\n  __int64 v12; // rax\n  GJGameLevel *v13; // rbx\n  void *v14; // rcx\n  GameStatsManager *v15; // rcx\n  void *v17; // [rsp+30h] [rbp-48h]\n  __int128 v18; // [rsp+38h] [rbp-40h] BYREF\n  __int64 v19; // [rsp+48h] [rbp-30h]\n  unsigned __int64 v20; // [rsp+50h] [rbp-28h]\n\n  v2 = 0;\n  v3 = cocos2d::CCDictionary::allKeys(a1->m_dailyLevels);\n  if ( v3 )\n  {\n    data = v3->data;\n    num = data->num;\n    if ( (_DWORD)num )\n    {\n      arr = (cocos2d::CCString **)data->arr;\n      for ( i = &arr[num - 1]; arr <= i; ++arr )\n      {\n        v8 = *arr;\n        if ( !*arr )\n          break;\n        v9 = cocos2d::CCString::intValue(*arr);\n        if ( v9 > 100000 && v9 <= 200000 )\n        {\n          CString = cocos2d::CCString::getCString(v8);\n          v18 = 0;\n          v19 = 0;\n          v20 = 0;\n          v11 = -1;\n          do\n            ++v11;\n          while ( CString[v11] );\n          sub_14003A930(&v18, CString, v11);\n          v12 = cocos2d::CCDictionary::objectForKey(a1->m_dailyLevels, &v18);\n          v13 = (GJGameLevel *)_RTDynamicCast(\n                                 v12,\n                                 0,\n                                 &cocos2d::CCObject `RTTI Type Descriptor',\n                                 &GJGameLevel `RTTI Type Descriptor',\n                                 0);\n          if ( v20 > 0xF )\n          {\n            v14 = (void *)v18;\n            if ( v20 + 1 >= 0x1000 )\n            {\n              v14 = *(void **)(v18 - 8);\n              if ( (unsigned __int64)(v18 - (_QWORD)v14 - 8) > 0x1F )\n                invalid_parameter_noinfo_noreturn();\n            }\n            j_j_free(v14);\n          }\n          v19 = 0;\n          v20 = 15;\n          LOBYTE(v18) = 0;\n          if ( v13\n            && v13->m_stars.random - v13->m_stars.seed == 10\n            && v13->m_normalPercent.random - v13->m_normalPercent.seed == 100 )\n          {\n            v15 = (GameStatsManager *)qword_1406C2EE8;\n            if ( !qword_1406C2EE8 )\n            {\n              v17 = operator new(0x3E0u);\n              qword_1406C2EE8 = sub_1401D0AE0(v17);\n              (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n              v15 = (GameStatsManager *)qword_1406C2EE8;\n            }\n            if ( GameStatsManager::hasCompletedLevel(v15, v13) )\n              ++v2;\n          }\n        }\n      }\n    }\n  }\n  return v2;\n}", "assembly": "; \n; GameLevelManager::getCompletedWeeklyLevels from 0x1401484f0 to 0x1401486f6 (518 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::updateUserScore @ 0x14015649e\n; > <???> @ 0x1406ca644\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1401484f0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1401484f5\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x1401484fa\npush    rdi                                                            ; +0xf, 0x1401484ff\npush    r14                                                            ; +0x10, 0x140148500\npush    r15                                                            ; +0x12, 0x140148502\nsub     rsp, 60h                                                       ; +0x14, 0x140148504\nmov     rax, cs:__security_cookie                                      ; +0x18, 0x140148508\nxor     rax, rsp                                                       ; +0x1f, 0x14014850f\nmov     [rsp+78h+var_20], rax                                          ; +0x22, 0x140148512\nmov     r14, rcx                                                       ; +0x27, 0x140148517\nxor     r15d, r15d                                                     ; +0x2a, 0x14014851a\nmov     esi, r15d                                                      ; +0x2d, 0x14014851d\nmov     rcx, [rcx+1B8h]                                                ; +0x30, 0x140148520\ncall    cs:?allKeys@CCDictionary@cocos2d@@QEAAPEAVCCArray@2@XZ; cocos2d::CCDictionary::allKeys(void) ; +0x37, 0x140148527\ntest    rax, rax                                                       ; +0x3d, 0x14014852d\njz      loc_1401486C6                                                  ; +0x40, 0x140148530\nmov     rdi, [rax+38h]                                                 ; +0x46, 0x140148536\nmov     eax, [rdi]                                                     ; +0x4a, 0x14014853a\ntest    eax, eax                                                       ; +0x4c, 0x14014853c\njz      loc_1401486C6                                                  ; +0x4e, 0x14014853e\nmov     rdi, [rdi+10h]                                                 ; +0x54, 0x140148544\nlea     rbp, [rax-1]                                                   ; +0x58, 0x140148548\nlea     rbp, [rdi+rbp*8]                                               ; +0x5c, 0x14014854c\ncmp     rdi, rbp                                                       ; +0x60, 0x140148550\nja      loc_1401486C6                                                  ; +0x63, 0x140148553\nnop     dword ptr [rax+00000000h]                                      ; +0x69, 0x140148559\nmov     rbx, [rdi]                                                     ; +0x70, 0x140148560\ntest    rbx, rbx                                                       ; +0x73, 0x140148563\njz      loc_1401486C6                                                  ; +0x76, 0x140148566\nmov     rcx, rbx                                                       ; +0x7c, 0x14014856c\ncall    cs:?intValue@CCString@cocos2d@@QEBAHXZ; cocos2d::CCString::intValue(void) ; +0x7f, 0x14014856f\ncmp     eax, 186A0h                                                    ; +0x85, 0x140148575\njle     loc_1401486B9                                                  ; +0x8a, 0x14014857a\ncmp     eax, 30D40h                                                    ; +0x90, 0x140148580\njg      loc_1401486B9                                                  ; +0x95, 0x140148585\nmov     rcx, rbx                                                       ; +0x9b, 0x14014858b\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x9e, 0x14014858e\nxorps   xmm0, xmm0                                                     ; +0xa4, 0x140148594\nmovups  [rsp+78h+var_40], xmm0                                         ; +0xa7, 0x140148597\nmov     [rsp+78h+var_30], r15                                          ; +0xac, 0x14014859c\nmov     [rsp+78h+var_28], r15                                          ; +0xb1, 0x1401485a1\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xb6, 0x1401485a6\nnop     dword ptr [rax]                                                ; +0xbd, 0x1401485ad\ninc     r8                                                             ; +0xc0, 0x1401485b0\ncmp     byte ptr [rax+r8], 0                                           ; +0xc3, 0x1401485b3\njnz     short loc_1401485B0                                            ; +0xc8, 0x1401485b8\nmov     rdx, rax                                                       ; +0xca, 0x1401485ba\nlea     rcx, [rsp+78h+var_40]                                          ; +0xcd, 0x1401485bd\ncall    sub_14003A930                                                  ; +0xd2, 0x1401485c2\nnop                                                                    ; +0xd7, 0x1401485c7\nlea     rdx, [rsp+78h+var_40]                                          ; +0xd8, 0x1401485c8\nmov     rcx, [r14+1B8h]                                                ; +0xdd, 0x1401485cd\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0xe4, 0x1401485d4\nmov     rcx, rax                                                       ; +0xea, 0x1401485da\nmov     [rsp+78h+var_58], r15d                                         ; +0xed, 0x1401485dd\nlea     r9, ??_R0?AVGJGameLevel@@@8; GJGameLevel `RTTI Type Descriptor' ; +0xf2, 0x1401485e2\nlea     r8, ??_R0?AVCCObject@cocos2d@@@8; cocos2d::CCObject `RTTI Type Descriptor' ; +0xf9, 0x1401485e9\nxor     edx, edx                                                       ; +0x100, 0x1401485f0\ncall    __RTDynamicCast                                                ; +0x102, 0x1401485f2\nmov     rbx, rax                                                       ; +0x107, 0x1401485f7\nmov     rdx, [rsp+78h+var_28]                                          ; +0x10a, 0x1401485fa\ncmp     rdx, 0Fh                                                       ; +0x10f, 0x1401485ff\njbe     short loc_140148637                                            ; +0x113, 0x140148603\ninc     rdx                                                            ; +0x115, 0x140148605\nmov     rcx, qword ptr [rsp+78h+var_40]                                ; +0x118, 0x140148608\nmov     rax, rcx                                                       ; +0x11d, 0x14014860d\ncmp     rdx, 1000h                                                     ; +0x120, 0x140148610\njb      short loc_140148632                                            ; +0x127, 0x140148617\nadd     rdx, 27h ; '''                                                 ; +0x129, 0x140148619\nmov     rcx, [rcx-8]; Block                                            ; +0x12d, 0x14014861d\nsub     rax, rcx                                                       ; +0x131, 0x140148621\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x134, 0x140148624\ncmp     rax, 1Fh                                                       ; +0x138, 0x140148628\nja      loc_1401486EF                                                  ; +0x13c, 0x14014862c\ncall    j_j_free                                                       ; +0x142, 0x140148632\nmov     [rsp+78h+var_30], r15                                          ; +0x147, 0x140148637\nmov     [rsp+78h+var_28], 0Fh                                          ; +0x14c, 0x14014863c\nmov     byte ptr [rsp+78h+var_40], 0                                   ; +0x155, 0x140148645\ntest    rbx, rbx                                                       ; +0x15a, 0x14014864a\njz      short loc_1401486B9                                            ; +0x15d, 0x14014864d\nmov     eax, [rbx+388h]                                                ; +0x15f, 0x14014864f\nsub     eax, [rbx+38Ch]                                                ; +0x165, 0x140148655\ncmp     eax, 0Ah                                                       ; +0x16b, 0x14014865b\njnz     short loc_1401486B9                                            ; +0x16e, 0x14014865e\nmov     eax, [rbx+330h]                                                ; +0x170, 0x140148660\nsub     eax, [rbx+32Ch]                                                ; +0x176, 0x140148666\ncmp     eax, 64h ; 'd'                                                 ; +0x17c, 0x14014866c\njnz     short loc_1401486B9                                            ; +0x17f, 0x14014866f\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x181, 0x140148671\ntest    rcx, rcx                                                       ; +0x188, 0x140148678\njnz     short loc_1401486AB                                            ; +0x18b, 0x14014867b\nmov     ecx, 3E0h; Size                                                ; +0x18d, 0x14014867d\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x192, 0x140148682\nmov     [rsp+78h+var_48], rax                                          ; +0x197, 0x140148687\nmov     rcx, rax                                                       ; +0x19c, 0x14014868c\ncall    sub_1401D0AE0                                                  ; +0x19f, 0x14014868f\nmov     rcx, rax                                                       ; +0x1a4, 0x140148694\nmov     cs:qword_1406C2EE8, rax                                        ; +0x1a7, 0x140148697\nmov     rax, [rax]                                                     ; +0x1ae, 0x14014869e\ncall    qword ptr [rax+48h]                                            ; +0x1b1, 0x1401486a1\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x1b4, 0x1401486a4\nmov     rdx, rbx                                                       ; +0x1bb, 0x1401486ab\ncall    GameStatsManager__hasCompletedLevel                            ; +0x1be, 0x1401486ae\ntest    al, al                                                         ; +0x1c3, 0x1401486b3\njz      short loc_1401486B9                                            ; +0x1c5, 0x1401486b5\ninc     esi                                                            ; +0x1c7, 0x1401486b7\nadd     rdi, 8                                                         ; +0x1c9, 0x1401486b9\ncmp     rdi, rbp                                                       ; +0x1cd, 0x1401486bd\njbe     loc_140148560                                                  ; +0x1d0, 0x1401486c0\nmov     eax, esi                                                       ; +0x1d6, 0x1401486c6\nmov     rcx, [rsp+78h+var_20]                                          ; +0x1d8, 0x1401486c8\nxor     rcx, rsp; StackCookie                                          ; +0x1dd, 0x1401486cd\ncall    __security_check_cookie                                        ; +0x1e0, 0x1401486d0\nlea     r11, [rsp+78h+var_18]                                          ; +0x1e5, 0x1401486d5\nmov     rbx, [r11+28h]                                                 ; +0x1ea, 0x1401486da\nmov     rbp, [r11+30h]                                                 ; +0x1ee, 0x1401486de\nmov     rsi, [r11+38h]                                                 ; +0x1f2, 0x1401486e2\nmov     rsp, r11                                                       ; +0x1f6, 0x1401486e6\npop     r15                                                            ; +0x1f9, 0x1401486e9\npop     r14                                                            ; +0x1fb, 0x1401486eb\npop     rdi                                                            ; +0x1fd, 0x1401486ed\nretn                                                                   ; +0x1fe, 0x1401486ee\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x1ff, 0x1401486ef\ndb 0CCh                                                                ; +0x205, 0x1401486f5", "xrefs": ["GameLevelManager::updateUserScore @ 0x14015649e", "<???> @ 0x1406ca644"], "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"}