{"type": "func", "start": 5371888096, "end": 5371888744, "name": "LevelListLayer::cloneList", "pseudocode": "// \n// LevelListLayer::cloneList from 0x1403081e0 to 0x140308468 (648 bytes)\n// \n// 2 xrefs:\n// > LevelListLayer::FLAlert_Clicked @ 0x1403075c4\n// > <???> @ 0x1406d4580\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=5\nvoid LevelListLayer::cloneList(LevelListLayer *a1)\n{\n  unsigned int v2; // ebx\n  GameLevelManager *v3; // rcx\n  __int64 v4; // rax\n  GJLevelList *NewLevelList; // rsi\n  __int64 v6; // rax\n  std::string *p_m_listDesc; // r8\n  std::string *m_bigStorage; // rdx\n  cocos2d::CCArray *ListLevelsArray; // rbp\n  GJGameLevel *v10; // rax\n  __int64 v11; // rax\n  __int64 v12; // rbx\n  void *v13; // rdx\n  GJLevelList *m_levelList; // rcx\n  int m_original; // eax\n  struct cocos2d::CCScene *v16; // rax\n  struct cocos2d::CCTransitionFade *v17; // rbx\n  __int64 v18; // rcx\n  cocos2d::CCDirector *v19; // rax\n  void *v20; // [rsp+20h] [rbp-58h]\n  void *v21; // [rsp+20h] [rbp-58h]\n  void *v22; // [rsp+20h] [rbp-58h]\n  _BYTE v23[32]; // [rsp+28h] [rbp-50h] BYREF\n  _QWORD Src[4]; // [rsp+48h] [rbp-30h] BYREF\n\n  v2 = 0;\n  if ( !a1->m_exiting )\n  {\n    a1->setKeypadEnabled(a1, 0);\n    a1->m_exiting = 1;\n    v4 = qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v20 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v20);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v4 = qword_1406C2ED8;\n    }\n    *(_DWORD *)(v4 + 700) = 14;\n    if ( !qword_1406C2EC0 )\n    {\n      v21 = operator new(0x3D0u);\n      qword_1406C2EC0 = sub_140141280((__int64)v21);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n    }\n    NewLevelList = GameLevelManager::createNewLevelList(v3);\n    v6 = qword_1406C2EC0;\n    if ( !qword_1406C2EC0 )\n    {\n      v22 = operator new(0x3D0u);\n      qword_1406C2EC0 = sub_140141280((__int64)v22);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n      v6 = qword_1406C2EC0;\n    }\n    *(_BYTE *)(v6 + 712) = 1;\n    NewLevelList->m_difficulty = a1->m_levelList->m_difficulty;\n    p_m_listDesc = &a1->m_levelList->m_listDesc;\n    if ( &NewLevelList->m_listDesc != p_m_listDesc )\n    {\n      m_bigStorage = &a1->m_levelList->m_listDesc;\n      if ( a1->m_levelList->m_listDesc.m_data.m_capacity > 0xF )\n        m_bigStorage = (std::string *)p_m_listDesc->m_data.m_bigStorage;\n      sub_14003CCE0((void **)&NewLevelList->m_listDesc, m_bigStorage, a1->m_levelList->m_listDesc.m_data.m_size);\n    }\n    ListLevelsArray = GJLevelList::getListLevelsArray(a1->m_levelList, nullptr);\n    if ( cocos2d::CCArray::count(ListLevelsArray) )\n    {\n      do\n      {\n        v10 = (GJGameLevel *)cocos2d::CCArray::objectAtIndex(ListLevelsArray, v2);\n        GJLevelList::addLevelToList(NewLevelList, v10);\n        ++v2;\n      }\n      while ( v2 < cocos2d::CCArray::count(ListLevelsArray) );\n    }\n    sub_14003BDB0((__int64)Src, (__int64)&a1->m_levelList->m_listName);\n    if ( Src[2] <= 0x17u )\n      sub_140041270(Src, &unk_140588814, 2u);\n    v11 = sub_14003BDB0((__int64)v23, (__int64)Src);\n    v12 = v11;\n    if ( &NewLevelList->m_listName != (std::string *)v11 )\n    {\n      v13 = (void *)v11;\n      if ( *(_QWORD *)(v11 + 24) > 0xFu )\n        v13 = *(void **)v11;\n      sub_14003CCE0((void **)&NewLevelList->m_listName, v13, *(_QWORD *)(v11 + 16));\n    }\n    sub_14003A830(v12);\n    m_levelList = a1->m_levelList;\n    m_original = m_levelList->m_original;\n    if ( !m_original )\n      m_original = m_levelList->m_listID;\n    NewLevelList->m_original = m_original;\n    v16 = LevelListLayer::scene(NewLevelList);\n    v17 = cocos2d::CCTransitionFade::create(0.5, v16);\n    v19 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v18);\n    cocos2d::CCDirector::replaceScene(v19, v17);\n    sub_14003A830((__int64)Src);\n  }\n}", "assembly": "; \n; LevelListLayer::cloneList from 0x1403081e0 to 0x140308468 (648 bytes)\n; \n; 2 xrefs:\n; > LevelListLayer::FLAlert_Clicked @ 0x1403075c4\n; > <???> @ 0x1406d4580\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, 0x1403081e0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1403081e5\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x1403081ea\npush    rdi                                                            ; +0xf, 0x1403081ef\nsub     rsp, 70h                                                       ; +0x10, 0x1403081f0\nmov     rax, cs:__security_cookie                                      ; +0x14, 0x1403081f4\nxor     rax, rsp                                                       ; +0x1b, 0x1403081fb\nmov     [rsp+78h+var_10], rax                                          ; +0x1e, 0x1403081fe\nmov     rdi, rcx                                                       ; +0x23, 0x140308203\nxor     ebx, ebx                                                       ; +0x26, 0x140308206\ncmp     [rcx+398h], bl                                                 ; +0x28, 0x140308208\njnz     loc_140308445                                                  ; +0x2e, 0x14030820e\nmov     rax, [rcx]                                                     ; +0x34, 0x140308214\nxor     edx, edx                                                       ; +0x37, 0x140308217\ncall    qword ptr [rax+3D0h]                                           ; +0x39, 0x140308219\nmov     byte ptr [rdi+398h], 1                                         ; +0x3f, 0x14030821f\nmov     rax, cs:qword_1406C2ED8                                        ; +0x46, 0x140308226\ntest    rax, rax                                                       ; +0x4d, 0x14030822d\njnz     short loc_140308261                                            ; +0x50, 0x140308230\nmov     ecx, 668h; Size                                                ; +0x52, 0x140308232\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x57, 0x140308237\nmov     [rsp+78h+var_58], rax                                          ; +0x5c, 0x14030823c\nmov     rcx, rax                                                       ; +0x61, 0x140308241\ncall    sub_14017AB00                                                  ; +0x64, 0x140308244\nnop                                                                    ; +0x69, 0x140308249\nmov     cs:qword_1406C2ED8, rax                                        ; +0x6a, 0x14030824a\nmov     rdx, [rax]                                                     ; +0x71, 0x140308251\nmov     rcx, rax                                                       ; +0x74, 0x140308254\ncall    qword ptr [rdx+48h]                                            ; +0x77, 0x140308257\nmov     rax, cs:qword_1406C2ED8                                        ; +0x7a, 0x14030825a\nmov     dword ptr [rax+2BCh], 0Eh                                      ; +0x81, 0x140308261\ncmp     cs:qword_1406C2EC0, 0                                          ; +0x8b, 0x14030826b\njnz     short loc_14030829D                                            ; +0x93, 0x140308273\nmov     ecx, 3D0h; Size                                                ; +0x95, 0x140308275\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x9a, 0x14030827a\nmov     [rsp+78h+var_58], rax                                          ; +0x9f, 0x14030827f\nmov     rcx, rax                                                       ; +0xa4, 0x140308284\ncall    sub_140141280                                                  ; +0xa7, 0x140308287\nnop                                                                    ; +0xac, 0x14030828c\nmov     cs:qword_1406C2EC0, rax                                        ; +0xad, 0x14030828d\nmov     rdx, [rax]                                                     ; +0xb4, 0x140308294\nmov     rcx, rax                                                       ; +0xb7, 0x140308297\ncall    qword ptr [rdx+48h]                                            ; +0xba, 0x14030829a\ncall    GameLevelManager__createNewLevelList                           ; +0xbd, 0x14030829d\nmov     rsi, rax                                                       ; +0xc2, 0x1403082a2\nmov     rax, cs:qword_1406C2EC0                                        ; +0xc5, 0x1403082a5\ntest    rax, rax                                                       ; +0xcc, 0x1403082ac\njnz     short loc_1403082E0                                            ; +0xcf, 0x1403082af\nmov     ecx, 3D0h; Size                                                ; +0xd1, 0x1403082b1\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xd6, 0x1403082b6\nmov     [rsp+78h+var_58], rax                                          ; +0xdb, 0x1403082bb\nmov     rcx, rax                                                       ; +0xe0, 0x1403082c0\ncall    sub_140141280                                                  ; +0xe3, 0x1403082c3\nnop                                                                    ; +0xe8, 0x1403082c8\nmov     cs:qword_1406C2EC0, rax                                        ; +0xe9, 0x1403082c9\nmov     rdx, [rax]                                                     ; +0xf0, 0x1403082d0\nmov     rcx, rax                                                       ; +0xf3, 0x1403082d3\ncall    qword ptr [rdx+48h]                                            ; +0xf6, 0x1403082d6\nmov     rax, cs:qword_1406C2EC0                                        ; +0xf9, 0x1403082d9\nmov     byte ptr [rax+2C8h], 1                                         ; +0x100, 0x1403082e0\nmov     rax, [rdi+368h]                                                ; +0x107, 0x1403082e7\nmov     ecx, [rax+168h]                                                ; +0x10e, 0x1403082ee\nmov     [rsi+168h], ecx                                                ; +0x114, 0x1403082f4\nmov     r8, [rdi+368h]                                                 ; +0x11a, 0x1403082fa\nadd     r8, 210h                                                       ; +0x121, 0x140308301\nlea     rcx, [rsi+210h]; void *                                        ; +0x128, 0x140308308\ncmp     rcx, r8                                                        ; +0x12f, 0x14030830f\njz      short loc_14030832A                                            ; +0x132, 0x140308312\nmov     rdx, r8                                                        ; +0x134, 0x140308314\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x137, 0x140308317\njbe     short loc_140308321                                            ; +0x13c, 0x14030831c\nmov     rdx, [r8]; Src                                                 ; +0x13e, 0x14030831e\nmov     r8, [r8+10h]; Size                                             ; +0x141, 0x140308321\ncall    sub_14003CCE0                                                  ; +0x145, 0x140308325\nxor     edx, edx                                                       ; +0x14a, 0x14030832a\nmov     rcx, [rdi+368h]                                                ; +0x14c, 0x14030832c\ncall    GJLevelList__getListLevelsArray                                ; +0x153, 0x140308333\nmov     rbp, rax                                                       ; +0x158, 0x140308338\nmov     rcx, rax                                                       ; +0x15b, 0x14030833b\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x15e, 0x14030833e\ntest    eax, eax                                                       ; +0x164, 0x140308344\njz      short loc_140308375                                            ; +0x166, 0x140308346\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x168, 0x140308348\nmov     edx, ebx                                                       ; +0x170, 0x140308350\nmov     rcx, rbp                                                       ; +0x172, 0x140308352\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x175, 0x140308355\nmov     rdx, rax                                                       ; +0x17b, 0x14030835b\nmov     rcx, rsi                                                       ; +0x17e, 0x14030835e\ncall    GJLevelList__addLevelToList                                    ; +0x181, 0x140308361\ninc     ebx                                                            ; +0x186, 0x140308366\nmov     rcx, rbp                                                       ; +0x188, 0x140308368\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x18b, 0x14030836b\ncmp     ebx, eax                                                       ; +0x191, 0x140308371\njb      short loc_140308350                                            ; +0x193, 0x140308373\nmov     rdx, [rdi+368h]                                                ; +0x195, 0x140308375\nadd     rdx, 1B0h                                                      ; +0x19c, 0x14030837c\nlea     rcx, [rsp+78h+Src]                                             ; +0x1a3, 0x140308383\ncall    sub_14003BDB0                                                  ; +0x1a8, 0x140308388\nnop                                                                    ; +0x1ad, 0x14030838d\ncmp     [rsp+78h+var_20], 17h                                          ; +0x1ae, 0x14030838e\nja      short loc_1403083AD                                            ; +0x1b4, 0x140308394\nmov     r8d, 2; Size                                                   ; +0x1b6, 0x140308396\nlea     rdx, unk_140588814; void *                                     ; +0x1bc, 0x14030839c\nlea     rcx, [rsp+78h+Src]; Src                                        ; +0x1c3, 0x1403083a3\ncall    sub_140041270                                                  ; +0x1c8, 0x1403083a8\nlea     rdx, [rsp+78h+Src]                                             ; +0x1cd, 0x1403083ad\nlea     rcx, [rsp+78h+var_50]                                          ; +0x1d2, 0x1403083b2\ncall    sub_14003BDB0                                                  ; +0x1d7, 0x1403083b7\nmov     rbx, rax                                                       ; +0x1dc, 0x1403083bc\nmov     [rsp+78h+var_58], rax                                          ; +0x1df, 0x1403083bf\nlea     rcx, [rsi+1B0h]; void *                                        ; +0x1e4, 0x1403083c4\ncmp     rcx, rax                                                       ; +0x1eb, 0x1403083cb\njz      short loc_1403083E7                                            ; +0x1ee, 0x1403083ce\nmov     rdx, rax                                                       ; +0x1f0, 0x1403083d0\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x1f3, 0x1403083d3\njbe     short loc_1403083DD                                            ; +0x1f8, 0x1403083d8\nmov     rdx, [rax]; Src                                                ; +0x1fa, 0x1403083da\nmov     r8, [rax+10h]; Size                                            ; +0x1fd, 0x1403083dd\ncall    sub_14003CCE0                                                  ; +0x201, 0x1403083e1\nnop                                                                    ; +0x206, 0x1403083e6\nmov     rcx, rbx                                                       ; +0x207, 0x1403083e7\ncall    sub_14003A830                                                  ; +0x20a, 0x1403083ea\nmov     rcx, [rdi+368h]                                                ; +0x20f, 0x1403083ef\nmov     eax, [rcx+17Ch]                                                ; +0x216, 0x1403083f6\ntest    eax, eax                                                       ; +0x21c, 0x1403083fc\njnz     short loc_140308406                                            ; +0x21e, 0x1403083fe\nmov     eax, [rcx+158h]                                                ; +0x220, 0x140308400\nmov     [rsi+17Ch], eax                                                ; +0x226, 0x140308406\nmov     rcx, rsi                                                       ; +0x22c, 0x14030840c\ncall    LevelListLayer__scene                                          ; +0x22f, 0x14030840f\nmov     rdx, rax                                                       ; +0x234, 0x140308414\nmovss   xmm0, cs:dword_140622B08                                       ; +0x237, 0x140308417\ncall    cs:?create@CCTransitionFade@cocos2d@@SAPEAV12@MPEAVCCScene@2@@Z; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0x23f, 0x14030841f\nmov     rbx, rax                                                       ; +0x245, 0x140308425\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x248, 0x140308428\nmov     rcx, rax                                                       ; +0x24e, 0x14030842e\nmov     rdx, rbx                                                       ; +0x251, 0x140308431\ncall    cs:?replaceScene@CCDirector@cocos2d@@QEAA_NPEAVCCScene@2@@Z; cocos2d::CCDirector::replaceScene(cocos2d::CCScene *) ; +0x254, 0x140308434\nnop                                                                    ; +0x25a, 0x14030843a\nlea     rcx, [rsp+78h+Src]                                             ; +0x25b, 0x14030843b\ncall    sub_14003A830                                                  ; +0x260, 0x140308440\nmov     rcx, [rsp+78h+var_10]                                          ; +0x265, 0x140308445\nxor     rcx, rsp; StackCookie                                          ; +0x26a, 0x14030844a\ncall    __security_check_cookie                                        ; +0x26d, 0x14030844d\nlea     r11, [rsp+78h+var_8]                                           ; +0x272, 0x140308452\nmov     rbx, [r11+18h]                                                 ; +0x277, 0x140308457\nmov     rbp, [r11+20h]                                                 ; +0x27b, 0x14030845b\nmov     rsi, [r11+28h]                                                 ; +0x27f, 0x14030845f\nmov     rsp, r11                                                       ; +0x283, 0x140308463\npop     rdi                                                            ; +0x286, 0x140308466\nretn                                                                   ; +0x287, 0x140308467", "xrefs": ["LevelListLayer::FLAlert_Clicked @ 0x1403075c4", "<???> @ 0x1406d4580"], "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"}