{"type": "func", "start": 5370942352, "end": 5370942838, "name": "GameLevelManager::gotoLevelPage", "pseudocode": "// \n// GameLevelManager::gotoLevelPage from 0x140221390 to 0x140221576 (486 bytes)\n// \n// 4 xrefs:\n// > LevelCell::onClick @ 0x14014d460\n// > LevelCell::onClick @ 0x14014d4bd\n// > GauntletLayer::onLevel @ 0x1402fcbfa\n// > <???> @ 0x14091bba8\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 11:28:24 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nchar __fastcall GameLevelManager::gotoLevelPage(_QWORD *a1, __int64 a2, __int64 a3, __int64 a4)\n{\n  __int64 v4; // rbx\n  __int64 v6; // rax\n  struct cocos2d::CCScene *v7; // rax\n  struct cocos2d::CCScene *v8; // rbx\n  __int64 v9; // rcx\n  cocos2d::CCDirector *v10; // rax\n  __int64 SavedGauntletLevel; // rax\n  _DWORD *v12; // rdi\n  _DWORD *v13; // rsi\n  struct cocos2d::CCScene *v14; // rax\n  struct cocos2d::CCScene *v15; // rbx\n  __int64 v16; // rcx\n  cocos2d::CCDirector *v17; // rax\n  struct cocos2d::CCScene *v18; // rax\n  struct cocos2d::CCScene *v19; // rbx\n  __int64 v20; // rcx\n  cocos2d::CCDirector *v21; // rax\n  void *v23; // [rsp+38h] [rbp+10h]\n\n  v4 = a2;\n  v6 = qword_14090BFD0;\n  if ( !qword_14090BFD0 )\n  {\n    v23 = operator new(0x6E8u);\n    qword_14090BFD0 = GameManager::GameManager(v23);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    v6 = qword_14090BFD0;\n  }\n  *(_BYTE *)(v6 + 744) = 1;\n  if ( v4 )\n  {\n    LODWORD(v6) = *(_DWORD *)(v4 + 1220);\n    if ( (_DWORD)v6 != 2 )\n    {\n      if ( (_DWORD)v6 != 3 )\n      {\n        if ( (_DWORD)v6 != 4 )\n          return v6;\n        if ( *(_DWORD *)(v4 + 992) - *(_DWORD *)(v4 + 996) <= 0 )\n        {\n          v12 = (_DWORD *)(v4 + 332);\n          v13 = (_DWORD *)(v4 + 328);\n          if ( *(_BYTE *)(v4 + 721) )\n            SavedGauntletLevel = GameLevelManager::getSavedGauntletLevel((__int64)a1);\n          else\n            SavedGauntletLevel = GameLevelManager::getSavedLevel((__int64)a1);\n        }\n        else\n        {\n          SavedGauntletLevel = GameLevelManager::getSavedDailyLevel((__int64)a1);\n          v12 = (_DWORD *)(v4 + 332);\n          v13 = (_DWORD *)(v4 + 328);\n        }\n        if ( SavedGauntletLevel\n          && (*(_DWORD *)(v4 + 992) - *(_DWORD *)(v4 + 996) <= 0\n           || *(_DWORD *)(SavedGauntletLevel + 328) - *(_DWORD *)(SavedGauntletLevel + 332) == *v13 - *v12) )\n        {\n          if ( *(_BYTE *)(SavedGauntletLevel + 1185) )\n          {\n            GameLevelManager::saveLevel(a1, v4);\n          }\n          else if ( *(_DWORD *)(SavedGauntletLevel + 860) >= *(_DWORD *)(v4 + 860) )\n          {\n            *(_DWORD *)(SavedGauntletLevel + 680) = *(_DWORD *)(v4 + 680);\n            v4 = SavedGauntletLevel;\n          }\n        }\n        if ( *(_BYTE *)(v4 + 721) )\n        {\n          v14 = (struct cocos2d::CCScene *)LevelInfoLayer::scene(v4, 0);\n          v15 = cocos2d::CCTransitionFade::create(0.5, v14);\n          v17 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v16);\n          LOBYTE(v6) = cocos2d::CCDirector::replaceScene(v17, v15);\n          return v6;\n        }\n      }\n      v18 = (struct cocos2d::CCScene *)LevelInfoLayer::scene(v4, 0);\n      v19 = cocos2d::CCTransitionFade::create(0.5, v18);\n      v21 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v20);\n      LOBYTE(v6) = cocos2d::CCDirector::pushScene(v21, v19);\n      return v6;\n    }\n    v7 = (struct cocos2d::CCScene *)EditLevelLayer::scene(v4, a2, a3, a4);\n    v8 = cocos2d::CCTransitionFade::create(0.5, v7);\n    v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v9);\n    LOBYTE(v6) = cocos2d::CCDirector::replaceScene(v10, v8);\n  }\n  return v6;\n}", "assembly": "; \n; GameLevelManager::gotoLevelPage from 0x140221390 to 0x140221576 (486 bytes)\n; \n; 4 xrefs:\n; > LevelCell::onClick @ 0x14014d460\n; > LevelCell::onClick @ 0x14014d4bd\n; > GauntletLayer::onLevel @ 0x1402fcbfa\n; > <???> @ 0x14091bba8\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 11:28:24 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x140221390\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x140221395\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x14022139a\npush    rdi                                                            ; +0xf, 0x14022139f\nsub     rsp, 20h                                                       ; +0x10, 0x1402213a0\nmov     rbx, rdx                                                       ; +0x14, 0x1402213a4\nmov     rbp, rcx                                                       ; +0x17, 0x1402213a7\nmov     rax, cs:qword_14090BFD0                                        ; +0x1a, 0x1402213aa\ntest    rax, rax                                                       ; +0x21, 0x1402213b1\njnz     short loc_1402213E8                                            ; +0x24, 0x1402213b4\nmov     ecx, 6E8h; Size                                                ; +0x26, 0x1402213b6\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x2b, 0x1402213bb\nmov     [rsp+28h+arg_8], rax                                           ; +0x30, 0x1402213c0\nmov     rcx, rax                                                       ; +0x35, 0x1402213c5\ncall    GameManager__GameManager                                       ; +0x38, 0x1402213c8\nnop                                                                    ; +0x3d, 0x1402213cd\nmov     cs:qword_14090BFD0, rax                                        ; +0x3e, 0x1402213ce\nmov     rcx, [rax]                                                     ; +0x45, 0x1402213d5\nmov     rdx, [rcx+48h]                                                 ; +0x48, 0x1402213d8\nmov     rcx, rax                                                       ; +0x4c, 0x1402213dc\ncall    rdx                                                            ; +0x4f, 0x1402213df\nmov     rax, cs:qword_14090BFD0                                        ; +0x51, 0x1402213e1\nmov     byte ptr [rax+2E8h], 1                                         ; +0x58, 0x1402213e8\ntest    rbx, rbx                                                       ; +0x5f, 0x1402213ef\njz      loc_140221561                                                  ; +0x62, 0x1402213f2\nmov     eax, [rbx+4C4h]                                                ; +0x68, 0x1402213f8\ncmp     eax, 2                                                         ; +0x6e, 0x1402213fe\njnz     short loc_140221436                                            ; +0x71, 0x140221401\nmov     rcx, rbx                                                       ; +0x73, 0x140221403\ncall    EditLevelLayer__scene                                          ; +0x76, 0x140221406\nmov     rdx, rax                                                       ; +0x7b, 0x14022140b\nmovss   xmm0, cs:dword_140834F20                                       ; +0x7e, 0x14022140e\ncall    cs:?create@CCTransitionFade@cocos2d@@SAPEAV12@MPEAVCCScene@2@@Z; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0x86, 0x140221416\nmov     rbx, rax                                                       ; +0x8c, 0x14022141c\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x8f, 0x14022141f\nmov     rcx, rax                                                       ; +0x95, 0x140221425\nmov     rdx, rbx                                                       ; +0x98, 0x140221428\ncall    cs:?replaceScene@CCDirector@cocos2d@@QEAA_NPEAVCCScene@2@@Z; cocos2d::CCDirector::replaceScene(cocos2d::CCScene *) ; +0x9b, 0x14022142b\njmp     loc_140221561                                                  ; +0xa1, 0x140221431\ncmp     eax, 3                                                         ; +0xa6, 0x140221436\njz      loc_140221531                                                  ; +0xa9, 0x140221439\ncmp     eax, 4                                                         ; +0xaf, 0x14022143f\njnz     loc_140221561                                                  ; +0xb2, 0x140221442\nmov     edx, [rbx+3E0h]                                                ; +0xb8, 0x140221448\nsub     edx, [rbx+3E4h]                                                ; +0xbe, 0x14022144e\nmov     rcx, rbp                                                       ; +0xc4, 0x140221454\ntest    edx, edx                                                       ; +0xc7, 0x140221457\njle     short loc_140221470                                            ; +0xc9, 0x140221459\ncall    GameLevelManager__getSavedDailyLevel                           ; +0xcb, 0x14022145b\nlea     rdi, [rbx+14Ch]                                                ; +0xd0, 0x140221460\nlea     rsi, [rbx+148h]                                                ; +0xd7, 0x140221467\njmp     short loc_140221497                                            ; +0xde, 0x14022146e\nlea     rdi, [rbx+14Ch]                                                ; +0xe0, 0x140221470\nlea     rsi, [rbx+148h]                                                ; +0xe7, 0x140221477\nmov     edx, [rsi]                                                     ; +0xee, 0x14022147e\nsub     edx, [rdi]                                                     ; +0xf0, 0x140221480\ncmp     byte ptr [rbx+2D1h], 0                                         ; +0xf2, 0x140221482\njz      short loc_140221492                                            ; +0xf9, 0x140221489\ncall    GameLevelManager__getSavedGauntletLevel                        ; +0xfb, 0x14022148b\njmp     short loc_140221497                                            ; +0x100, 0x140221490\ncall    GameLevelManager__getSavedLevel                                ; +0x102, 0x140221492\nmov     rdx, rax                                                       ; +0x107, 0x140221497\ntest    rax, rax                                                       ; +0x10a, 0x14022149a\njz      short loc_1402214F6                                            ; +0x10d, 0x14022149d\nmov     eax, [rbx+3E0h]                                                ; +0x10f, 0x14022149f\nsub     eax, [rbx+3E4h]                                                ; +0x115, 0x1402214a5\ntest    eax, eax                                                       ; +0x11b, 0x1402214ab\njle     short loc_1402214C3                                            ; +0x11d, 0x1402214ad\nmov     ecx, [rdx+148h]                                                ; +0x11f, 0x1402214af\nsub     ecx, [rdx+14Ch]                                                ; +0x125, 0x1402214b5\nmov     eax, [rsi]                                                     ; +0x12b, 0x1402214bb\nsub     eax, [rdi]                                                     ; +0x12d, 0x1402214bd\ncmp     ecx, eax                                                       ; +0x12f, 0x1402214bf\njnz     short loc_1402214F6                                            ; +0x131, 0x1402214c1\ncmp     byte ptr [rdx+4A1h], 0                                         ; +0x133, 0x1402214c3\njz      short loc_1402214D9                                            ; +0x13a, 0x1402214ca\nmov     rdx, rbx                                                       ; +0x13c, 0x1402214cc\nmov     rcx, rbp                                                       ; +0x13f, 0x1402214cf\ncall    GameLevelManager__saveLevel                                    ; +0x142, 0x1402214d2\njmp     short loc_1402214F6                                            ; +0x147, 0x1402214d7\nmov     eax, [rbx+35Ch]                                                ; +0x149, 0x1402214d9\ncmp     [rdx+35Ch], eax                                                ; +0x14f, 0x1402214df\njl      short loc_1402214F6                                            ; +0x155, 0x1402214e5\nmov     eax, [rbx+2A8h]                                                ; +0x157, 0x1402214e7\nmov     [rdx+2A8h], eax                                                ; +0x15d, 0x1402214ed\nmov     rbx, rdx                                                       ; +0x163, 0x1402214f3\ncmp     byte ptr [rbx+2D1h], 0                                         ; +0x166, 0x1402214f6\njz      short loc_140221531                                            ; +0x16d, 0x1402214fd\nxor     edx, edx                                                       ; +0x16f, 0x1402214ff\nmov     rcx, rbx                                                       ; +0x171, 0x140221501\ncall    LevelInfoLayer__scene                                          ; +0x174, 0x140221504\nmov     rdx, rax                                                       ; +0x179, 0x140221509\nmovss   xmm0, cs:dword_140834F20                                       ; +0x17c, 0x14022150c\ncall    cs:?create@CCTransitionFade@cocos2d@@SAPEAV12@MPEAVCCScene@2@@Z; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0x184, 0x140221514\nmov     rbx, rax                                                       ; +0x18a, 0x14022151a\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x18d, 0x14022151d\nmov     rcx, rax                                                       ; +0x193, 0x140221523\nmov     rdx, rbx                                                       ; +0x196, 0x140221526\ncall    cs:?replaceScene@CCDirector@cocos2d@@QEAA_NPEAVCCScene@2@@Z; cocos2d::CCDirector::replaceScene(cocos2d::CCScene *) ; +0x199, 0x140221529\njmp     short loc_140221561                                            ; +0x19f, 0x14022152f\nxor     edx, edx                                                       ; +0x1a1, 0x140221531\nmov     rcx, rbx                                                       ; +0x1a3, 0x140221533\ncall    LevelInfoLayer__scene                                          ; +0x1a6, 0x140221536\nmov     rdx, rax                                                       ; +0x1ab, 0x14022153b\nmovss   xmm0, cs:dword_140834F20                                       ; +0x1ae, 0x14022153e\ncall    cs:?create@CCTransitionFade@cocos2d@@SAPEAV12@MPEAVCCScene@2@@Z; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0x1b6, 0x140221546\nmov     rbx, rax                                                       ; +0x1bc, 0x14022154c\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x1bf, 0x14022154f\nmov     rdx, rbx                                                       ; +0x1c5, 0x140221555\nmov     rcx, rax                                                       ; +0x1c8, 0x140221558\ncall    cs:?pushScene@CCDirector@cocos2d@@QEAA_NPEAVCCScene@2@@Z; cocos2d::CCDirector::pushScene(cocos2d::CCScene *) ; +0x1cb, 0x14022155b\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x1d1, 0x140221561\nmov     rbp, [rsp+28h+arg_10]                                          ; +0x1d6, 0x140221566\nmov     rsi, [rsp+28h+arg_18]                                          ; +0x1db, 0x14022156b\nadd     rsp, 20h                                                       ; +0x1e0, 0x140221570\npop     rdi                                                            ; +0x1e4, 0x140221574\nretn                                                                   ; +0x1e5, 0x140221575", "xrefs": ["LevelCell::onClick @ 0x14014d460", "LevelCell::onClick @ 0x14014d4bd", "GauntletLayer::onLevel @ 0x1402fcbfa", "<???> @ 0x14091bba8"], "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"}