{"type": "func", "start": 5370061872, "end": 5370062556, "name": "GameLevelManager::purgeUnusedLevels", "pseudocode": "// \n// GameLevelManager::purgeUnusedLevels from 0x14014a430 to 0x14014a6dc (684 bytes)\n// \n// 3 xrefs:\n// > GameLevelManager::encodeDataTo @ 0x14014af3c\n// > GameLevelManager::dataLoaded @ 0x14014c504\n// > <???> @ 0x1406ca734\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\nvoid GameLevelManager::purgeUnusedLevels(GameLevelManager *a1)\n{\n  cocos2d::CCArray *v2; // rbp\n  unsigned int i; // esi\n  unsigned int v4; // eax\n  cocos2d::CCString *v5; // rax\n  const char *CString; // rax\n  const char *v7; // rdi\n  size_t v8; // r8\n  __int64 v9; // rbx\n  void *v10; // rcx\n  int v11; // ecx\n  size_t v12; // r8\n  void *v13; // rcx\n  __int128 v14; // [rsp+20h] [rbp-68h] BYREF\n  __int64 v15; // [rsp+30h] [rbp-58h]\n  unsigned __int64 v16; // [rsp+38h] [rbp-50h]\n  __int128 v17; // [rsp+40h] [rbp-48h] BYREF\n  __int64 v18; // [rsp+50h] [rbp-38h]\n  unsigned __int64 v19; // [rsp+58h] [rbp-30h]\n\n  v2 = cocos2d::CCDictionary::allKeys(a1->m_onlineLevels);\n  for ( i = 0; i < cocos2d::CCArray::count(v2); ++i )\n  {\n    v4 = cocos2d::CCArray::count(v2);\n    v5 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v2, v4 + -1 - i);\n    CString = cocos2d::CCString::getCString(v5);\n    v7 = CString;\n    v14 = 0;\n    v15 = 0;\n    v16 = 0;\n    v8 = -1;\n    do\n      ++v8;\n    while ( CString[v8] );\n    sub_14003A930(&v14, CString, v8);\n    v9 = cocos2d::CCDictionary::objectForKey(a1->m_onlineLevels, &v14);\n    if ( v16 > 0xF )\n    {\n      v10 = (void *)v14;\n      if ( v16 + 1 >= 0x1000 )\n      {\n        v10 = *(void **)(v14 - 8);\n        if ( (unsigned __int64)(v14 - (_QWORD)v10 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v10);\n    }\n    v15 = 0;\n    v16 = 15;\n    LOBYTE(v14) = 0;\n    if ( *(_BYTE *)(v9 + 1073) && *(int *)(v9 + 872) <= 0 )\n    {\n      if ( (v11 = *(_DWORD *)(v9 + 816) - *(_DWORD *)(v9 + 812), v11 <= 0)\n        && *(int *)(v9 + 844) <= 0\n        && !*(_DWORD *)(v9 + 1300)\n        && !*(_DWORD *)(v9 + 1352)\n        && !*(_BYTE *)(v9 + 805)\n        || *(_DWORD *)(v9 + 904) - *(_DWORD *)(v9 + 908) <= 0\n        && (v11 < 10\n         && *(_DWORD *)(v9 + 752) - *(_DWORD *)(v9 + 756) < 5\n         && !*(_DWORD *)(v9 + 1300)\n         && !*(_DWORD *)(v9 + 1352)\n         || *(int *)(v9 + 856) <= 1\n         && v11 < 100\n         && *(_DWORD *)(v9 + 752) - *(_DWORD *)(v9 + 756) < 10\n         && !*(_DWORD *)(v9 + 1300)\n         && !*(_DWORD *)(v9 + 1352)) )\n      {\n        v17 = 0;\n        v18 = 0;\n        v19 = 0;\n        v12 = -1;\n        do\n          ++v12;\n        while ( v7[v12] );\n        sub_14003A930(&v17, v7, v12);\n        cocos2d::CCDictionary::removeObjectForKey(a1->m_onlineLevels, &v17);\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      }\n    }\n  }\n}", "assembly": "; \n; GameLevelManager::purgeUnusedLevels from 0x14014a430 to 0x14014a6dc (684 bytes)\n; \n; 3 xrefs:\n; > GameLevelManager::encodeDataTo @ 0x14014af3c\n; > GameLevelManager::dataLoaded @ 0x14014c504\n; > <???> @ 0x1406ca734\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, 0x14014a430\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x14014a435\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x14014a43a\npush    rdi                                                            ; +0xf, 0x14014a43f\npush    r14                                                            ; +0x10, 0x14014a440\npush    r15                                                            ; +0x12, 0x14014a442\nsub     rsp, 70h                                                       ; +0x14, 0x14014a444\nmov     rax, cs:__security_cookie                                      ; +0x18, 0x14014a448\nxor     rax, rsp                                                       ; +0x1f, 0x14014a44f\nmov     [rsp+88h+var_28], rax                                          ; +0x22, 0x14014a452\nmov     r14, rcx                                                       ; +0x27, 0x14014a457\nmov     rcx, [rcx+160h]                                                ; +0x2a, 0x14014a45a\ncall    cs:?allKeys@CCDictionary@cocos2d@@QEAAPEAVCCArray@2@XZ; cocos2d::CCDictionary::allKeys(void) ; +0x31, 0x14014a461\nmov     rbp, rax                                                       ; +0x37, 0x14014a467\nxor     r15d, r15d                                                     ; +0x3a, 0x14014a46a\nmov     esi, r15d                                                      ; +0x3d, 0x14014a46d\nmov     rcx, rax                                                       ; +0x40, 0x14014a470\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x43, 0x14014a473\ntest    eax, eax                                                       ; +0x49, 0x14014a479\njz      loc_14014A6A7                                                  ; +0x4b, 0x14014a47b\nmov     rcx, rbp                                                       ; +0x51, 0x14014a481\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x54, 0x14014a484\nmov     edx, 0FFFFFFFFh                                                ; +0x5a, 0x14014a48a\nsub     edx, esi                                                       ; +0x5f, 0x14014a48f\nadd     edx, eax                                                       ; +0x61, 0x14014a491\nmov     rcx, rbp                                                       ; +0x63, 0x14014a493\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x66, 0x14014a496\nmov     rcx, rax                                                       ; +0x6c, 0x14014a49c\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x6f, 0x14014a49f\nmov     rdi, rax                                                       ; +0x75, 0x14014a4a5\nxorps   xmm0, xmm0                                                     ; +0x78, 0x14014a4a8\nmovups  [rsp+88h+var_68], xmm0                                         ; +0x7b, 0x14014a4ab\nmov     [rsp+88h+var_58], r15                                          ; +0x80, 0x14014a4b0\nmov     [rsp+88h+var_50], r15                                          ; +0x85, 0x14014a4b5\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x8a, 0x14014a4ba\ninc     r8                                                             ; +0x91, 0x14014a4c1\ncmp     byte ptr [rax+r8], 0                                           ; +0x94, 0x14014a4c4\njnz     short loc_14014A4C1                                            ; +0x99, 0x14014a4c9\nmov     rdx, rdi                                                       ; +0x9b, 0x14014a4cb\nlea     rcx, [rsp+88h+var_68]                                          ; +0x9e, 0x14014a4ce\ncall    sub_14003A930                                                  ; +0xa3, 0x14014a4d3\nnop                                                                    ; +0xa8, 0x14014a4d8\nlea     rdx, [rsp+88h+var_68]                                          ; +0xa9, 0x14014a4d9\nmov     rcx, [r14+160h]                                                ; +0xae, 0x14014a4de\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 &) ; +0xb5, 0x14014a4e5\nmov     rbx, rax                                                       ; +0xbb, 0x14014a4eb\nmov     rdx, [rsp+88h+var_50]                                          ; +0xbe, 0x14014a4ee\ncmp     rdx, 0Fh                                                       ; +0xc3, 0x14014a4f3\njbe     short loc_14014A52B                                            ; +0xc7, 0x14014a4f7\ninc     rdx                                                            ; +0xc9, 0x14014a4f9\nmov     rcx, qword ptr [rsp+88h+var_68]                                ; +0xcc, 0x14014a4fc\nmov     rax, rcx                                                       ; +0xd1, 0x14014a501\ncmp     rdx, 1000h                                                     ; +0xd4, 0x14014a504\njb      short loc_14014A526                                            ; +0xdb, 0x14014a50b\nadd     rdx, 27h ; '''                                                 ; +0xdd, 0x14014a50d\nmov     rcx, [rcx-8]; Block                                            ; +0xe1, 0x14014a511\nsub     rax, rcx                                                       ; +0xe5, 0x14014a515\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xe8, 0x14014a518\ncmp     rax, 1Fh                                                       ; +0xec, 0x14014a51c\nja      loc_14014A6CE                                                  ; +0xf0, 0x14014a520\ncall    j_j_free                                                       ; +0xf6, 0x14014a526\nmov     [rsp+88h+var_58], r15                                          ; +0xfb, 0x14014a52b\nmov     [rsp+88h+var_50], 0Fh                                          ; +0x100, 0x14014a530\nmov     byte ptr [rsp+88h+var_68], 0                                   ; +0x109, 0x14014a539\ncmp     byte ptr [rbx+431h], 0                                         ; +0x10e, 0x14014a53e\njz      loc_14014A694                                                  ; +0x115, 0x14014a545\ncmp     dword ptr [rbx+368h], 0                                        ; +0x11b, 0x14014a54b\njg      loc_14014A694                                                  ; +0x122, 0x14014a552\nmov     ecx, [rbx+330h]                                                ; +0x128, 0x14014a558\nsub     ecx, [rbx+32Ch]                                                ; +0x12e, 0x14014a55e\ntest    ecx, ecx                                                       ; +0x134, 0x14014a564\njg      short loc_14014A590                                            ; +0x136, 0x14014a566\ncmp     dword ptr [rbx+34Ch], 0                                        ; +0x138, 0x14014a568\njg      short loc_14014A590                                            ; +0x13f, 0x14014a56f\ncmp     dword ptr [rbx+514h], 0                                        ; +0x141, 0x14014a571\njnz     short loc_14014A590                                            ; +0x148, 0x14014a578\ncmp     dword ptr [rbx+548h], 0                                        ; +0x14a, 0x14014a57a\njnz     short loc_14014A590                                            ; +0x151, 0x14014a581\ncmp     byte ptr [rbx+325h], 0                                         ; +0x153, 0x14014a583\njz      loc_14014A611                                                  ; +0x15a, 0x14014a58a\nmov     eax, [rbx+388h]                                                ; +0x160, 0x14014a590\nsub     eax, [rbx+38Ch]                                                ; +0x166, 0x14014a596\ntest    eax, eax                                                       ; +0x16c, 0x14014a59c\njg      loc_14014A694                                                  ; +0x16e, 0x14014a59e\ncmp     ecx, 0Ah                                                       ; +0x174, 0x14014a5a4\njge     short loc_14014A5CC                                            ; +0x177, 0x14014a5a7\nmov     eax, [rbx+2F0h]                                                ; +0x179, 0x14014a5a9\nsub     eax, [rbx+2F4h]                                                ; +0x17f, 0x14014a5af\ncmp     eax, 5                                                         ; +0x185, 0x14014a5b5\njge     short loc_14014A5CC                                            ; +0x188, 0x14014a5b8\ncmp     dword ptr [rbx+514h], 0                                        ; +0x18a, 0x14014a5ba\njnz     short loc_14014A5CC                                            ; +0x191, 0x14014a5c1\ncmp     dword ptr [rbx+548h], 0                                        ; +0x193, 0x14014a5c3\njz      short loc_14014A611                                            ; +0x19a, 0x14014a5ca\ncmp     dword ptr [rbx+358h], 1                                        ; +0x19c, 0x14014a5cc\njg      loc_14014A694                                                  ; +0x1a3, 0x14014a5d3\ncmp     ecx, 64h ; 'd'                                                 ; +0x1a9, 0x14014a5d9\njge     loc_14014A694                                                  ; +0x1ac, 0x14014a5dc\nmov     eax, [rbx+2F0h]                                                ; +0x1b2, 0x14014a5e2\nsub     eax, [rbx+2F4h]                                                ; +0x1b8, 0x14014a5e8\ncmp     eax, 0Ah                                                       ; +0x1be, 0x14014a5ee\njge     loc_14014A694                                                  ; +0x1c1, 0x14014a5f1\ncmp     dword ptr [rbx+514h], 0                                        ; +0x1c7, 0x14014a5f7\njnz     loc_14014A694                                                  ; +0x1ce, 0x14014a5fe\ncmp     dword ptr [rbx+548h], 0                                        ; +0x1d4, 0x14014a604\njnz     loc_14014A694                                                  ; +0x1db, 0x14014a60b\nxorps   xmm0, xmm0                                                     ; +0x1e1, 0x14014a611\nmovups  [rsp+88h+var_48], xmm0                                         ; +0x1e4, 0x14014a614\nmov     [rsp+88h+var_38], r15                                          ; +0x1e9, 0x14014a619\nmov     [rsp+88h+var_30], r15                                          ; +0x1ee, 0x14014a61e\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x1f3, 0x14014a623\nnop     word ptr [rax+rax+00h]                                         ; +0x1fa, 0x14014a62a\ninc     r8                                                             ; +0x200, 0x14014a630\ncmp     byte ptr [rdi+r8], 0                                           ; +0x203, 0x14014a633\njnz     short loc_14014A630                                            ; +0x208, 0x14014a638\nmov     rdx, rdi                                                       ; +0x20a, 0x14014a63a\nlea     rcx, [rsp+88h+var_48]                                          ; +0x20d, 0x14014a63d\ncall    sub_14003A930                                                  ; +0x212, 0x14014a642\nnop                                                                    ; +0x217, 0x14014a647\nlea     rdx, [rsp+88h+var_48]                                          ; +0x218, 0x14014a648\nmov     rcx, [r14+160h]                                                ; +0x21d, 0x14014a64d\ncall    cs:?removeObjectForKey@CCDictionary@cocos2d@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::removeObjectForKey(std::string const &) ; +0x224, 0x14014a654\nnop                                                                    ; +0x22a, 0x14014a65a\nmov     rdx, [rsp+88h+var_30]                                          ; +0x22b, 0x14014a65b\ncmp     rdx, 0Fh                                                       ; +0x230, 0x14014a660\njbe     short loc_14014A694                                            ; +0x234, 0x14014a664\ninc     rdx                                                            ; +0x236, 0x14014a666\nmov     rcx, qword ptr [rsp+88h+var_48]                                ; +0x239, 0x14014a669\nmov     rax, rcx                                                       ; +0x23e, 0x14014a66e\ncmp     rdx, 1000h                                                     ; +0x241, 0x14014a671\njb      short loc_14014A68F                                            ; +0x248, 0x14014a678\nadd     rdx, 27h ; '''                                                 ; +0x24a, 0x14014a67a\nmov     rcx, [rcx-8]; Block                                            ; +0x24e, 0x14014a67e\nsub     rax, rcx                                                       ; +0x252, 0x14014a682\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x255, 0x14014a685\ncmp     rax, 1Fh                                                       ; +0x259, 0x14014a689\nja      short loc_14014A6D5                                            ; +0x25d, 0x14014a68d\ncall    j_j_free                                                       ; +0x25f, 0x14014a68f\ninc     esi                                                            ; +0x264, 0x14014a694\nmov     rcx, rbp                                                       ; +0x266, 0x14014a696\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x269, 0x14014a699\ncmp     esi, eax                                                       ; +0x26f, 0x14014a69f\njb      loc_14014A481                                                  ; +0x271, 0x14014a6a1\nmov     rcx, [rsp+88h+var_28]                                          ; +0x277, 0x14014a6a7\nxor     rcx, rsp; StackCookie                                          ; +0x27c, 0x14014a6ac\ncall    __security_check_cookie                                        ; +0x27f, 0x14014a6af\nlea     r11, [rsp+88h+var_18]                                          ; +0x284, 0x14014a6b4\nmov     rbx, [r11+28h]                                                 ; +0x289, 0x14014a6b9\nmov     rbp, [r11+30h]                                                 ; +0x28d, 0x14014a6bd\nmov     rsi, [r11+38h]                                                 ; +0x291, 0x14014a6c1\nmov     rsp, r11                                                       ; +0x295, 0x14014a6c5\npop     r15                                                            ; +0x298, 0x14014a6c8\npop     r14                                                            ; +0x29a, 0x14014a6ca\npop     rdi                                                            ; +0x29c, 0x14014a6cc\nretn                                                                   ; +0x29d, 0x14014a6cd\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x29e, 0x14014a6ce\ndb 0CCh                                                                ; +0x2a4, 0x14014a6d4\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x2a5, 0x14014a6d5\ndb 0CCh                                                                ; +0x2ab, 0x14014a6db", "xrefs": ["GameLevelManager::encodeDataTo @ 0x14014af3c", "GameLevelManager::dataLoaded @ 0x14014c504", "<???> @ 0x1406ca734"], "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"}