{"type": "func", "start": 5372619696, "end": 5372620200, "name": "PlayLayer::onQuit", "pseudocode": "// \n// PlayLayer::onQuit from 0x1403babb0 to 0x1403bada8 (504 bytes)\n// \n// 7 xrefs:\n// > EndLevelLayer::onMenu @ 0x140135134\n// > PauseLayer::onQuit @ 0x14037ec46\n// > PlayLayer::setupHasCompleted @ 0x1403a77a5\n// > PlayLayer::levelComplete @ 0x1403a88b2\n// > RetryLevelLayer::onMenu @ 0x1403cbedb\n// > PlayLayer::setupHasCompleted @ 0x1403a7712\n// > <???> @ 0x1406d7118\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 PlayLayer::onQuit(PlayLayer *a1)\n{\n  __int64 v2; // rax\n  __int64 v3; // rcx\n  __int64 v4; // rcx\n  __int64 v5; // rax\n  GameManager *v6; // rcx\n  __int64 v7; // rcx\n  cocos2d::CCEGLView *v8; // rax\n  GJBaseGameLayer *v9; // rcx\n  FMODAudioEngine *v10; // rcx\n  GameManager *v11; // rcx\n  GameManager *v12; // rcx\n  void *v13; // [rsp+30h] [rbp+8h]\n  void *v14; // [rsp+30h] [rbp+8h]\n  FMODAudioEngine *v15; // [rsp+30h] [rbp+8h]\n  void *v16; // [rsp+30h] [rbp+8h]\n  void *v17; // [rsp+30h] [rbp+8h]\n\n  v2 = cocos2d::CCDirector::sharedDirector(a1);\n  *(_DWORD *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 112LL))(v2) + 56) = 1065353216;\n  *(_BYTE *)(cocos2d::CCDirector::sharedDirector(v3) + 170) = 0;\n  v5 = qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v13 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v13);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v5 = qword_1406C2ED8;\n  }\n  if ( *(_BYTE *)(v5 + 1008) )\n  {\n    *(_BYTE *)(v5 + 1008) = 0;\n    if ( *(int *)(cocos2d::CCDirector::sharedDirector(v4) + 172) >= 10 )\n    {\n      v6 = (GameManager *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v14 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v14);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v6 = (GameManager *)qword_1406C2ED8;\n      }\n      GameManager::setGameVariable(v6, \"0023\", 0);\n    }\n  }\n  *(_BYTE *)(cocos2d::CCEGLView::sharedOpenGLView(v4) + 237) = 0;\n  v8 = (cocos2d::CCEGLView *)cocos2d::CCEGLView::sharedOpenGLView(v7);\n  cocos2d::CCEGLView::showCursor(v8, 1);\n  a1->m_uiLayer->m_pauseBtn->setEnabled(a1->m_uiLayer->m_pauseBtn, 0);\n  cocos2d::CCNode::stopActionByTag(a1, 31);\n  cocos2d::CCNode::stopAllActions(a1);\n  cocos2d::CCNode::unscheduleAllSelectors(a1);\n  GJBaseGameLayer::resetAudio(v9);\n  v10 = (FMODAudioEngine *)qword_1406C2E88;\n  if ( !qword_1406C2E88 )\n  {\n    v15 = (FMODAudioEngine *)operator new(0x888u);\n    qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v15);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n    v10 = (FMODAudioEngine *)qword_1406C2E88;\n  }\n  FMODAudioEngine::unloadAllEffects(v10);\n  v11 = (GameManager *)qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v16 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v16);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v11 = (GameManager *)qword_1406C2ED8;\n  }\n  GameManager::returnToLastScene(v11, a1->m_level);\n  v12 = (GameManager *)qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v17 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v17);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v12 = (GameManager *)qword_1406C2ED8;\n  }\n  GameManager::fadeInMenuMusic(v12);\n}", "assembly": "; \n; PlayLayer::onQuit from 0x1403babb0 to 0x1403bada8 (504 bytes)\n; \n; 7 xrefs:\n; > EndLevelLayer::onMenu @ 0x140135134\n; > PauseLayer::onQuit @ 0x14037ec46\n; > PlayLayer::setupHasCompleted @ 0x1403a77a5\n; > PlayLayer::levelComplete @ 0x1403a88b2\n; > RetryLevelLayer::onMenu @ 0x1403cbedb\n; > PlayLayer::setupHasCompleted @ 0x1403a7712\n; > <???> @ 0x1406d7118\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    rbx                                                            ; +0x0, 0x1403babb0\nsub     rsp, 20h                                                       ; +0x2, 0x1403babb2\nmov     rbx, rcx                                                       ; +0x6, 0x1403babb6\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x9, 0x1403babb9\nmov     rdx, [rax]                                                     ; +0xf, 0x1403babbf\nmov     rcx, rax                                                       ; +0x12, 0x1403babc2\ncall    qword ptr [rdx+70h]                                            ; +0x15, 0x1403babc5\nmov     dword ptr [rax+38h], 3F800000h                                 ; +0x18, 0x1403babc8\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x1f, 0x1403babcf\nmov     byte ptr [rax+0AAh], 0                                         ; +0x25, 0x1403babd5\nmov     rax, cs:qword_1406C2ED8                                        ; +0x2c, 0x1403babdc\ntest    rax, rax                                                       ; +0x33, 0x1403babe3\njnz     short loc_1403BAC17                                            ; +0x36, 0x1403babe6\nmov     ecx, 668h; Size                                                ; +0x38, 0x1403babe8\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x3d, 0x1403babed\nmov     [rsp+28h+arg_0], rax                                           ; +0x42, 0x1403babf2\nmov     rcx, rax                                                       ; +0x47, 0x1403babf7\ncall    sub_14017AB00                                                  ; +0x4a, 0x1403babfa\nnop                                                                    ; +0x4f, 0x1403babff\nmov     cs:qword_1406C2ED8, rax                                        ; +0x50, 0x1403bac00\nmov     rdx, [rax]                                                     ; +0x57, 0x1403bac07\nmov     rcx, rax                                                       ; +0x5a, 0x1403bac0a\ncall    qword ptr [rdx+48h]                                            ; +0x5d, 0x1403bac0d\nmov     rax, cs:qword_1406C2ED8                                        ; +0x60, 0x1403bac10\ncmp     byte ptr [rax+3F0h], 0                                         ; +0x67, 0x1403bac17\njz      short loc_1403BAC80                                            ; +0x6e, 0x1403bac1e\nmov     byte ptr [rax+3F0h], 0                                         ; +0x70, 0x1403bac20\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x77, 0x1403bac27\ncmp     dword ptr [rax+0ACh], 0Ah                                      ; +0x7d, 0x1403bac2d\njl      short loc_1403BAC80                                            ; +0x84, 0x1403bac34\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x86, 0x1403bac36\ntest    rcx, rcx                                                       ; +0x8d, 0x1403bac3d\njnz     short loc_1403BAC71                                            ; +0x90, 0x1403bac40\nmov     ecx, 668h; Size                                                ; +0x92, 0x1403bac42\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x97, 0x1403bac47\nmov     [rsp+28h+arg_0], rax                                           ; +0x9c, 0x1403bac4c\nmov     rcx, rax                                                       ; +0xa1, 0x1403bac51\ncall    sub_14017AB00                                                  ; +0xa4, 0x1403bac54\nnop                                                                    ; +0xa9, 0x1403bac59\nmov     cs:qword_1406C2ED8, rax                                        ; +0xaa, 0x1403bac5a\nmov     rdx, [rax]                                                     ; +0xb1, 0x1403bac61\nmov     rcx, rax                                                       ; +0xb4, 0x1403bac64\ncall    qword ptr [rdx+48h]                                            ; +0xb7, 0x1403bac67\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xba, 0x1403bac6a\nxor     r8d, r8d                                                       ; +0xc1, 0x1403bac71\nlea     rdx, a0023; \"0023\"                                             ; +0xc4, 0x1403bac74\ncall    GameManager__setGameVariable                                   ; +0xcb, 0x1403bac7b\ncall    cs:?sharedOpenGLView@CCEGLView@cocos2d@@SAPEAV12@XZ; cocos2d::CCEGLView::sharedOpenGLView(void) ; +0xd0, 0x1403bac80\nmov     byte ptr [rax+0EDh], 0                                         ; +0xd6, 0x1403bac86\ncall    cs:?sharedOpenGLView@CCEGLView@cocos2d@@SAPEAV12@XZ; cocos2d::CCEGLView::sharedOpenGLView(void) ; +0xdd, 0x1403bac8d\nmov     rcx, rax                                                       ; +0xe3, 0x1403bac93\nmov     dl, 1                                                          ; +0xe6, 0x1403bac96\ncall    cs:?showCursor@CCEGLView@cocos2d@@QEAAX_N@Z; cocos2d::CCEGLView::showCursor(bool) ; +0xe8, 0x1403bac98\nmov     rax, [rbx+3540h]                                               ; +0xee, 0x1403bac9e\nmov     rcx, [rax+238h]                                                ; +0xf5, 0x1403baca5\nmov     rax, [rcx]                                                     ; +0xfc, 0x1403bacac\nxor     edx, edx                                                       ; +0xff, 0x1403bacaf\ncall    qword ptr [rax+398h]                                           ; +0x101, 0x1403bacb1\nmov     edx, 1Fh                                                       ; +0x107, 0x1403bacb7\nmov     rcx, rbx                                                       ; +0x10c, 0x1403bacbc\ncall    cs:?stopActionByTag@CCNode@cocos2d@@QEAAXH@Z; cocos2d::CCNode::stopActionByTag(int) ; +0x10f, 0x1403bacbf\nmov     rcx, rbx                                                       ; +0x115, 0x1403bacc5\ncall    cs:?stopAllActions@CCNode@cocos2d@@QEAAXXZ; cocos2d::CCNode::stopAllActions(void) ; +0x118, 0x1403bacc8\nmov     rcx, rbx                                                       ; +0x11e, 0x1403bacce\ncall    cs:?unscheduleAllSelectors@CCNode@cocos2d@@QEAAXXZ; cocos2d::CCNode::unscheduleAllSelectors(void) ; +0x121, 0x1403bacd1\ncall    GJBaseGameLayer__resetAudio                                    ; +0x127, 0x1403bacd7\nmov     rcx, cs:qword_1406C2E88                                        ; +0x12c, 0x1403bacdc\ntest    rcx, rcx                                                       ; +0x133, 0x1403bace3\njnz     short loc_1403BAD17                                            ; +0x136, 0x1403bace6\nmov     ecx, 888h; Size                                                ; +0x138, 0x1403bace8\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x13d, 0x1403baced\nmov     [rsp+28h+arg_0], rax                                           ; +0x142, 0x1403bacf2\nmov     rcx, rax                                                       ; +0x147, 0x1403bacf7\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x14a, 0x1403bacfa\nnop                                                                    ; +0x14f, 0x1403bacff\nmov     cs:qword_1406C2E88, rax                                        ; +0x150, 0x1403bad00\nmov     rdx, [rax]                                                     ; +0x157, 0x1403bad07\nmov     rcx, rax                                                       ; +0x15a, 0x1403bad0a\ncall    qword ptr [rdx+48h]                                            ; +0x15d, 0x1403bad0d\nmov     rcx, cs:qword_1406C2E88                                        ; +0x160, 0x1403bad10\ncall    FMODAudioEngine__unloadAllEffects                              ; +0x167, 0x1403bad17\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x16c, 0x1403bad1c\ntest    rcx, rcx                                                       ; +0x173, 0x1403bad23\njnz     short loc_1403BAD57                                            ; +0x176, 0x1403bad26\nmov     ecx, 668h; Size                                                ; +0x178, 0x1403bad28\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x17d, 0x1403bad2d\nmov     [rsp+28h+arg_0], rax                                           ; +0x182, 0x1403bad32\nmov     rcx, rax                                                       ; +0x187, 0x1403bad37\ncall    sub_14017AB00                                                  ; +0x18a, 0x1403bad3a\nnop                                                                    ; +0x18f, 0x1403bad3f\nmov     cs:qword_1406C2ED8, rax                                        ; +0x190, 0x1403bad40\nmov     rdx, [rax]                                                     ; +0x197, 0x1403bad47\nmov     rcx, rax                                                       ; +0x19a, 0x1403bad4a\ncall    qword ptr [rdx+48h]                                            ; +0x19d, 0x1403bad4d\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x1a0, 0x1403bad50\nmov     rdx, [rbx+878h]                                                ; +0x1a7, 0x1403bad57\ncall    GameManager__returnToLastScene                                 ; +0x1ae, 0x1403bad5e\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x1b3, 0x1403bad63\ntest    rcx, rcx                                                       ; +0x1ba, 0x1403bad6a\njnz     short loc_1403BAD9E                                            ; +0x1bd, 0x1403bad6d\nmov     ecx, 668h; Size                                                ; +0x1bf, 0x1403bad6f\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1c4, 0x1403bad74\nmov     [rsp+28h+arg_0], rax                                           ; +0x1c9, 0x1403bad79\nmov     rcx, rax                                                       ; +0x1ce, 0x1403bad7e\ncall    sub_14017AB00                                                  ; +0x1d1, 0x1403bad81\nnop                                                                    ; +0x1d6, 0x1403bad86\nmov     cs:qword_1406C2ED8, rax                                        ; +0x1d7, 0x1403bad87\nmov     rdx, [rax]                                                     ; +0x1de, 0x1403bad8e\nmov     rcx, rax                                                       ; +0x1e1, 0x1403bad91\ncall    qword ptr [rdx+48h]                                            ; +0x1e4, 0x1403bad94\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x1e7, 0x1403bad97\nadd     rsp, 20h                                                       ; +0x1ee, 0x1403bad9e\npop     rbx                                                            ; +0x1f2, 0x1403bada2\njmp     GameManager__fadeInMenuMusic                                   ; +0x1f3, 0x1403bada3", "xrefs": ["EndLevelLayer::onMenu @ 0x140135134", "PauseLayer::onQuit @ 0x14037ec46", "PlayLayer::setupHasCompleted @ 0x1403a77a5", "PlayLayer::levelComplete @ 0x1403a88b2", "RetryLevelLayer::onMenu @ 0x1403cbedb", "PlayLayer::setupHasCompleted @ 0x1403a7712", "<???> @ 0x1406d7118"], "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"}