{"type": "func", "start": 4300439504, "end": 4300439854, "name": "GameLevelManager::gotoLevelPage", "pseudocode": "// \n// GameLevelManager::gotoLevelPage from 0x100537fd0 to 0x10053812e (350 bytes)\n// \n// 2 xrefs:\n// > LevelCell::onClick @ 0x100252238\n// > GauntletLayer::onLevel @ 0x100394614\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\nvoid __fastcall GameLevelManager::gotoLevelPage(GameLevelManager *a1, GJGameLevel *a2)\n{\n  GJGameLevel *v2; // rbx\n  GJLevelType m_levelType; // eax\n  cocos2d::CCDirector *v4; // r14\n  cocos2d::CCScene *v5; // rax\n  cocos2d::CCTransitionFade *v6; // rax\n  cocos2d::CCScene *v7; // rax\n  int random; // esi\n  bool v9; // cc\n  int v10; // esi\n  GJGameLevel *SavedGauntletLevel; // rax\n  int v12; // esi\n  bool m_gauntletLevel; // r15\n  cocos2d::CCScene *v14; // rax\n\n  v2 = a2;\n  GameManager::sharedState()->m_searchObjectBool = 1;\n  if ( !a2 )\n    return;\n  m_levelType = a2->m_levelType;\n  switch ( m_levelType )\n  {\n    case SearchResult:\n      random = a2->m_dailyID.random;\n      v9 = random <= v2->m_dailyID.seed;\n      v10 = random - v2->m_dailyID.seed;\n      if ( v9 )\n      {\n        v12 = v2->m_levelID.random - v2->m_levelID.seed;\n        if ( v2->m_gauntletLevel )\n          SavedGauntletLevel = GameLevelManager::getSavedGauntletLevel(a1, v12);\n        else\n          SavedGauntletLevel = GameLevelManager::getSavedLevel(a1, v12);\n      }\n      else\n      {\n        SavedGauntletLevel = GameLevelManager::getSavedDailyLevel(a1, v10);\n      }\n      if ( SavedGauntletLevel )\n      {\n        if ( SavedGauntletLevel->m_levelNotDownloaded )\n        {\n          GameLevelManager::saveLevel(a1, v2);\n        }\n        else if ( SavedGauntletLevel->m_levelVersion >= v2->m_levelVersion )\n        {\n          SavedGauntletLevel->m_songID = v2->m_songID;\n          v2 = SavedGauntletLevel;\n        }\n      }\n      m_gauntletLevel = v2->m_gauntletLevel;\n      v4 = cocos2d::CCDirector::sharedDirector();\n      v14 = LevelInfoLayer::scene(v2, 0);\n      v6 = cocos2d::CCTransitionFade::create_1(0.5, v14);\n      if ( m_gauntletLevel )\n        goto LABEL_19;\n      goto LABEL_20;\n    case Saved:\n      v4 = cocos2d::CCDirector::sharedDirector();\n      v7 = LevelInfoLayer::scene(a2, 0);\n      v6 = cocos2d::CCTransitionFade::create_1(0.5, v7);\nLABEL_20:\n      cocos2d::CCDirector::pushScene(v4, v6);\n      return;\n    case Editor:\n      v4 = cocos2d::CCDirector::sharedDirector();\n      v5 = EditLevelLayer::scene(a2);\n      v6 = cocos2d::CCTransitionFade::create_1(0.5, v5);\nLABEL_19:\n      cocos2d::CCDirector::replaceScene(v4, v6);\n      break;\n  }\n}", "assembly": "; \n; GameLevelManager::gotoLevelPage from 0x100537fd0 to 0x10053812e (350 bytes)\n; \n; 2 xrefs:\n; > LevelCell::onClick @ 0x100252238\n; > GauntletLayer::onLevel @ 0x100394614\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\npush    rbp                                                            ; +0x0, 0x100537fd0\nmov     rbp, rsp                                                       ; +0x1, 0x100537fd1\npush    r15                                                            ; +0x4, 0x100537fd4\npush    r14                                                            ; +0x6, 0x100537fd6\npush    rbx                                                            ; +0x8, 0x100537fd8\npush    rax                                                            ; +0x9, 0x100537fd9\nmov     rbx, rsi                                                       ; +0xa, 0x100537fda\nmov     r14, rdi                                                       ; +0xd, 0x100537fdd\ncall    GameManager__sharedState                                       ; +0x10, 0x100537fe0\nmov     byte ptr [rax+2A0h], 1                                         ; +0x15, 0x100537fe5\ntest    rbx, rbx                                                       ; +0x1c, 0x100537fec\njz      short loc_10053802B                                            ; +0x1f, 0x100537fef\nmov     eax, [rbx+404h]                                                ; +0x21, 0x100537ff1\ncmp     eax, 4                                                         ; +0x27, 0x100537ff7\njz      short loc_10053805D                                            ; +0x2a, 0x100537ffa\ncmp     eax, 3                                                         ; +0x2c, 0x100537ffc\njz      short loc_100538036                                            ; +0x2f, 0x100537fff\ncmp     eax, 2                                                         ; +0x31, 0x100538001\njnz     short loc_10053802B                                            ; +0x34, 0x100538004\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x36, 0x100538006\nmov     r14, rax                                                       ; +0x3b, 0x10053800b\nmov     rdi, rbx                                                       ; +0x3e, 0x10053800e\ncall    EditLevelLayer__scene                                          ; +0x41, 0x100538011\nmovss   xmm0, cs:dword_100814FA8                                       ; +0x46, 0x100538016\nmov     rdi, rax                                                       ; +0x4e, 0x10053801e\ncall    cocos2d__CCTransitionFade__create_1                            ; +0x51, 0x100538021\njmp     loc_100538104                                                  ; +0x56, 0x100538026\nadd     rsp, 8                                                         ; +0x5b, 0x10053802b\npop     rbx                                                            ; +0x5f, 0x10053802f\npop     r14                                                            ; +0x60, 0x100538030\npop     r15                                                            ; +0x62, 0x100538032\npop     rbp                                                            ; +0x64, 0x100538034\nretn                                                                   ; +0x65, 0x100538035\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x66, 0x100538036\nmov     r14, rax                                                       ; +0x6b, 0x10053803b\nmov     rdi, rbx                                                       ; +0x6e, 0x10053803e\nxor     esi, esi                                                       ; +0x71, 0x100538041\ncall    LevelInfoLayer__scene                                          ; +0x73, 0x100538043\nmovss   xmm0, cs:dword_100814FA8                                       ; +0x78, 0x100538048\nmov     rdi, rax                                                       ; +0x80, 0x100538050\ncall    cocos2d__CCTransitionFade__create_1                            ; +0x83, 0x100538053\njmp     loc_100538119                                                  ; +0x88, 0x100538058\nmov     esi, [rbx+324h]                                                ; +0x8d, 0x10053805d\nsub     esi, [rbx+328h]                                                ; +0x93, 0x100538063\njle     short loc_100538075                                            ; +0x99, 0x100538069\nmov     rdi, r14                                                       ; +0x9b, 0x10053806b\ncall    GameLevelManager__getSavedDailyLevel                           ; +0x9e, 0x10053806e\njmp     short loc_10053809C                                            ; +0xa3, 0x100538073\nmov     esi, [rbx+148h]                                                ; +0xa5, 0x100538075\nsub     esi, [rbx+14Ch]                                                ; +0xab, 0x10053807b\ncmp     byte ptr [rbx+281h], 1                                         ; +0xb1, 0x100538081\njnz     short loc_100538094                                            ; +0xb8, 0x100538088\nmov     rdi, r14                                                       ; +0xba, 0x10053808a\ncall    GameLevelManager__getSavedGauntletLevel                        ; +0xbd, 0x10053808d\njmp     short loc_10053809C                                            ; +0xc2, 0x100538092\nmov     rdi, r14                                                       ; +0xc4, 0x100538094\ncall    GameLevelManager__getSavedLevel                                ; +0xc7, 0x100538097\ntest    rax, rax                                                       ; +0xcc, 0x10053809c\njz      short loc_1005380D4                                            ; +0xcf, 0x10053809f\ncmp     byte ptr [rax+3E1h], 1                                         ; +0xd1, 0x1005380a1\njnz     short loc_1005380B7                                            ; +0xd8, 0x1005380a8\nmov     rdi, r14                                                       ; +0xda, 0x1005380aa\nmov     rsi, rbx                                                       ; +0xdd, 0x1005380ad\ncall    GameLevelManager__saveLevel                                    ; +0xe0, 0x1005380b0\njmp     short loc_1005380D4                                            ; +0xe5, 0x1005380b5\nmov     ecx, [rax+2A0h]                                                ; +0xe7, 0x1005380b7\ncmp     ecx, [rbx+2A0h]                                                ; +0xed, 0x1005380bd\njl      short loc_1005380D4                                            ; +0xf3, 0x1005380c3\nmov     ecx, [rbx+258h]                                                ; +0xf5, 0x1005380c5\nmov     [rax+258h], ecx                                                ; +0xfb, 0x1005380cb\nmov     rbx, rax                                                       ; +0x101, 0x1005380d1\nmovzx   r15d, byte ptr [rbx+281h]                                      ; +0x104, 0x1005380d4\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x10c, 0x1005380dc\nmov     r14, rax                                                       ; +0x111, 0x1005380e1\nmov     rdi, rbx                                                       ; +0x114, 0x1005380e4\nxor     esi, esi                                                       ; +0x117, 0x1005380e7\ncall    LevelInfoLayer__scene                                          ; +0x119, 0x1005380e9\nmovss   xmm0, cs:dword_100814FA8                                       ; +0x11e, 0x1005380ee\nmov     rdi, rax                                                       ; +0x126, 0x1005380f6\ncall    cocos2d__CCTransitionFade__create_1                            ; +0x129, 0x1005380f9\ncmp     r15b, 1                                                        ; +0x12e, 0x1005380fe\njnz     short loc_100538119                                            ; +0x132, 0x100538102\nmov     rdi, r14                                                       ; +0x134, 0x100538104\nmov     rsi, rax                                                       ; +0x137, 0x100538107\nadd     rsp, 8                                                         ; +0x13a, 0x10053810a\npop     rbx                                                            ; +0x13e, 0x10053810e\npop     r14                                                            ; +0x13f, 0x10053810f\npop     r15                                                            ; +0x141, 0x100538111\npop     rbp                                                            ; +0x143, 0x100538113\njmp     cocos2d__CCDirector__replaceScene                              ; +0x144, 0x100538114\nmov     rdi, r14                                                       ; +0x149, 0x100538119\nmov     rsi, rax                                                       ; +0x14c, 0x10053811c\nadd     rsp, 8                                                         ; +0x14f, 0x10053811f\npop     rbx                                                            ; +0x153, 0x100538123\npop     r14                                                            ; +0x154, 0x100538124\npop     r15                                                            ; +0x156, 0x100538126\npop     rbp                                                            ; +0x158, 0x100538128\njmp     cocos2d__CCDirector__pushScene                                 ; +0x159, 0x100538129", "xrefs": ["LevelCell::onClick @ 0x100252238", "GauntletLayer::onLevel @ 0x100394614"], "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"}