{"type": "func", "start": 5370057920, "end": 5370058342, "name": "GameLevelManager::gotoLevelPage", "pseudocode": "// \n// GameLevelManager::gotoLevelPage from 0x1401494c0 to 0x140149666 (422 bytes)\n// \n// 3 xrefs:\n// > LevelCell::onClick @ 0x1400b1a00\n// > GauntletLayer::onLevel @ 0x1401f7df7\n// > <???> @ 0x1406ca698\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::gotoLevelPage(GameLevelManager *a1, GJGameLevel *a2)\n{\n  __int64 v4; // rax\n  GJLevelType m_levelType; // eax\n  struct cocos2d::CCScene *v6; // rax\n  struct cocos2d::CCTransitionFade *v7; // rbx\n  __int64 v8; // rcx\n  cocos2d::CCDirector *v9; // rax\n  GJGameLevel *SavedDailyLevel; // rax\n  int v11; // edx\n  struct cocos2d::CCScene *v12; // rax\n  struct cocos2d::CCTransitionFade *v13; // rbx\n  __int64 v14; // rcx\n  cocos2d::CCDirector *v15; // rax\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+38h] [rbp+10h]\n\n  v4 = 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    v4 = qword_1406C2ED8;\n  }\n  *(_BYTE *)(v4 + 704) = 1;\n  if ( a2 )\n  {\n    m_levelType = a2->m_levelType;\n    if ( m_levelType == Editor )\n    {\n      v6 = EditLevelLayer::scene(a2);\n      v7 = cocos2d::CCTransitionFade::create(0.5, v6);\n      v9 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v8);\n      cocos2d::CCDirector::replaceScene(v9, v7);\n      return;\n    }\n    if ( m_levelType == Saved )\n      goto LABEL_20;\n    if ( m_levelType != SearchResult )\n      return;\n    if ( a2->m_dailyID.random - a2->m_dailyID.seed <= 0 )\n    {\n      v11 = a2->m_levelID.random - a2->m_levelID.seed;\n      SavedDailyLevel = a2->m_gauntletLevel\n                      ? GameLevelManager::getSavedGauntletLevel(a1, v11)\n                      : GameLevelManager::getSavedLevel(a1, v11);\n    }\n    else\n    {\n      SavedDailyLevel = GameLevelManager::getSavedDailyLevel(a1, a2->m_dailyID.random - a2->m_dailyID.seed);\n    }\n    if ( SavedDailyLevel )\n    {\n      if ( SavedDailyLevel->m_levelNotDownloaded )\n      {\n        GameLevelManager::saveLevel(a1, a2);\n      }\n      else if ( SavedDailyLevel->m_levelVersion >= a2->m_levelVersion )\n      {\n        SavedDailyLevel->m_songID = a2->m_songID;\n        a2 = SavedDailyLevel;\n      }\n    }\n    if ( !a2->m_gauntletLevel )\n    {\nLABEL_20:\n      v16 = LevelInfoLayer::scene(a2, 0);\n      v17 = cocos2d::CCTransitionFade::create(0.5, v16);\n      v19 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v18);\n      cocos2d::CCDirector::pushScene(v19, v17);\n    }\n    else\n    {\n      v12 = LevelInfoLayer::scene(a2, 0);\n      v13 = cocos2d::CCTransitionFade::create(0.5, v12);\n      v15 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v14);\n      cocos2d::CCDirector::replaceScene(v15, v13);\n    }\n  }\n}", "assembly": "; \n; GameLevelManager::gotoLevelPage from 0x1401494c0 to 0x140149666 (422 bytes)\n; \n; 3 xrefs:\n; > LevelCell::onClick @ 0x1400b1a00\n; > GauntletLayer::onLevel @ 0x1401f7df7\n; > <???> @ 0x1406ca698\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, 0x1401494c0\npush    rdi                                                            ; +0x5, 0x1401494c5\nsub     rsp, 20h                                                       ; +0x6, 0x1401494c6\nmov     rbx, rdx                                                       ; +0xa, 0x1401494ca\nmov     rdi, rcx                                                       ; +0xd, 0x1401494cd\nmov     rax, cs:qword_1406C2ED8                                        ; +0x10, 0x1401494d0\ntest    rax, rax                                                       ; +0x17, 0x1401494d7\njnz     short loc_14014950B                                            ; +0x1a, 0x1401494da\nmov     ecx, 668h; Size                                                ; +0x1c, 0x1401494dc\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x21, 0x1401494e1\nmov     [rsp+28h+arg_8], rax                                           ; +0x26, 0x1401494e6\nmov     rcx, rax                                                       ; +0x2b, 0x1401494eb\ncall    sub_14017AB00                                                  ; +0x2e, 0x1401494ee\nnop                                                                    ; +0x33, 0x1401494f3\nmov     cs:qword_1406C2ED8, rax                                        ; +0x34, 0x1401494f4\nmov     rdx, [rax]                                                     ; +0x3b, 0x1401494fb\nmov     rcx, rax                                                       ; +0x3e, 0x1401494fe\ncall    qword ptr [rdx+48h]                                            ; +0x41, 0x140149501\nmov     rax, cs:qword_1406C2ED8                                        ; +0x44, 0x140149504\nmov     byte ptr [rax+2C0h], 1                                         ; +0x4b, 0x14014950b\ntest    rbx, rbx                                                       ; +0x52, 0x140149512\njz      loc_14014965B                                                  ; +0x55, 0x140149515\nmov     eax, [rbx+454h]                                                ; +0x5b, 0x14014951b\ncmp     eax, 2                                                         ; +0x61, 0x140149521\njnz     short loc_14014955F                                            ; +0x64, 0x140149524\nmov     rcx, rbx                                                       ; +0x66, 0x140149526\ncall    EditLevelLayer__scene                                          ; +0x69, 0x140149529\nmov     rdx, rax                                                       ; +0x6e, 0x14014952e\nmovss   xmm0, cs:dword_140622B08                                       ; +0x71, 0x140149531\ncall    cs:?create@CCTransitionFade@cocos2d@@SAPEAV12@MPEAVCCScene@2@@Z; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0x79, 0x140149539\nmov     rbx, rax                                                       ; +0x7f, 0x14014953f\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x82, 0x140149542\nmov     rcx, rax                                                       ; +0x88, 0x140149548\nmov     rdx, rbx                                                       ; +0x8b, 0x14014954b\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x8e, 0x14014954e\nadd     rsp, 20h                                                       ; +0x93, 0x140149553\npop     rdi                                                            ; +0x97, 0x140149557\njmp     cs:?replaceScene@CCDirector@cocos2d@@QEAA_NPEAVCCScene@2@@Z; cocos2d::CCDirector::replaceScene(cocos2d::CCScene *) ; +0x98, 0x140149558\ncmp     eax, 3                                                         ; +0x9f, 0x14014955f\njz      loc_14014962B                                                  ; +0xa2, 0x140149562\ncmp     eax, 4                                                         ; +0xa8, 0x140149568\njnz     loc_14014965B                                                  ; +0xab, 0x14014956b\nmov     edx, [rbx+36Ch]                                                ; +0xb1, 0x140149571\nsub     edx, [rbx+370h]                                                ; +0xb7, 0x140149577\nmov     rcx, rdi                                                       ; +0xbd, 0x14014957d\ntest    edx, edx                                                       ; +0xc0, 0x140149580\njle     short loc_14014958B                                            ; +0xc2, 0x140149582\ncall    GameLevelManager__getSavedDailyLevel                           ; +0xc4, 0x140149584\njmp     short loc_1401495AC                                            ; +0xc9, 0x140149589\nmov     edx, [rbx+148h]                                                ; +0xcb, 0x14014958b\nsub     edx, [rbx+14Ch]                                                ; +0xd1, 0x140149591\ncmp     byte ptr [rbx+2C9h], 0                                         ; +0xd7, 0x140149597\njz      short loc_1401495A7                                            ; +0xde, 0x14014959e\ncall    GameLevelManager__getSavedGauntletLevel                        ; +0xe0, 0x1401495a0\njmp     short loc_1401495AC                                            ; +0xe5, 0x1401495a5\ncall    GameLevelManager__getSavedLevel                                ; +0xe7, 0x1401495a7\nmov     rcx, rax                                                       ; +0xec, 0x1401495ac\ntest    rax, rax                                                       ; +0xef, 0x1401495af\njz      short loc_1401495E7                                            ; +0xf2, 0x1401495b2\ncmp     byte ptr [rax+431h], 0                                         ; +0xf4, 0x1401495b4\njz      short loc_1401495CA                                            ; +0xfb, 0x1401495bb\nmov     rdx, rbx                                                       ; +0xfd, 0x1401495bd\nmov     rcx, rdi                                                       ; +0x100, 0x1401495c0\ncall    GameLevelManager__saveLevel                                    ; +0x103, 0x1401495c3\njmp     short loc_1401495E7                                            ; +0x108, 0x1401495c8\nmov     eax, [rbx+2E8h]                                                ; +0x10a, 0x1401495ca\ncmp     [rcx+2E8h], eax                                                ; +0x110, 0x1401495d0\njl      short loc_1401495E7                                            ; +0x116, 0x1401495d6\nmov     eax, [rbx+2A0h]                                                ; +0x118, 0x1401495d8\nmov     [rcx+2A0h], eax                                                ; +0x11e, 0x1401495de\nmov     rbx, rcx                                                       ; +0x124, 0x1401495e4\ncmp     byte ptr [rbx+2C9h], 0                                         ; +0x127, 0x1401495e7\njz      short loc_14014962B                                            ; +0x12e, 0x1401495ee\nxor     edx, edx                                                       ; +0x130, 0x1401495f0\nmov     rcx, rbx                                                       ; +0x132, 0x1401495f2\ncall    LevelInfoLayer__scene                                          ; +0x135, 0x1401495f5\nmov     rdx, rax                                                       ; +0x13a, 0x1401495fa\nmovss   xmm0, cs:dword_140622B08                                       ; +0x13d, 0x1401495fd\ncall    cs:?create@CCTransitionFade@cocos2d@@SAPEAV12@MPEAVCCScene@2@@Z; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0x145, 0x140149605\nmov     rbx, rax                                                       ; +0x14b, 0x14014960b\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x14e, 0x14014960e\nmov     rcx, rax                                                       ; +0x154, 0x140149614\nmov     rdx, rbx                                                       ; +0x157, 0x140149617\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x15a, 0x14014961a\nadd     rsp, 20h                                                       ; +0x15f, 0x14014961f\npop     rdi                                                            ; +0x163, 0x140149623\njmp     cs:?replaceScene@CCDirector@cocos2d@@QEAA_NPEAVCCScene@2@@Z; cocos2d::CCDirector::replaceScene(cocos2d::CCScene *) ; +0x164, 0x140149624\nxor     edx, edx                                                       ; +0x16b, 0x14014962b\nmov     rcx, rbx                                                       ; +0x16d, 0x14014962d\ncall    LevelInfoLayer__scene                                          ; +0x170, 0x140149630\nmov     rdx, rax                                                       ; +0x175, 0x140149635\nmovss   xmm0, cs:dword_140622B08                                       ; +0x178, 0x140149638\ncall    cs:?create@CCTransitionFade@cocos2d@@SAPEAV12@MPEAVCCScene@2@@Z; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0x180, 0x140149640\nmov     rbx, rax                                                       ; +0x186, 0x140149646\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x189, 0x140149649\nmov     rdx, rbx                                                       ; +0x18f, 0x14014964f\nmov     rcx, rax                                                       ; +0x192, 0x140149652\ncall    cs:?pushScene@CCDirector@cocos2d@@QEAA_NPEAVCCScene@2@@Z; cocos2d::CCDirector::pushScene(cocos2d::CCScene *) ; +0x195, 0x140149655\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x19b, 0x14014965b\nadd     rsp, 20h                                                       ; +0x1a0, 0x140149660\npop     rdi                                                            ; +0x1a4, 0x140149664\nretn                                                                   ; +0x1a5, 0x140149665", "xrefs": ["LevelCell::onClick @ 0x1400b1a00", "GauntletLayer::onLevel @ 0x1401f7df7", "<???> @ 0x1406ca698"], "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"}