{"type": "func", "start": 4300508192, "end": 4300508687, "name": "GameLevelManager::getCompletedEventLevels", "pseudocode": "// \n// GameLevelManager::getCompletedEventLevels from 0x100548c20 to 0x100548e0f (495 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::updateUserScore @ 0x100563b30\n// > GameLevelManager::updateUserScore @ 0x100563dc0\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:32:00 +0000\n// \n\n__int64 __fastcall GameLevelManager::getCompletedEventLevels(__int64 a1, int a2, int a3)\n{\n  __int64 v3; // r15\n  __int64 v4; // rax\n  unsigned int *v5; // rax\n  _QWORD *v6; // r13\n  _QWORD *v7; // r12\n  __int64 v8; // rbx\n  const char *CString; // r14\n  size_t v10; // rax\n  size_t v11; // rbx\n  char *v12; // r12\n  size_t v13; // r15\n  const void *v14; // rax\n  _DWORD *v15; // rbx\n  int v16; // eax\n  __int64 v17; // rax\n  bool hasCompletedLevel; // al\n  __int64 v20; // [rsp+8h] [rbp-68h]\n  _QWORD *v21; // [rsp+10h] [rbp-60h]\n  _QWORD __dst[2]; // [rsp+20h] [rbp-50h] BYREF\n  void *__p; // [rsp+30h] [rbp-40h]\n  int v24; // [rsp+38h] [rbp-38h]\n  int v25; // [rsp+3Ch] [rbp-34h]\n  __int64 v26; // [rsp+40h] [rbp-30h]\n\n  v24 = a3;\n  v25 = a2;\n  v3 = a1;\n  v4 = cocos2d::CCDictionary::allKeys(*(_QWORD *)(a1 + 848));\n  v26 = 0;\n  if ( v4 )\n  {\n    v5 = *(unsigned int **)(v4 + 56);\n    if ( *v5 )\n    {\n      v6 = *((_QWORD **)v5 + 2);\n      v7 = &v6[*v5 - 1];\n      v26 = 0;\n      v21 = v7;\n      while ( 1 )\n      {\n        v8 = *v6;\n        if ( !*v6 )\n          return v26;\n        if ( (int)cocos2d::CCString::intValue(*v6) >= 200001 )\n          break;\nLABEL_4:\n        if ( ++v6 > v7 )\n          return v26;\n      }\n      v20 = *(_QWORD *)(v3 + 848);\n      CString = (const char *)cocos2d::CCString::getCString(v8);\n      v10 = strlen(CString);\n      if ( v10 >= 0xFFFFFFFFFFFFFFF8LL )\n        sub_100003630();\n      v11 = v10;\n      if ( v10 >= 0x17 )\n      {\n        v13 = (v10 | 7) + 1;\n        if ( (v10 | 7) == 0x17 )\n          v13 = 26;\n        v12 = (char *)operator new(v13);\n        __p = v12;\n        __dst[0] = v13 + 1;\n        v3 = a1;\n        __dst[1] = v11;\n      }\n      else\n      {\n        LOBYTE(__dst[0]) = 2 * v10;\n        v12 = (char *)__dst + 1;\n        if ( !v10 )\n        {\nLABEL_15:\n          v12[v11] = 0;\n          v14 = (const void *)cocos2d::CCDictionary::objectForKey(v20, (char *)__dst);\n          v7 = v21;\n          if ( v14 )\n          {\n            v15 = __dynamic_cast(\n                    v14,\n                    (const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,\n                    (const struct __class_type_info *)&`typeinfo for'GJGameLevel,\n                    0);\n            if ( (__dst[0] & 1) == 0 )\n            {\nLABEL_18:\n              if ( v15 )\n              {\n                v16 = v15[237] - v15[238];\n                if ( v16 >= v25 && v16 <= v24 && v15[215] - v15[214] == 100 )\n                {\n                  v17 = GameStatsManager::sharedState();\n                  hasCompletedLevel = GameStatsManager::hasCompletedLevel(v17, (__int64)v15);\n                  v26 = hasCompletedLevel + (unsigned int)v26;\n                }\n              }\n              goto LABEL_4;\n            }\n          }\n          else\n          {\n            v15 = nullptr;\n            if ( (__dst[0] & 1) == 0 )\n              goto LABEL_18;\n          }\n          operator delete(__p);\n          goto LABEL_18;\n        }\n      }\n      memmove(v12, CString, v11);\n      goto LABEL_15;\n    }\n  }\n  return v26;\n}", "assembly": "; \n; GameLevelManager::getCompletedEventLevels from 0x100548c20 to 0x100548e0f (495 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::updateUserScore @ 0x100563b30\n; > GameLevelManager::updateUserScore @ 0x100563dc0\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:32:00 +0000\n; \npush    rbp                                                            ; +0x0, 0x100548c20\nmov     rbp, rsp                                                       ; +0x1, 0x100548c21\npush    r15                                                            ; +0x4, 0x100548c24\npush    r14                                                            ; +0x6, 0x100548c26\npush    r13                                                            ; +0x8, 0x100548c28\npush    r12                                                            ; +0xa, 0x100548c2a\npush    rbx                                                            ; +0xc, 0x100548c2c\nsub     rsp, 48h                                                       ; +0xd, 0x100548c2d\nmov     [rbp+var_38], edx                                              ; +0x11, 0x100548c31\nmov     [rbp+var_34], esi                                              ; +0x14, 0x100548c34\nmov     r15, rdi                                                       ; +0x17, 0x100548c37\nmov     rdi, [rdi+350h]                                                ; +0x1a, 0x100548c3a\ncall    cocos2d__CCDictionary__allKeys                                 ; +0x21, 0x100548c41\nmov     [rbp+var_30], 0                                                ; +0x26, 0x100548c46\ntest    rax, rax                                                       ; +0x2e, 0x100548c4e\njz      loc_100548DF7                                                  ; +0x31, 0x100548c51\nmov     rax, [rax+38h]                                                 ; +0x37, 0x100548c57\nmov     ecx, [rax]                                                     ; +0x3b, 0x100548c5b\ntest    rcx, rcx                                                       ; +0x3d, 0x100548c5d\njz      loc_100548DF7                                                  ; +0x40, 0x100548c60\nmov     r13, [rax+10h]                                                 ; +0x46, 0x100548c66\nlea     r12, ds:0FFFFFFFFFFFFFFF8h[rcx*8]                              ; +0x4a, 0x100548c6a\nadd     r12, r13                                                       ; +0x52, 0x100548c72\nmov     [rbp+var_30], 0                                                ; +0x55, 0x100548c75\nmov     [rbp+var_58], r15                                              ; +0x5d, 0x100548c7d\nmov     [rbp+var_60], r12                                              ; +0x61, 0x100548c81\njmp     short loc_100548C9D                                            ; +0x65, 0x100548c85\nalign 10h                                                              ; +0x67, 0x100548c87\nadd     r13, 8                                                         ; +0x70, 0x100548c90\ncmp     r13, r12                                                       ; +0x74, 0x100548c94\nja      loc_100548DF7                                                  ; +0x77, 0x100548c97\nmov     rbx, [r13+0]                                                   ; +0x7d, 0x100548c9d\ntest    rbx, rbx                                                       ; +0x81, 0x100548ca1\njz      loc_100548DF7                                                  ; +0x84, 0x100548ca4\nmov     rdi, rbx                                                       ; +0x8a, 0x100548caa\ncall    cocos2d__CCString__intValue                                    ; +0x8d, 0x100548cad\ncmp     eax, 30D41h                                                    ; +0x92, 0x100548cb2\njl      short loc_100548C90                                            ; +0x97, 0x100548cb7\nmov     rax, [r15+350h]                                                ; +0x99, 0x100548cb9\nmov     [rbp+var_68], rax                                              ; +0xa0, 0x100548cc0\nmov     rdi, rbx                                                       ; +0xa4, 0x100548cc4\ncall    cocos2d__CCString__getCString                                  ; +0xa7, 0x100548cc7\nmov     r14, rax                                                       ; +0xac, 0x100548ccc\nmov     rdi, rax; __s                                                  ; +0xaf, 0x100548ccf\ncall    _strlen                                                        ; +0xb2, 0x100548cd2\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xb7, 0x100548cd7\njnb     loc_100548E0A                                                  ; +0xbb, 0x100548cdb\nmov     rbx, rax                                                       ; +0xc1, 0x100548ce1\ncmp     rax, 17h                                                       ; +0xc4, 0x100548ce4\njnb     short loc_100548D00                                            ; +0xc8, 0x100548ce8\nlea     eax, [rbx+rbx]                                                 ; +0xca, 0x100548cea\nmov     byte ptr [rbp+__dst], al                                       ; +0xcd, 0x100548ced\nlea     r12, [rbp+__dst+1]                                             ; +0xd0, 0x100548cf0\ntest    rbx, rbx                                                       ; +0xd4, 0x100548cf4\njnz     short loc_100548D36                                            ; +0xd7, 0x100548cf7\njmp     short loc_100548D44                                            ; +0xd9, 0x100548cf9\nalign 20h                                                              ; +0xdb, 0x100548cfb\nmov     rax, rbx                                                       ; +0xe0, 0x100548d00\nor      rax, 7                                                         ; +0xe3, 0x100548d03\nlea     r15, [rax+1]                                                   ; +0xe7, 0x100548d07\ncmp     rax, 17h                                                       ; +0xeb, 0x100548d0b\nmov     eax, 1Ah                                                       ; +0xef, 0x100548d0f\ncmovz   r15, rax                                                       ; +0xf4, 0x100548d14\nmov     rdi, r15; __sz                                                 ; +0xf8, 0x100548d18\ncall    __Znwm; operator new(ulong)                                    ; +0xfb, 0x100548d1b\nmov     r12, rax                                                       ; +0x100, 0x100548d20\nmov     [rbp+__p], rax                                                 ; +0x103, 0x100548d23\ninc     r15                                                            ; +0x107, 0x100548d27\nmov     [rbp+__dst], r15                                               ; +0x10a, 0x100548d2a\nmov     r15, [rbp+var_58]                                              ; +0x10e, 0x100548d2e\nmov     [rbp+var_48], rbx                                              ; +0x112, 0x100548d32\nmov     rdi, r12; __dst                                                ; +0x116, 0x100548d36\nmov     rsi, r14; __src                                                ; +0x119, 0x100548d39\nmov     rdx, rbx; __len                                                ; +0x11c, 0x100548d3c\ncall    _memmove                                                       ; +0x11f, 0x100548d3f\nmov     byte ptr [r12+rbx], 0                                          ; +0x124, 0x100548d44\nmov     rdi, [rbp+var_68]                                              ; +0x129, 0x100548d49\nlea     rsi, [rbp+__dst]                                               ; +0x12d, 0x100548d4d\ncall    cocos2d__CCDictionary__objectForKey                            ; +0x131, 0x100548d51\ntest    rax, rax                                                       ; +0x136, 0x100548d56\nmov     r12, [rbp+var_60]                                              ; +0x139, 0x100548d59\njz      loc_100548DED                                                  ; +0x13d, 0x100548d5d\nmov     rdi, rax; lpsrc                                                ; +0x143, 0x100548d63\nlea     rsi, _ZTIN7cocos2d8CCObjectE; lpstype                          ; +0x146, 0x100548d66\nlea     rdx, _ZTI11GJGameLevel; lpdtype                                ; +0x14d, 0x100548d6d\nxor     ecx, ecx; s2d                                                  ; +0x154, 0x100548d74\ncall    ___dynamic_cast                                                ; +0x156, 0x100548d76\nmov     rbx, rax                                                       ; +0x15b, 0x100548d7b\ntest    byte ptr [rbp+__dst], 1                                        ; +0x15e, 0x100548d7e\njz      short loc_100548D8D                                            ; +0x162, 0x100548d82\nmov     rdi, [rbp+__p]; __p                                            ; +0x164, 0x100548d84\ncall    __ZdlPv; operator delete(void *)                               ; +0x168, 0x100548d88\ntest    rbx, rbx                                                       ; +0x16d, 0x100548d8d\njz      loc_100548C90                                                  ; +0x170, 0x100548d90\nmov     eax, [rbx+3B4h]                                                ; +0x176, 0x100548d96\nsub     eax, [rbx+3B8h]                                                ; +0x17c, 0x100548d9c\ncmp     eax, [rbp+var_34]                                              ; +0x182, 0x100548da2\nsetl    cl                                                             ; +0x185, 0x100548da5\ncmp     eax, [rbp+var_38]                                              ; +0x188, 0x100548da8\nsetnle  al                                                             ; +0x18b, 0x100548dab\nor      al, cl                                                         ; +0x18e, 0x100548dae\njnz     loc_100548C90                                                  ; +0x190, 0x100548db0\nmov     eax, [rbx+35Ch]                                                ; +0x196, 0x100548db6\nsub     eax, [rbx+358h]                                                ; +0x19c, 0x100548dbc\ncmp     eax, 64h ; 'd'                                                 ; +0x1a2, 0x100548dc2\njnz     loc_100548C90                                                  ; +0x1a5, 0x100548dc5\ncall    GameStatsManager__sharedState                                  ; +0x1ab, 0x100548dcb\nmov     rdi, rax                                                       ; +0x1b0, 0x100548dd0\nmov     rsi, rbx                                                       ; +0x1b3, 0x100548dd3\ncall    GameStatsManager__hasCompletedLevel                            ; +0x1b6, 0x100548dd6\nmovzx   eax, al                                                        ; +0x1bb, 0x100548ddb\nmov     rcx, [rbp+var_30]                                              ; +0x1be, 0x100548dde\nadd     ecx, eax                                                       ; +0x1c2, 0x100548de2\nmov     [rbp+var_30], rcx                                              ; +0x1c4, 0x100548de4\njmp     loc_100548C90                                                  ; +0x1c8, 0x100548de8\nxor     ebx, ebx                                                       ; +0x1cd, 0x100548ded\ntest    byte ptr [rbp+__dst], 1                                        ; +0x1cf, 0x100548def\njnz     short loc_100548D84                                            ; +0x1d3, 0x100548df3\njmp     short loc_100548D8D                                            ; +0x1d5, 0x100548df5\nmov     rax, [rbp+var_30]                                              ; +0x1d7, 0x100548df7\nadd     rsp, 48h                                                       ; +0x1db, 0x100548dfb\npop     rbx                                                            ; +0x1df, 0x100548dff\npop     r12                                                            ; +0x1e0, 0x100548e00\npop     r13                                                            ; +0x1e2, 0x100548e02\npop     r14                                                            ; +0x1e4, 0x100548e04\npop     r15                                                            ; +0x1e6, 0x100548e06\npop     rbp                                                            ; +0x1e8, 0x100548e08\nretn                                                                   ; +0x1e9, 0x100548e09\ncall    sub_100003630                                                  ; +0x1ea, 0x100548e0a", "xrefs": ["GameLevelManager::updateUserScore @ 0x100563b30", "GameLevelManager::updateUserScore @ 0x100563dc0"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}