{"type": "func", "start": 5370054400, "end": 5370054904, "name": "GameLevelManager::getCompletedDailyLevels", "pseudocode": "// \n// GameLevelManager::getCompletedDailyLevels from 0x140148700 to 0x1401488f8 (504 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::updateUserScore @ 0x14015682f\n// > <???> @ 0x1406ca650\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::getCompletedDailyLevels(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  const char *CString; // rax\n  size_t v10; // r8\n  __int64 v11; // rax\n  GJGameLevel *v12; // rbx\n  void *v13; // rcx\n  GameStatsManager *v14; // rcx\n  void *v16; // [rsp+30h] [rbp-48h]\n  __int128 v17; // [rsp+38h] [rbp-40h] BYREF\n  __int64 v18; // [rsp+48h] [rbp-30h]\n  unsigned __int64 v19; // [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        if ( (int)cocos2d::CCString::intValue(*arr) <= 100000 )\n        {\n          CString = cocos2d::CCString::getCString(v8);\n          v17 = 0;\n          v18 = 0;\n          v19 = 0;\n          v10 = -1;\n          do\n            ++v10;\n          while ( CString[v10] );\n          sub_14003A930(&v17, CString, v10);\n          v11 = cocos2d::CCDictionary::objectForKey(a1->m_dailyLevels, &v17);\n          v12 = (GJGameLevel *)_RTDynamicCast(\n                                 v11,\n                                 0,\n                                 &cocos2d::CCObject `RTTI Type Descriptor',\n                                 &GJGameLevel `RTTI Type Descriptor',\n                                 0);\n          if ( v19 > 0xF )\n          {\n            v13 = (void *)v17;\n            if ( v19 + 1 >= 0x1000 )\n            {\n              v13 = *(void **)(v17 - 8);\n              if ( (unsigned __int64)(v17 - (_QWORD)v13 - 8) > 0x1F )\n                invalid_parameter_noinfo_noreturn();\n            }\n            j_j_free(v13);\n          }\n          v18 = 0;\n          v19 = 15;\n          LOBYTE(v17) = 0;\n          if ( v12\n            && v12->m_stars.random - v12->m_stars.seed < 10\n            && v12->m_normalPercent.random - v12->m_normalPercent.seed == 100 )\n          {\n            v14 = (GameStatsManager *)qword_1406C2EE8;\n            if ( !qword_1406C2EE8 )\n            {\n              v16 = operator new(0x3E0u);\n              qword_1406C2EE8 = sub_1401D0AE0(v16);\n              (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n              v14 = (GameStatsManager *)qword_1406C2EE8;\n            }\n            if ( GameStatsManager::hasCompletedLevel(v14, v12) )\n              ++v2;\n          }\n        }\n      }\n    }\n  }\n  return v2;\n}", "assembly": "; \n; GameLevelManager::getCompletedDailyLevels from 0x140148700 to 0x1401488f8 (504 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::updateUserScore @ 0x14015682f\n; > <???> @ 0x1406ca650\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, 0x140148700\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x140148705\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x14014870a\npush    rdi                                                            ; +0xf, 0x14014870f\npush    r14                                                            ; +0x10, 0x140148710\npush    r15                                                            ; +0x12, 0x140148712\nsub     rsp, 60h                                                       ; +0x14, 0x140148714\nmov     rax, cs:__security_cookie                                      ; +0x18, 0x140148718\nxor     rax, rsp                                                       ; +0x1f, 0x14014871f\nmov     [rsp+78h+var_20], rax                                          ; +0x22, 0x140148722\nmov     r14, rcx                                                       ; +0x27, 0x140148727\nxor     r15d, r15d                                                     ; +0x2a, 0x14014872a\nmov     esi, r15d                                                      ; +0x2d, 0x14014872d\nmov     rcx, [rcx+1B8h]                                                ; +0x30, 0x140148730\ncall    cs:?allKeys@CCDictionary@cocos2d@@QEAAPEAVCCArray@2@XZ; cocos2d::CCDictionary::allKeys(void) ; +0x37, 0x140148737\ntest    rax, rax                                                       ; +0x3d, 0x14014873d\njz      loc_1401488C8                                                  ; +0x40, 0x140148740\nmov     rdi, [rax+38h]                                                 ; +0x46, 0x140148746\nmov     eax, [rdi]                                                     ; +0x4a, 0x14014874a\ntest    eax, eax                                                       ; +0x4c, 0x14014874c\njz      loc_1401488C8                                                  ; +0x4e, 0x14014874e\nmov     rdi, [rdi+10h]                                                 ; +0x54, 0x140148754\nlea     rbp, [rax-1]                                                   ; +0x58, 0x140148758\nlea     rbp, [rdi+rbp*8]                                               ; +0x5c, 0x14014875c\ncmp     rdi, rbp                                                       ; +0x60, 0x140148760\nja      loc_1401488C8                                                  ; +0x63, 0x140148763\nnop     dword ptr [rax+00000000h]                                      ; +0x69, 0x140148769\nmov     rbx, [rdi]                                                     ; +0x70, 0x140148770\ntest    rbx, rbx                                                       ; +0x73, 0x140148773\njz      loc_1401488C8                                                  ; +0x76, 0x140148776\nmov     rcx, rbx                                                       ; +0x7c, 0x14014877c\ncall    cs:?intValue@CCString@cocos2d@@QEBAHXZ; cocos2d::CCString::intValue(void) ; +0x7f, 0x14014877f\ncmp     eax, 186A0h                                                    ; +0x85, 0x140148785\njg      loc_1401488BB                                                  ; +0x8a, 0x14014878a\nmov     rcx, rbx                                                       ; +0x90, 0x140148790\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x93, 0x140148793\nxorps   xmm0, xmm0                                                     ; +0x99, 0x140148799\nmovups  [rsp+78h+var_40], xmm0                                         ; +0x9c, 0x14014879c\nmov     [rsp+78h+var_30], r15                                          ; +0xa1, 0x1401487a1\nmov     [rsp+78h+var_28], r15                                          ; +0xa6, 0x1401487a6\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xab, 0x1401487ab\ninc     r8                                                             ; +0xb2, 0x1401487b2\ncmp     byte ptr [rax+r8], 0                                           ; +0xb5, 0x1401487b5\njnz     short loc_1401487B2                                            ; +0xba, 0x1401487ba\nmov     rdx, rax                                                       ; +0xbc, 0x1401487bc\nlea     rcx, [rsp+78h+var_40]                                          ; +0xbf, 0x1401487bf\ncall    sub_14003A930                                                  ; +0xc4, 0x1401487c4\nnop                                                                    ; +0xc9, 0x1401487c9\nlea     rdx, [rsp+78h+var_40]                                          ; +0xca, 0x1401487ca\nmov     rcx, [r14+1B8h]                                                ; +0xcf, 0x1401487cf\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 &) ; +0xd6, 0x1401487d6\nmov     rcx, rax                                                       ; +0xdc, 0x1401487dc\nmov     [rsp+78h+var_58], r15d                                         ; +0xdf, 0x1401487df\nlea     r9, ??_R0?AVGJGameLevel@@@8; GJGameLevel `RTTI Type Descriptor' ; +0xe4, 0x1401487e4\nlea     r8, ??_R0?AVCCObject@cocos2d@@@8; cocos2d::CCObject `RTTI Type Descriptor' ; +0xeb, 0x1401487eb\nxor     edx, edx                                                       ; +0xf2, 0x1401487f2\ncall    __RTDynamicCast                                                ; +0xf4, 0x1401487f4\nmov     rbx, rax                                                       ; +0xf9, 0x1401487f9\nmov     rdx, [rsp+78h+var_28]                                          ; +0xfc, 0x1401487fc\ncmp     rdx, 0Fh                                                       ; +0x101, 0x140148801\njbe     short loc_140148839                                            ; +0x105, 0x140148805\ninc     rdx                                                            ; +0x107, 0x140148807\nmov     rcx, qword ptr [rsp+78h+var_40]                                ; +0x10a, 0x14014880a\nmov     rax, rcx                                                       ; +0x10f, 0x14014880f\ncmp     rdx, 1000h                                                     ; +0x112, 0x140148812\njb      short loc_140148834                                            ; +0x119, 0x140148819\nadd     rdx, 27h ; '''                                                 ; +0x11b, 0x14014881b\nmov     rcx, [rcx-8]; Block                                            ; +0x11f, 0x14014881f\nsub     rax, rcx                                                       ; +0x123, 0x140148823\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x126, 0x140148826\ncmp     rax, 1Fh                                                       ; +0x12a, 0x14014882a\nja      loc_1401488F1                                                  ; +0x12e, 0x14014882e\ncall    j_j_free                                                       ; +0x134, 0x140148834\nmov     [rsp+78h+var_30], r15                                          ; +0x139, 0x140148839\nmov     [rsp+78h+var_28], 0Fh                                          ; +0x13e, 0x14014883e\nmov     byte ptr [rsp+78h+var_40], 0                                   ; +0x147, 0x140148847\ntest    rbx, rbx                                                       ; +0x14c, 0x14014884c\njz      short loc_1401488BB                                            ; +0x14f, 0x14014884f\nmov     eax, [rbx+388h]                                                ; +0x151, 0x140148851\nsub     eax, [rbx+38Ch]                                                ; +0x157, 0x140148857\ncmp     eax, 0Ah                                                       ; +0x15d, 0x14014885d\njge     short loc_1401488BB                                            ; +0x160, 0x140148860\nmov     eax, [rbx+330h]                                                ; +0x162, 0x140148862\nsub     eax, [rbx+32Ch]                                                ; +0x168, 0x140148868\ncmp     eax, 64h ; 'd'                                                 ; +0x16e, 0x14014886e\njnz     short loc_1401488BB                                            ; +0x171, 0x140148871\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x173, 0x140148873\ntest    rcx, rcx                                                       ; +0x17a, 0x14014887a\njnz     short loc_1401488AD                                            ; +0x17d, 0x14014887d\nmov     ecx, 3E0h; Size                                                ; +0x17f, 0x14014887f\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x184, 0x140148884\nmov     [rsp+78h+var_48], rax                                          ; +0x189, 0x140148889\nmov     rcx, rax                                                       ; +0x18e, 0x14014888e\ncall    sub_1401D0AE0                                                  ; +0x191, 0x140148891\nmov     rcx, rax                                                       ; +0x196, 0x140148896\nmov     cs:qword_1406C2EE8, rax                                        ; +0x199, 0x140148899\nmov     rax, [rax]                                                     ; +0x1a0, 0x1401488a0\ncall    qword ptr [rax+48h]                                            ; +0x1a3, 0x1401488a3\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x1a6, 0x1401488a6\nmov     rdx, rbx                                                       ; +0x1ad, 0x1401488ad\ncall    GameStatsManager__hasCompletedLevel                            ; +0x1b0, 0x1401488b0\ntest    al, al                                                         ; +0x1b5, 0x1401488b5\njz      short loc_1401488BB                                            ; +0x1b7, 0x1401488b7\ninc     esi                                                            ; +0x1b9, 0x1401488b9\nadd     rdi, 8                                                         ; +0x1bb, 0x1401488bb\ncmp     rdi, rbp                                                       ; +0x1bf, 0x1401488bf\njbe     loc_140148770                                                  ; +0x1c2, 0x1401488c2\nmov     eax, esi                                                       ; +0x1c8, 0x1401488c8\nmov     rcx, [rsp+78h+var_20]                                          ; +0x1ca, 0x1401488ca\nxor     rcx, rsp; StackCookie                                          ; +0x1cf, 0x1401488cf\ncall    __security_check_cookie                                        ; +0x1d2, 0x1401488d2\nlea     r11, [rsp+78h+var_18]                                          ; +0x1d7, 0x1401488d7\nmov     rbx, [r11+28h]                                                 ; +0x1dc, 0x1401488dc\nmov     rbp, [r11+30h]                                                 ; +0x1e0, 0x1401488e0\nmov     rsi, [r11+38h]                                                 ; +0x1e4, 0x1401488e4\nmov     rsp, r11                                                       ; +0x1e8, 0x1401488e8\npop     r15                                                            ; +0x1eb, 0x1401488eb\npop     r14                                                            ; +0x1ed, 0x1401488ed\npop     rdi                                                            ; +0x1ef, 0x1401488ef\nretn                                                                   ; +0x1f0, 0x1401488f0\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x1f1, 0x1401488f1\ndb 0CCh                                                                ; +0x1f7, 0x1401488f7", "xrefs": ["GameLevelManager::updateUserScore @ 0x14015682f", "<???> @ 0x1406ca650"], "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"}