{"type": "func", "start": 5370050064, "end": 5370050234, "name": "GameLevelManager::getSavedLevelLists", "pseudocode": "// \n// GameLevelManager::getSavedLevelLists from 0x140147610 to 0x1401476ba (170 bytes)\n// \n// 4 xrefs:\n// > LevelBrowserLayer::loadPage @ 0x1402cae3f\n// > LevelBrowserLayer::FLAlert_Clicked @ 0x1402cf8d9\n// > <???> @ 0x1406ca5fc\n// > <???> @ 0x1406ca608\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\ncocos2d::CCArray *GameLevelManager::getSavedLevelLists(GameLevelManager *a1, int a2)\n{\n  __int64 v4; // rax\n  cocos2d::CCDictionary *m_favoriteLists; // rdx\n  cocos2d::CCArray *v6; // rsi\n  cocos2d::CCDictElement *m_pElements; // rdx\n  cocos2d::CCDictElement *i; // rbx\n  struct cocos2d::CCObject *m_pObject; // rdx\n\n  v4 = cocos2d::CCArray::create(a1);\n  m_favoriteLists = a1->m_favoriteLists;\n  v6 = (cocos2d::CCArray *)v4;\n  if ( m_favoriteLists )\n  {\n    m_pElements = m_favoriteLists->m_pElements;\n    if ( m_pElements )\n    {\n      for ( i = (cocos2d::CCDictElement *)m_pElements->hh.next; ; i = (cocos2d::CCDictElement *)i->hh.next )\n      {\n        m_pObject = m_pElements->m_pObject;\n        if ( a2 <= 0 || m_pObject[6].m_uIndexInArray == a2 )\n          cocos2d::CCArray::addObject(v6, m_pObject);\n        m_pElements = i;\n        if ( !i )\n          break;\n      }\n    }\n  }\n  if ( cocos2d::CCArray::count(v6) )\n    qsort(v6->data->arr, v6->data->num, 8u, (_CoreCrtNonSecureSearchSortCompareFunction)sub_140142B60);\n  return v6;\n}", "assembly": "; \n; GameLevelManager::getSavedLevelLists from 0x140147610 to 0x1401476ba (170 bytes)\n; \n; 4 xrefs:\n; > LevelBrowserLayer::loadPage @ 0x1402cae3f\n; > LevelBrowserLayer::FLAlert_Clicked @ 0x1402cf8d9\n; > <???> @ 0x1406ca5fc\n; > <???> @ 0x1406ca608\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_0], rbx                                               ; +0x0, 0x140147610\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x140147615\npush    rdi                                                            ; +0xa, 0x14014761a\nsub     rsp, 20h                                                       ; +0xb, 0x14014761b\nmov     edi, edx                                                       ; +0xf, 0x14014761f\nmov     rbx, rcx                                                       ; +0x11, 0x140147621\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ                        ; +0x14, 0x140147624\nmov     rdx, [rbx+178h]                                                ; +0x1a, 0x14014762a\nmov     rsi, rax                                                       ; +0x21, 0x140147631\ntest    rdx, rdx                                                       ; +0x24, 0x140147634\njz      short loc_14014767D                                            ; +0x27, 0x140147637\nmov     rdx, [rdx+38h]                                                 ; +0x29, 0x140147639\ntest    rdx, rdx                                                       ; +0x2d, 0x14014763d\njz      short loc_14014767D                                            ; +0x30, 0x140147640\nmov     rbx, [rdx+120h]                                                ; +0x32, 0x140147642\nnop     dword ptr [rax+00000000h]                                      ; +0x39, 0x140147649\nmov     rdx, [rdx+108h]                                                ; +0x40, 0x140147650\ntest    edi, edi                                                       ; +0x47, 0x140147657\njle     short loc_140147663                                            ; +0x49, 0x140147659\ncmp     [rdx+170h], edi                                                ; +0x4b, 0x14014765b\njnz     short loc_14014766C                                            ; +0x51, 0x140147661\nmov     rcx, rsi                                                       ; +0x53, 0x140147663\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z          ; +0x56, 0x140147666\nmov     rdx, rbx                                                       ; +0x5c, 0x14014766c\ntest    rbx, rbx                                                       ; +0x5f, 0x14014766f\njz      short loc_14014767D                                            ; +0x62, 0x140147672\nmov     rbx, [rbx+120h]                                                ; +0x64, 0x140147674\njmp     short loc_140147650                                            ; +0x6b, 0x14014767b\nmov     rcx, rsi                                                       ; +0x6d, 0x14014767d\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ                             ; +0x70, 0x140147680\ntest    eax, eax                                                       ; +0x76, 0x140147686\njz      short loc_1401476A7                                            ; +0x78, 0x140147688\nmov     rcx, [rsi+38h]                                                 ; +0x7a, 0x14014768a\nlea     r9, sub_140142B60; CompareFunction                             ; +0x7e, 0x14014768e\nmov     r8d, 8; SizeOfElements                                         ; +0x85, 0x140147695\nmov     edx, [rcx]; NumOfElements                                      ; +0x8b, 0x14014769b\nmov     rcx, [rcx+10h]; Base                                           ; +0x8d, 0x14014769d\ncall    cs:qsort                                                       ; +0x91, 0x1401476a1\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x97, 0x1401476a7\nmov     rax, rsi                                                       ; +0x9c, 0x1401476ac\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x9f, 0x1401476af\nadd     rsp, 20h                                                       ; +0xa4, 0x1401476b4\npop     rdi                                                            ; +0xa8, 0x1401476b8\nretn                                                                   ; +0xa9, 0x1401476b9", "xrefs": ["LevelBrowserLayer::loadPage @ 0x1402cae3f", "LevelBrowserLayer::FLAlert_Clicked @ 0x1402cf8d9", "<???> @ 0x1406ca5fc", "<???> @ 0x1406ca608"], "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"}