{"type": "func", "start": 5370050240, "end": 5370050711, "name": "GameLevelManager::updateLevelOrders", "pseudocode": "// \n// GameLevelManager::updateLevelOrders from 0x1401476c0 to 0x140147897 (471 bytes)\n// \n// 3 xrefs:\n// > GameLevelManager::encodeDataTo @ 0x14014af44\n// > GameLevelManager::encodeDataTo @ 0x14014af4c\n// > <???> @ 0x1406ca614\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=1\nvoid GameLevelManager::updateLevelOrders(GameLevelManager *a1)\n{\n  cocos2d::CCArray *v2; // rbp\n  cocos2d::CCArray *v3; // r14\n  signed int v4; // ebx\n  unsigned int i; // esi\n  unsigned int v6; // eax\n  cocos2d::CCString *v7; // rax\n  const char *CString; // rax\n  size_t v9; // r8\n  __int64 v10; // rdi\n  void *v11; // rcx\n  int v12; // eax\n  signed int v13; // esi\n  unsigned int v14; // edi\n  __int128 v15; // [rsp+20h] [rbp-48h] BYREF\n  __int64 v16; // [rsp+30h] [rbp-38h]\n  unsigned __int64 v17; // [rsp+38h] [rbp-30h]\n\n  v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);\n  v3 = cocos2d::CCDictionary::allKeys(a1->m_onlineLevels);\n  v4 = 0;\n  for ( i = 0; i < cocos2d::CCArray::count(v3); ++i )\n  {\n    v6 = cocos2d::CCArray::count(v3);\n    v7 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v3, v6 + -1 - i);\n    CString = cocos2d::CCString::getCString(v7);\n    v15 = 0;\n    v16 = 0;\n    v17 = 0;\n    v9 = -1;\n    do\n      ++v9;\n    while ( CString[v9] );\n    sub_14003A930(&v15, CString, v9);\n    v10 = cocos2d::CCDictionary::objectForKey(a1->m_onlineLevels, &v15);\n    if ( v17 > 0xF )\n    {\n      v11 = (void *)v15;\n      if ( v17 + 1 >= 0x1000 )\n      {\n        v11 = *(void **)(v15 - 8);\n        if ( (unsigned __int64)(v15 - (_QWORD)v11 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v11);\n    }\n    v16 = 0;\n    v17 = 15;\n    LOBYTE(v15) = 0;\n    if ( *(_BYTE *)(v10 + 1073) )\n      *(_DWORD *)(v10 + 696) = 0;\n    else\n      cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v10);\n  }\n  if ( cocos2d::CCArray::count(v2) )\n    qsort(v2->data->arr, v2->data->num, 8u, (_CoreCrtNonSecureSearchSortCompareFunction)sub_140142B30);\n  v12 = cocos2d::CCArray::count(v2);\n  v13 = v12;\n  if ( v12 > 0 )\n  {\n    v14 = v12;\n    do\n      cocos2d::CCArray::objectAtIndex(v2, v4++)[12].m_uAutoReleaseCount = v14--;\n    while ( v4 < v13 );\n  }\n}", "assembly": "; \n; GameLevelManager::updateLevelOrders from 0x1401476c0 to 0x140147897 (471 bytes)\n; \n; 3 xrefs:\n; > GameLevelManager::encodeDataTo @ 0x14014af44\n; > GameLevelManager::encodeDataTo @ 0x14014af4c\n; > <???> @ 0x1406ca614\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, 0x1401476c0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1401476c5\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x1401476ca\npush    rdi                                                            ; +0xf, 0x1401476cf\npush    r14                                                            ; +0x10, 0x1401476d0\npush    r15                                                            ; +0x12, 0x1401476d2\nsub     rsp, 50h                                                       ; +0x14, 0x1401476d4\nmov     rax, cs:__security_cookie                                      ; +0x18, 0x1401476d8\nxor     rax, rsp                                                       ; +0x1f, 0x1401476df\nmov     [rsp+68h+var_28], rax                                          ; +0x22, 0x1401476e2\nmov     r15, rcx                                                       ; +0x27, 0x1401476e7\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ                        ; +0x2a, 0x1401476ea\nmov     rbp, rax                                                       ; +0x30, 0x1401476f0\nmov     rcx, [r15+160h]                                                ; +0x33, 0x1401476f3\ncall    cs:?allKeys@CCDictionary@cocos2d@@QEAAPEAVCCArray@2@XZ         ; +0x3a, 0x1401476fa\nmov     r14, rax                                                       ; +0x40, 0x140147700\nxor     ebx, ebx                                                       ; +0x43, 0x140147703\nmov     esi, ebx                                                       ; +0x45, 0x140147705\nmov     rcx, rax                                                       ; +0x47, 0x140147707\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ                             ; +0x4a, 0x14014770a\ntest    eax, eax                                                       ; +0x50, 0x140147710\njz      loc_14014780D                                                  ; +0x52, 0x140147712\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x58, 0x140147718\nmov     rcx, r14                                                       ; +0x60, 0x140147720\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ                             ; +0x63, 0x140147723\nmov     edx, 0FFFFFFFFh                                                ; +0x69, 0x140147729\nsub     edx, esi                                                       ; +0x6e, 0x14014772e\nadd     edx, eax                                                       ; +0x70, 0x140147730\nmov     rcx, r14                                                       ; +0x72, 0x140147732\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z      ; +0x75, 0x140147735\nmov     rcx, rax                                                       ; +0x7b, 0x14014773b\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ                    ; +0x7e, 0x14014773e\nxorps   xmm0, xmm0                                                     ; +0x84, 0x140147744\nmovups  [rsp+68h+var_48], xmm0                                         ; +0x87, 0x140147747\nmov     [rsp+68h+var_38], rbx                                          ; +0x8c, 0x14014774c\nmov     [rsp+68h+var_30], rbx                                          ; +0x91, 0x140147751\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x96, 0x140147756\nnop     dword ptr [rax]                                                ; +0x9d, 0x14014775d\ninc     r8                                                             ; +0xa0, 0x140147760\ncmp     byte ptr [rax+r8], 0                                           ; +0xa3, 0x140147763\njnz     short loc_140147760                                            ; +0xa8, 0x140147768\nmov     rdx, rax                                                       ; +0xaa, 0x14014776a\nlea     rcx, [rsp+68h+var_48]                                          ; +0xad, 0x14014776d\ncall    sub_14003A930                                                  ; +0xb2, 0x140147772\nnop                                                                    ; +0xb7, 0x140147777\nlea     rdx, [rsp+68h+var_48]                                          ; +0xb8, 0x140147778\nmov     rcx, [r15+160h]                                                ; +0xbd, 0x14014777d\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z ; +0xc4, 0x140147784\nmov     rdi, rax                                                       ; +0xca, 0x14014778a\nmov     rdx, [rsp+68h+var_30]                                          ; +0xcd, 0x14014778d\ncmp     rdx, 0Fh                                                       ; +0xd2, 0x140147792\njbe     short loc_1401477CA                                            ; +0xd6, 0x140147796\ninc     rdx                                                            ; +0xd8, 0x140147798\nmov     rcx, qword ptr [rsp+68h+var_48]                                ; +0xdb, 0x14014779b\nmov     rax, rcx                                                       ; +0xe0, 0x1401477a0\ncmp     rdx, 1000h                                                     ; +0xe3, 0x1401477a3\njb      short loc_1401477C5                                            ; +0xea, 0x1401477aa\nadd     rdx, 27h ; '''                                                 ; +0xec, 0x1401477ac\nmov     rcx, [rcx-8]; Block                                            ; +0xf0, 0x1401477b0\nsub     rax, rcx                                                       ; +0xf4, 0x1401477b4\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xf7, 0x1401477b7\ncmp     rax, 1Fh                                                       ; +0xfb, 0x1401477bb\nja      loc_140147890                                                  ; +0xff, 0x1401477bf\ncall    j_j_free                                                       ; +0x105, 0x1401477c5\nmov     [rsp+68h+var_38], rbx                                          ; +0x10a, 0x1401477ca\nmov     [rsp+68h+var_30], 0Fh                                          ; +0x10f, 0x1401477cf\nmov     byte ptr [rsp+68h+var_48], 0                                   ; +0x118, 0x1401477d8\ncmp     byte ptr [rdi+431h], 0                                         ; +0x11d, 0x1401477dd\njnz     short loc_1401477F4                                            ; +0x124, 0x1401477e4\nmov     rdx, rdi                                                       ; +0x126, 0x1401477e6\nmov     rcx, rbp                                                       ; +0x129, 0x1401477e9\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z          ; +0x12c, 0x1401477ec\njmp     short loc_1401477FA                                            ; +0x132, 0x1401477f2\nmov     [rdi+2B8h], ebx                                                ; +0x134, 0x1401477f4\ninc     esi                                                            ; +0x13a, 0x1401477fa\nmov     rcx, r14                                                       ; +0x13c, 0x1401477fc\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ                             ; +0x13f, 0x1401477ff\ncmp     esi, eax                                                       ; +0x145, 0x140147805\njb      loc_140147720                                                  ; +0x147, 0x140147807\nmov     rcx, rbp                                                       ; +0x14d, 0x14014780d\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ                             ; +0x150, 0x140147810\ntest    eax, eax                                                       ; +0x156, 0x140147816\njz      short loc_140147837                                            ; +0x158, 0x140147818\nmov     rcx, [rbp+38h]                                                 ; +0x15a, 0x14014781a\nmov     edx, [rcx]; NumOfElements                                      ; +0x15e, 0x14014781e\nlea     r9, sub_140142B30; CompareFunction                             ; +0x160, 0x140147820\nmov     r8d, 8; SizeOfElements                                         ; +0x167, 0x140147827\nmov     rcx, [rcx+10h]; Base                                           ; +0x16d, 0x14014782d\ncall    cs:qsort                                                       ; +0x171, 0x140147831\nmov     rcx, rbp                                                       ; +0x177, 0x140147837\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ                             ; +0x17a, 0x14014783a\nmov     esi, eax                                                       ; +0x180, 0x140147840\ntest    eax, eax                                                       ; +0x182, 0x140147842\njle     short loc_140147869                                            ; +0x184, 0x140147844\nmov     edi, eax                                                       ; +0x186, 0x140147846\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x188, 0x140147848\nmov     edx, ebx                                                       ; +0x190, 0x140147850\nmov     rcx, rbp                                                       ; +0x192, 0x140147852\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z      ; +0x195, 0x140147855\nmov     [rax+2B8h], edi                                                ; +0x19b, 0x14014785b\ninc     ebx                                                            ; +0x1a1, 0x140147861\ndec     edi                                                            ; +0x1a3, 0x140147863\ncmp     ebx, esi                                                       ; +0x1a5, 0x140147865\njl      short loc_140147850                                            ; +0x1a7, 0x140147867\nmov     rcx, [rsp+68h+var_28]                                          ; +0x1a9, 0x140147869\nxor     rcx, rsp; StackCookie                                          ; +0x1ae, 0x14014786e\ncall    __security_check_cookie                                        ; +0x1b1, 0x140147871\nlea     r11, [rsp+68h+var_18]                                          ; +0x1b6, 0x140147876\nmov     rbx, [r11+28h]                                                 ; +0x1bb, 0x14014787b\nmov     rbp, [r11+30h]                                                 ; +0x1bf, 0x14014787f\nmov     rsi, [r11+38h]                                                 ; +0x1c3, 0x140147883\nmov     rsp, r11                                                       ; +0x1c7, 0x140147887\npop     r15                                                            ; +0x1ca, 0x14014788a\npop     r14                                                            ; +0x1cc, 0x14014788c\npop     rdi                                                            ; +0x1ce, 0x14014788e\nretn                                                                   ; +0x1cf, 0x14014788f\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x1d0, 0x140147890\ndb 0CCh                                                                ; +0x1d6, 0x140147896", "xrefs": ["GameLevelManager::encodeDataTo @ 0x14014af44", "GameLevelManager::encodeDataTo @ 0x14014af4c", "<???> @ 0x1406ca614"], "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"}