{"type": "func", "start": 4300512624, "end": 4300513016, "name": "GameLevelManager::gotoLevelPage", "pseudocode": "// \n// GameLevelManager::gotoLevelPage from 0x100549d70 to 0x100549ef8 (392 bytes)\n// \n// 2 xrefs:\n// > LevelCell::onClick @ 0x10023ae8c\n// > GauntletLayer::onLevel @ 0x10037f584\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:32:00 +0000\n// \n\n__int64 __fastcall GameLevelManager::gotoLevelPage(__int64 a1, __int64 a2)\n{\n  __int64 v2; // rbx\n  __int64 result; // rax\n  __int64 v4; // r14\n  __int64 v5; // rax\n  char *v6; // rax\n  _BYTE *v7; // rax\n  __int64 SavedGauntletLevel; // rax\n  char v9; // r15\n  _BYTE *v10; // rax\n\n  v2 = a2;\n  result = GameManager::sharedState();\n  *(_BYTE *)(result + 712) = 1;\n  if ( !a2 )\n    return result;\n  result = *(unsigned int *)(a2 + 1140);\n  switch ( (_DWORD)result )\n  {\n    case 4:\n      if ( *(_DWORD *)(a2 + 920) <= *(_DWORD *)(a2 + 924) )\n      {\n        if ( *(_BYTE *)(a2 + 649) == 1 )\n          SavedGauntletLevel = GameLevelManager::getSavedGauntletLevel(a1);\n        else\n          SavedGauntletLevel = GameLevelManager::getSavedLevel(a1);\n      }\n      else\n      {\n        SavedGauntletLevel = GameLevelManager::getSavedDailyLevel(a1);\n      }\n      if ( SavedGauntletLevel\n        && (*(_DWORD *)(a2 + 920) <= *(_DWORD *)(a2 + 924)\n         || *(_DWORD *)(SavedGauntletLevel + 328) - *(_DWORD *)(SavedGauntletLevel + 332) == *(_DWORD *)(a2 + 328)\n                                                                                           - *(_DWORD *)(a2 + 332)) )\n      {\n        if ( *(_BYTE *)(SavedGauntletLevel + 1105) == 1 )\n        {\n          GameLevelManager::saveLevel(a1, a2);\n        }\n        else if ( *(_DWORD *)(SavedGauntletLevel + 788) >= *(_DWORD *)(a2 + 788) )\n        {\n          *(_DWORD *)(SavedGauntletLevel + 608) = *(_DWORD *)(a2 + 608);\n          v2 = SavedGauntletLevel;\n        }\n      }\n      v9 = *(_BYTE *)(v2 + 649);\n      v4 = cocos2d::CCDirector::sharedDirector();\n      v10 = LevelInfoLayer::scene(v2, 0);\n      v6 = cocos2d::CCTransitionFade::create_1((__int64)v10, 0.5);\n      if ( v9 == 1 )\n        return cocos2d::CCDirector::replaceScene(v4, v6);\n      return cocos2d::CCDirector::pushScene(v4, (_UNKNOWN **)v6);\n    case 3:\n      v4 = cocos2d::CCDirector::sharedDirector();\n      v7 = LevelInfoLayer::scene(a2, 0);\n      v6 = cocos2d::CCTransitionFade::create_1((__int64)v7, 0.5);\n      return cocos2d::CCDirector::pushScene(v4, (_UNKNOWN **)v6);\n    case 2:\n      v4 = cocos2d::CCDirector::sharedDirector();\n      v5 = EditLevelLayer::scene(a2, a2);\n      v6 = cocos2d::CCTransitionFade::create_1(v5, 0.5);\n      return cocos2d::CCDirector::replaceScene(v4, v6);\n  }\n  return result;\n}", "assembly": "; \n; GameLevelManager::gotoLevelPage from 0x100549d70 to 0x100549ef8 (392 bytes)\n; \n; 2 xrefs:\n; > LevelCell::onClick @ 0x10023ae8c\n; > GauntletLayer::onLevel @ 0x10037f584\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:32:00 +0000\n; \npush    rbp                                                            ; +0x0, 0x100549d70\nmov     rbp, rsp                                                       ; +0x1, 0x100549d71\npush    r15                                                            ; +0x4, 0x100549d74\npush    r14                                                            ; +0x6, 0x100549d76\npush    rbx                                                            ; +0x8, 0x100549d78\npush    rax                                                            ; +0x9, 0x100549d79\nmov     rbx, rsi                                                       ; +0xa, 0x100549d7a\nmov     r14, rdi                                                       ; +0xd, 0x100549d7d\ncall    GameManager__sharedState                                       ; +0x10, 0x100549d80\nmov     byte ptr [rax+2C8h], 1                                         ; +0x15, 0x100549d85\ntest    rbx, rbx                                                       ; +0x1c, 0x100549d8c\njz      short loc_100549DCB                                            ; +0x1f, 0x100549d8f\nmov     eax, [rbx+474h]                                                ; +0x21, 0x100549d91\ncmp     eax, 4                                                         ; +0x27, 0x100549d97\njz      short loc_100549DFD                                            ; +0x2a, 0x100549d9a\ncmp     eax, 3                                                         ; +0x2c, 0x100549d9c\njz      short loc_100549DD6                                            ; +0x2f, 0x100549d9f\ncmp     eax, 2                                                         ; +0x31, 0x100549da1\njnz     short loc_100549DCB                                            ; +0x34, 0x100549da4\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x36, 0x100549da6\nmov     r14, rax                                                       ; +0x3b, 0x100549dab\nmov     rdi, rbx                                                       ; +0x3e, 0x100549dae\ncall    EditLevelLayer__scene                                          ; +0x41, 0x100549db1\nmovss   xmm0, cs:dword_100A03578                                       ; +0x46, 0x100549db6\nmov     rdi, rax                                                       ; +0x4e, 0x100549dbe\ncall    cocos2d__CCTransitionFade__create_1                            ; +0x51, 0x100549dc1\njmp     loc_100549ECE                                                  ; +0x56, 0x100549dc6\nadd     rsp, 8                                                         ; +0x5b, 0x100549dcb\npop     rbx                                                            ; +0x5f, 0x100549dcf\npop     r14                                                            ; +0x60, 0x100549dd0\npop     r15                                                            ; +0x62, 0x100549dd2\npop     rbp                                                            ; +0x64, 0x100549dd4\nretn                                                                   ; +0x65, 0x100549dd5\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x66, 0x100549dd6\nmov     r14, rax                                                       ; +0x6b, 0x100549ddb\nmov     rdi, rbx                                                       ; +0x6e, 0x100549dde\nxor     esi, esi                                                       ; +0x71, 0x100549de1\ncall    LevelInfoLayer__scene                                          ; +0x73, 0x100549de3\nmovss   xmm0, cs:dword_100A03578                                       ; +0x78, 0x100549de8\nmov     rdi, rax                                                       ; +0x80, 0x100549df0\ncall    cocos2d__CCTransitionFade__create_1                            ; +0x83, 0x100549df3\njmp     loc_100549EE3                                                  ; +0x88, 0x100549df8\nmov     esi, [rbx+398h]                                                ; +0x8d, 0x100549dfd\nsub     esi, [rbx+39Ch]                                                ; +0x93, 0x100549e03\njle     short loc_100549E15                                            ; +0x99, 0x100549e09\nmov     rdi, r14                                                       ; +0x9b, 0x100549e0b\ncall    GameLevelManager__getSavedDailyLevel                           ; +0x9e, 0x100549e0e\njmp     short loc_100549E3C                                            ; +0xa3, 0x100549e13\nmov     esi, [rbx+148h]                                                ; +0xa5, 0x100549e15\nsub     esi, [rbx+14Ch]                                                ; +0xab, 0x100549e1b\ncmp     byte ptr [rbx+289h], 1                                         ; +0xb1, 0x100549e21\njnz     short loc_100549E34                                            ; +0xb8, 0x100549e28\nmov     rdi, r14                                                       ; +0xba, 0x100549e2a\ncall    GameLevelManager__getSavedGauntletLevel                        ; +0xbd, 0x100549e2d\njmp     short loc_100549E3C                                            ; +0xc2, 0x100549e32\nmov     rdi, r14                                                       ; +0xc4, 0x100549e34\ncall    GameLevelManager__getSavedLevel                                ; +0xc7, 0x100549e37\ntest    rax, rax                                                       ; +0xcc, 0x100549e3c\njz      short loc_100549E9E                                            ; +0xcf, 0x100549e3f\nmov     ecx, [rbx+398h]                                                ; +0xd1, 0x100549e41\ncmp     ecx, [rbx+39Ch]                                                ; +0xd7, 0x100549e47\njle     short loc_100549E6B                                            ; +0xdd, 0x100549e4d\nmov     ecx, [rax+148h]                                                ; +0xdf, 0x100549e4f\nsub     ecx, [rax+14Ch]                                                ; +0xe5, 0x100549e55\nmov     edx, [rbx+148h]                                                ; +0xeb, 0x100549e5b\nsub     edx, [rbx+14Ch]                                                ; +0xf1, 0x100549e61\ncmp     ecx, edx                                                       ; +0xf7, 0x100549e67\njnz     short loc_100549E9E                                            ; +0xf9, 0x100549e69\ncmp     byte ptr [rax+451h], 1                                         ; +0xfb, 0x100549e6b\njnz     short loc_100549E81                                            ; +0x102, 0x100549e72\nmov     rdi, r14                                                       ; +0x104, 0x100549e74\nmov     rsi, rbx                                                       ; +0x107, 0x100549e77\ncall    GameLevelManager__saveLevel                                    ; +0x10a, 0x100549e7a\njmp     short loc_100549E9E                                            ; +0x10f, 0x100549e7f\nmov     ecx, [rax+314h]                                                ; +0x111, 0x100549e81\ncmp     ecx, [rbx+314h]                                                ; +0x117, 0x100549e87\njl      short loc_100549E9E                                            ; +0x11d, 0x100549e8d\nmov     ecx, [rbx+260h]                                                ; +0x11f, 0x100549e8f\nmov     [rax+260h], ecx                                                ; +0x125, 0x100549e95\nmov     rbx, rax                                                       ; +0x12b, 0x100549e9b\nmovzx   r15d, byte ptr [rbx+289h]                                      ; +0x12e, 0x100549e9e\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x136, 0x100549ea6\nmov     r14, rax                                                       ; +0x13b, 0x100549eab\nmov     rdi, rbx                                                       ; +0x13e, 0x100549eae\nxor     esi, esi                                                       ; +0x141, 0x100549eb1\ncall    LevelInfoLayer__scene                                          ; +0x143, 0x100549eb3\nmovss   xmm0, cs:dword_100A03578                                       ; +0x148, 0x100549eb8\nmov     rdi, rax                                                       ; +0x150, 0x100549ec0\ncall    cocos2d__CCTransitionFade__create_1                            ; +0x153, 0x100549ec3\ncmp     r15b, 1                                                        ; +0x158, 0x100549ec8\njnz     short loc_100549EE3                                            ; +0x15c, 0x100549ecc\nmov     rdi, r14                                                       ; +0x15e, 0x100549ece\nmov     rsi, rax                                                       ; +0x161, 0x100549ed1\nadd     rsp, 8                                                         ; +0x164, 0x100549ed4\npop     rbx                                                            ; +0x168, 0x100549ed8\npop     r14                                                            ; +0x169, 0x100549ed9\npop     r15                                                            ; +0x16b, 0x100549edb\npop     rbp                                                            ; +0x16d, 0x100549edd\njmp     cocos2d__CCDirector__replaceScene                              ; +0x16e, 0x100549ede\nmov     rdi, r14                                                       ; +0x173, 0x100549ee3\nmov     rsi, rax                                                       ; +0x176, 0x100549ee6\nadd     rsp, 8                                                         ; +0x179, 0x100549ee9\npop     rbx                                                            ; +0x17d, 0x100549eed\npop     r14                                                            ; +0x17e, 0x100549eee\npop     r15                                                            ; +0x180, 0x100549ef0\npop     rbp                                                            ; +0x182, 0x100549ef2\njmp     cocos2d__CCDirector__pushScene                                 ; +0x183, 0x100549ef3", "xrefs": ["LevelCell::onClick @ 0x10023ae8c", "GauntletLayer::onLevel @ 0x10037f584"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}