{"type": "func", "start": 5369353504, "end": 5369354010, "name": "CreatorLayer::onSavedLevels", "pseudocode": "// \n// CreatorLayer::onSavedLevels from 0x14009d520 to 0x14009d71a (506 bytes)\n// \n// 2 xrefs:\n// > CreatorLayer::init @ 0x14009c457\n// > <???> @ 0x1406c7584\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 CreatorLayer::onSavedLevels(CreatorLayer *a1, cocos2d::CCObject *a2)\n{\n  __int64 v2; // rcx\n  SearchType v3; // ecx\n  GJSearchObject *v4; // rdi\n  GameManager *v5; // rcx\n  int IntGameVariable; // ebx\n  GameManager *v7; // rcx\n  GameManager *v8; // rcx\n  GameManager *v9; // rcx\n  struct cocos2d::CCScene *v10; // rbx\n  __int64 v11; // rdx\n  __int64 v12; // rcx\n  LevelBrowserLayer *v13; // rax\n  struct cocos2d::CCTransitionFade *v14; // rbx\n  __int64 v15; // rcx\n  cocos2d::CCDirector *v16; // rax\n  void *v17; // [rsp+40h] [rbp+18h]\n  void *v18; // [rsp+40h] [rbp+18h]\n  void *v19; // [rsp+40h] [rbp+18h]\n  void *v20; // [rsp+40h] [rbp+18h]\n  void *v21; // [rsp+40h] [rbp+18h]\n\n  v2 = qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v17 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00(v17);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v2 = qword_1406C2ED8;\n  }\n  v3 = *(_DWORD *)(v2 + 1204);\n  if ( v3 != FavouriteLists )\n    v3 = SavedLevels;\n  v4 = GJSearchObject::create_2(v3);\n  v5 = (GameManager *)qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v18 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00(v18);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v5 = (GameManager *)qword_1406C2ED8;\n  }\n  IntGameVariable = 999;\n  if ( GameManager::getIntGameVariable(v5, \"0092\") > 999 )\n    goto LABEL_12;\n  v7 = (GameManager *)qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v19 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00(v19);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v7 = (GameManager *)qword_1406C2ED8;\n  }\n  if ( GameManager::getIntGameVariable(v7, \"0092\") >= 0 )\n  {\nLABEL_12:\n    v8 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v20 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00(v20);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v8 = (GameManager *)qword_1406C2ED8;\n    }\n    if ( GameManager::getIntGameVariable(v8, \"0092\") <= 999 )\n    {\n      v9 = (GameManager *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v21 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00(v21);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v9 = (GameManager *)qword_1406C2ED8;\n      }\n      IntGameVariable = GameManager::getIntGameVariable(v9, \"0092\");\n    }\n  }\n  else\n  {\n    IntGameVariable = 0;\n  }\n  v4->m_folder = IntGameVariable;\n  v10 = (struct cocos2d::CCScene *)cocos2d::CCScene::create();\n  *(_QWORD *)(cocos2d::CCApplication::sharedApplication(v12, v11) + 224) = v10;\n  v13 = LevelBrowserLayer::create(v4);\n  v10->addChild_1(v10, v13);\n  v14 = cocos2d::CCTransitionFade::create(0.5, v10);\n  v16 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v15);\n  cocos2d::CCDirector::pushScene(v16, v14);\n}", "assembly": "; \n; CreatorLayer::onSavedLevels from 0x14009d520 to 0x14009d71a (506 bytes)\n; \n; 2 xrefs:\n; > CreatorLayer::init @ 0x14009c457\n; > <???> @ 0x1406c7584\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, 0x14009d520\npush    rdi                                                            ; +0x5, 0x14009d525\nsub     rsp, 20h                                                       ; +0x6, 0x14009d526\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xa, 0x14009d52a\ntest    rcx, rcx                                                       ; +0x11, 0x14009d531\njnz     short loc_14009D565                                            ; +0x14, 0x14009d534\nmov     ecx, 668h; Size                                                ; +0x16, 0x14009d536\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1b, 0x14009d53b\nmov     [rsp+28h+arg_10], rax                                          ; +0x20, 0x14009d540\nmov     rcx, rax                                                       ; +0x25, 0x14009d545\ncall    sub_14017AB00                                                  ; +0x28, 0x14009d548\nnop                                                                    ; +0x2d, 0x14009d54d\nmov     cs:qword_1406C2ED8, rax                                        ; +0x2e, 0x14009d54e\nmov     rdx, [rax]                                                     ; +0x35, 0x14009d555\nmov     rcx, rax                                                       ; +0x38, 0x14009d558\ncall    qword ptr [rdx+48h]                                            ; +0x3b, 0x14009d55b\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x3e, 0x14009d55e\nmov     ecx, [rcx+4B4h]                                                ; +0x45, 0x14009d565\nmov     eax, 63h ; 'c'                                                 ; +0x4b, 0x14009d56b\ncmp     ecx, 67h ; 'g'                                                 ; +0x50, 0x14009d570\ncmovnz  ecx, eax                                                       ; +0x53, 0x14009d573\ncall    GJSearchObject__create_2                                       ; +0x56, 0x14009d576\nmov     rdi, rax                                                       ; +0x5b, 0x14009d57b\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x5e, 0x14009d57e\ntest    rcx, rcx                                                       ; +0x65, 0x14009d585\njnz     short loc_14009D5B9                                            ; +0x68, 0x14009d588\nmov     ecx, 668h; Size                                                ; +0x6a, 0x14009d58a\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x6f, 0x14009d58f\nmov     [rsp+28h+arg_10], rax                                          ; +0x74, 0x14009d594\nmov     rcx, rax                                                       ; +0x79, 0x14009d599\ncall    sub_14017AB00                                                  ; +0x7c, 0x14009d59c\nnop                                                                    ; +0x81, 0x14009d5a1\nmov     cs:qword_1406C2ED8, rax                                        ; +0x82, 0x14009d5a2\nmov     rdx, [rax]                                                     ; +0x89, 0x14009d5a9\nmov     rcx, rax                                                       ; +0x8c, 0x14009d5ac\ncall    qword ptr [rdx+48h]                                            ; +0x8f, 0x14009d5af\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x92, 0x14009d5b2\nlea     rdx, a0092; \"0092\"                                             ; +0x99, 0x14009d5b9\ncall    GameManager__getIntGameVariable                                ; +0xa0, 0x14009d5c0\nmov     ebx, 3E7h                                                      ; +0xa5, 0x14009d5c5\ncmp     eax, ebx                                                       ; +0xaa, 0x14009d5ca\njg      short loc_14009D620                                            ; +0xac, 0x14009d5cc\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xae, 0x14009d5ce\ntest    rcx, rcx                                                       ; +0xb5, 0x14009d5d5\njnz     short loc_14009D609                                            ; +0xb8, 0x14009d5d8\nmov     ecx, 668h; Size                                                ; +0xba, 0x14009d5da\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xbf, 0x14009d5df\nmov     [rsp+28h+arg_10], rax                                          ; +0xc4, 0x14009d5e4\nmov     rcx, rax                                                       ; +0xc9, 0x14009d5e9\ncall    sub_14017AB00                                                  ; +0xcc, 0x14009d5ec\nnop                                                                    ; +0xd1, 0x14009d5f1\nmov     cs:qword_1406C2ED8, rax                                        ; +0xd2, 0x14009d5f2\nmov     rdx, [rax]                                                     ; +0xd9, 0x14009d5f9\nmov     rcx, rax                                                       ; +0xdc, 0x14009d5fc\ncall    qword ptr [rdx+48h]                                            ; +0xdf, 0x14009d5ff\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xe2, 0x14009d602\nlea     rdx, a0092; \"0092\"                                             ; +0xe9, 0x14009d609\ncall    GameManager__getIntGameVariable                                ; +0xf0, 0x14009d610\ntest    eax, eax                                                       ; +0xf5, 0x14009d615\njns     short loc_14009D620                                            ; +0xf7, 0x14009d617\nxor     ebx, ebx                                                       ; +0xf9, 0x14009d619\njmp     loc_14009D6B5                                                  ; +0xfb, 0x14009d61b\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x100, 0x14009d620\ntest    rcx, rcx                                                       ; +0x107, 0x14009d627\njnz     short loc_14009D65B                                            ; +0x10a, 0x14009d62a\nmov     ecx, 668h; Size                                                ; +0x10c, 0x14009d62c\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x111, 0x14009d631\nmov     [rsp+28h+arg_10], rax                                          ; +0x116, 0x14009d636\nmov     rcx, rax                                                       ; +0x11b, 0x14009d63b\ncall    sub_14017AB00                                                  ; +0x11e, 0x14009d63e\nnop                                                                    ; +0x123, 0x14009d643\nmov     cs:qword_1406C2ED8, rax                                        ; +0x124, 0x14009d644\nmov     rdx, [rax]                                                     ; +0x12b, 0x14009d64b\nmov     rcx, rax                                                       ; +0x12e, 0x14009d64e\ncall    qword ptr [rdx+48h]                                            ; +0x131, 0x14009d651\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x134, 0x14009d654\nlea     rdx, a0092; \"0092\"                                             ; +0x13b, 0x14009d65b\ncall    GameManager__getIntGameVariable                                ; +0x142, 0x14009d662\ncmp     eax, ebx                                                       ; +0x147, 0x14009d667\njg      short loc_14009D6B5                                            ; +0x149, 0x14009d669\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x14b, 0x14009d66b\ntest    rcx, rcx                                                       ; +0x152, 0x14009d672\njnz     short loc_14009D6A7                                            ; +0x155, 0x14009d675\nmov     ecx, 668h; Size                                                ; +0x157, 0x14009d677\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x15c, 0x14009d67c\nmov     [rsp+28h+arg_10], rax                                          ; +0x161, 0x14009d681\nmov     rcx, rax                                                       ; +0x166, 0x14009d686\ncall    sub_14017AB00                                                  ; +0x169, 0x14009d689\nnop                                                                    ; +0x16e, 0x14009d68e\nmov     cs:qword_1406C2ED8, rax                                        ; +0x16f, 0x14009d68f\nmov     r8, [rax]                                                      ; +0x176, 0x14009d696\nmov     rcx, rax                                                       ; +0x179, 0x14009d699\ncall    qword ptr [r8+48h]                                             ; +0x17c, 0x14009d69c\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x180, 0x14009d6a0\nlea     rdx, a0092; \"0092\"                                             ; +0x187, 0x14009d6a7\ncall    GameManager__getIntGameVariable                                ; +0x18e, 0x14009d6ae\nmov     ebx, eax                                                       ; +0x193, 0x14009d6b3\nmov     [rdi+1C4h], ebx                                                ; +0x195, 0x14009d6b5\ncall    cs:?create@CCScene@cocos2d@@SAPEAV12@XZ; cocos2d::CCScene::create(void) ; +0x19b, 0x14009d6bb\nmov     rbx, rax                                                       ; +0x1a1, 0x14009d6c1\ncall    cs:?sharedApplication@CCApplication@cocos2d@@SAPEAV12@XZ; cocos2d::CCApplication::sharedApplication(void) ; +0x1a4, 0x14009d6c4\nmov     [rax+0E0h], rbx                                                ; +0x1aa, 0x14009d6ca\nmov     rcx, rdi                                                       ; +0x1b1, 0x14009d6d1\ncall    LevelBrowserLayer__create                                      ; +0x1b4, 0x14009d6d4\nmov     r8, [rbx]                                                      ; +0x1b9, 0x14009d6d9\nmov     rdx, rax                                                       ; +0x1bc, 0x14009d6dc\nmov     rcx, rbx                                                       ; +0x1bf, 0x14009d6df\ncall    qword ptr [r8+1C0h]                                            ; +0x1c2, 0x14009d6e2\nmov     rdx, rbx                                                       ; +0x1c9, 0x14009d6e9\nmovss   xmm0, cs:dword_140622B08                                       ; +0x1cc, 0x14009d6ec\ncall    cs:?create@CCTransitionFade@cocos2d@@SAPEAV12@MPEAVCCScene@2@@Z; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0x1d4, 0x14009d6f4\nmov     rbx, rax                                                       ; +0x1da, 0x14009d6fa\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x1dd, 0x14009d6fd\nmov     rcx, rax                                                       ; +0x1e3, 0x14009d703\nmov     rdx, rbx                                                       ; +0x1e6, 0x14009d706\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x1e9, 0x14009d709\nadd     rsp, 20h                                                       ; +0x1ee, 0x14009d70e\npop     rdi                                                            ; +0x1f2, 0x14009d712\njmp     cs:?pushScene@CCDirector@cocos2d@@QEAA_NPEAVCCScene@2@@Z; cocos2d::CCDirector::pushScene(cocos2d::CCScene *) ; +0x1f3, 0x14009d713", "xrefs": ["CreatorLayer::init @ 0x14009c457", "<???> @ 0x1406c7584"], "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"}