{"type": "func", "start": 5372616272, "end": 5372616918, "name": "PlayLayer::togglePracticeMode", "pseudocode": "// \n// PlayLayer::togglePracticeMode from 0x1403b9e50 to 0x1403ba0d6 (646 bytes)\n// \n// 4 xrefs:\n// > PauseLayer::onPracticeMode @ 0x14037e214\n// > PauseLayer::onNormalMode @ 0x14037e2ed\n// > PlayLayer::fullReset @ 0x1403b8c72\n// > <???> @ 0x1406d70d0\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=6\nvoid PlayLayer::togglePracticeMode(PlayLayer *a1, bool a2)\n{\n  __int64 v4; // rdi\n  __int64 v5; // rdi\n  MusicDownloadManager *v6; // rax\n  int v7; // edi\n  MusicDownloadManager *v8; // rax\n  _QWORD *v9; // rax\n  size_t v10; // r8\n  FMODAudioEngine *v11; // rcx\n  FMODAudioEngine *v12; // [rsp+30h] [rbp-68h]\n  __int128 v13; // [rsp+38h] [rbp-60h] BYREF\n  __int64 v14; // [rsp+48h] [rbp-50h]\n  __int64 v15; // [rsp+50h] [rbp-48h]\n  FMODAudioEngine *v16; // [rsp+58h] [rbp-40h]\n  _QWORD v17[4]; // [rsp+60h] [rbp-38h] BYREF\n\n  if ( a1->m_isPracticeMode != a2 )\n  {\n    a1->m_isPracticeMode = a2;\n    PlayLayer::toggleDebugDraw(a1);\n    UILayer::toggleCheckpointsMenu(a1->m_uiLayer, a2);\n    if ( a2 )\n    {\n      if ( !a1->m_practiceMusicSync )\n      {\n        v4 = qword_1406C2E88;\n        if ( !qword_1406C2E88 )\n        {\n          v12 = (FMODAudioEngine *)operator new(0x888u);\n          qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v12);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n          v4 = qword_1406C2E88;\n        }\n        if ( *(_QWORD *)(v4 + 552) )\n          FMOD::ChannelControl::stop(*(FMOD::ChannelControl **)(v4 + 552));\n        sub_14005E0D0((_QWORD *)(v4 + 1064));\n        sub_14005E0D0((_QWORD *)(v4 + 1128));\n        sub_14005E0D0((_QWORD *)(v4 + 1192));\n        v5 = qword_1406C2ED8;\n        if ( !qword_1406C2ED8 )\n        {\n          v16 = (FMODAudioEngine *)operator new(0x668u);\n          qword_1406C2ED8 = sub_14017AB00((__int64)v16);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n          v5 = qword_1406C2ED8;\n        }\n        if ( *(int *)(v5 + 1084) > 0 )\n        {\n          v6 = MusicDownloadManager::sharedState();\n          if ( !MusicDownloadManager::isSongDownloaded(v6, *(_DWORD *)(v5 + 1084)) )\n            *(_DWORD *)(v5 + 1084) = 0;\n        }\n        v7 = *(_DWORD *)(v5 + 1084);\n        if ( v7 <= 0 )\n        {\n          v13 = 0;\n          *(_QWORD *)&v13 = sub_14003AA10(0x20u);\n          v14 = 16;\n          v15 = 31;\n          strcpy((char *)v13, \"StayInsideMe.mp3\");\n        }\n        else\n        {\n          v8 = MusicDownloadManager::sharedState();\n          v9 = MusicDownloadManager::pathForSong((__int64)v8, v17, v7);\n          if ( v9[3] > 0xFu )\n            v9 = (_QWORD *)*v9;\n          v13 = 0;\n          v14 = 0;\n          v15 = 0;\n          v10 = -1;\n          do\n            ++v10;\n          while ( *((_BYTE *)v9 + v10) );\n          sub_14003A930(&v13, v9, v10);\n          sub_14003A830((__int64)v17);\n        }\n        v11 = (FMODAudioEngine *)qword_1406C2E88;\n        if ( !qword_1406C2E88 )\n        {\n          v16 = (FMODAudioEngine *)operator new(0x888u);\n          qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v16);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n          v11 = (FMODAudioEngine *)qword_1406C2E88;\n        }\n        FMODAudioEngine::playMusic(v11, (__int64)&v13, 1, 0.0);\n      }\n    }\n    else\n    {\n      PlayLayer::resetLevelFromStart(a1);\n    }\n    if ( a1->m_isPracticeMode )\n      cocos2d::CCNode::stopActionByTag(a1, 31);\n  }\n}", "assembly": "; \n; PlayLayer::togglePracticeMode from 0x1403b9e50 to 0x1403ba0d6 (646 bytes)\n; \n; 4 xrefs:\n; > PauseLayer::onPracticeMode @ 0x14037e214\n; > PauseLayer::onNormalMode @ 0x14037e2ed\n; > PlayLayer::fullReset @ 0x1403b8c72\n; > <???> @ 0x1406d70d0\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_10], rbx                                              ; +0x0, 0x1403b9e50\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1403b9e55\npush    rdi                                                            ; +0xa, 0x1403b9e5a\nsub     rsp, 90h                                                       ; +0xb, 0x1403b9e5b\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x1403b9e62\nxor     rax, rsp                                                       ; +0x19, 0x1403b9e69\nmov     [rsp+98h+var_18], rax                                          ; +0x1c, 0x1403b9e6c\nmovzx   edi, dl                                                        ; +0x24, 0x1403b9e74\nmov     rbx, rcx                                                       ; +0x27, 0x1403b9e77\nxor     esi, esi                                                       ; +0x2a, 0x1403b9e7a\ncmp     [rcx+31F0h], dl                                                ; +0x2c, 0x1403b9e7c\njz      loc_1403BA0B1                                                  ; +0x32, 0x1403b9e82\nmov     [rcx+31F0h], dl                                                ; +0x38, 0x1403b9e88\ncall    PlayLayer__toggleDebugDraw                                     ; +0x3e, 0x1403b9e8e\nmovzx   edx, dil                                                       ; +0x43, 0x1403b9e93\nmov     rcx, [rbx+3540h]                                               ; +0x47, 0x1403b9e97\ncall    UILayer__toggleCheckpointsMenu                                 ; +0x4e, 0x1403b9e9e\ntest    dil, dil                                                       ; +0x53, 0x1403b9ea3\njnz     short loc_1403B9EB5                                            ; +0x56, 0x1403b9ea6\nmov     rcx, rbx                                                       ; +0x58, 0x1403b9ea8\ncall    PlayLayer__resetLevelFromStart                                 ; +0x5b, 0x1403b9eab\njmp     loc_1403BA09A                                                  ; +0x60, 0x1403b9eb0\ncmp     [rbx+31F1h], sil                                               ; +0x65, 0x1403b9eb5\njnz     loc_1403BA09A                                                  ; +0x6c, 0x1403b9ebc\nmov     rdi, cs:qword_1406C2E88                                        ; +0x72, 0x1403b9ec2\ntest    rdi, rdi                                                       ; +0x79, 0x1403b9ec9\njnz     short loc_1403B9EFD                                            ; +0x7c, 0x1403b9ecc\nmov     ecx, 888h; Size                                                ; +0x7e, 0x1403b9ece\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x83, 0x1403b9ed3\nmov     [rsp+98h+var_68], rax                                          ; +0x88, 0x1403b9ed8\nmov     rcx, rax                                                       ; +0x8d, 0x1403b9edd\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x90, 0x1403b9ee0\nnop                                                                    ; +0x95, 0x1403b9ee5\nmov     cs:qword_1406C2E88, rax                                        ; +0x96, 0x1403b9ee6\nmov     rdx, [rax]                                                     ; +0x9d, 0x1403b9eed\nmov     rcx, rax                                                       ; +0xa0, 0x1403b9ef0\ncall    qword ptr [rdx+48h]                                            ; +0xa3, 0x1403b9ef3\nmov     rdi, cs:qword_1406C2E88                                        ; +0xa6, 0x1403b9ef6\ncmp     qword ptr [rdi+228h], 0                                        ; +0xad, 0x1403b9efd\njz      short loc_1403B9F14                                            ; +0xb5, 0x1403b9f05\nmov     rcx, [rdi+228h]                                                ; +0xb7, 0x1403b9f07\ncall    cs:?stop@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@XZ; FMOD::ChannelControl::stop(void) ; +0xbe, 0x1403b9f0e\nlea     rcx, [rdi+428h]                                                ; +0xc4, 0x1403b9f14\ncall    sub_14005E0D0                                                  ; +0xcb, 0x1403b9f1b\nlea     rcx, [rdi+468h]                                                ; +0xd0, 0x1403b9f20\ncall    sub_14005E0D0                                                  ; +0xd7, 0x1403b9f27\nlea     rcx, [rdi+4A8h]                                                ; +0xdc, 0x1403b9f2c\ncall    sub_14005E0D0                                                  ; +0xe3, 0x1403b9f33\nlea     rax, [rsp+98h+var_60]                                          ; +0xe8, 0x1403b9f38\nmov     [rsp+98h+var_68], rax                                          ; +0xed, 0x1403b9f3d\nmov     rdi, cs:qword_1406C2ED8                                        ; +0xf2, 0x1403b9f42\ntest    rdi, rdi                                                       ; +0xf9, 0x1403b9f49\njnz     short loc_1403B9F7D                                            ; +0xfc, 0x1403b9f4c\nmov     ecx, 668h; Size                                                ; +0xfe, 0x1403b9f4e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x103, 0x1403b9f53\nmov     [rsp+98h+var_40], rax                                          ; +0x108, 0x1403b9f58\nmov     rcx, rax                                                       ; +0x10d, 0x1403b9f5d\ncall    sub_14017AB00                                                  ; +0x110, 0x1403b9f60\nnop                                                                    ; +0x115, 0x1403b9f65\nmov     cs:qword_1406C2ED8, rax                                        ; +0x116, 0x1403b9f66\nmov     rdx, [rax]                                                     ; +0x11d, 0x1403b9f6d\nmov     rcx, rax                                                       ; +0x120, 0x1403b9f70\ncall    qword ptr [rdx+48h]                                            ; +0x123, 0x1403b9f73\nmov     rdi, cs:qword_1406C2ED8                                        ; +0x126, 0x1403b9f76\ncmp     dword ptr [rdi+43Ch], 0                                        ; +0x12d, 0x1403b9f7d\njle     short loc_1403B9FA3                                            ; +0x134, 0x1403b9f84\ncall    MusicDownloadManager__sharedState                              ; +0x136, 0x1403b9f86\nmov     rcx, rax                                                       ; +0x13b, 0x1403b9f8b\nmov     edx, [rdi+43Ch]                                                ; +0x13e, 0x1403b9f8e\ncall    MusicDownloadManager__isSongDownloaded                         ; +0x144, 0x1403b9f94\ntest    al, al                                                         ; +0x149, 0x1403b9f99\njnz     short loc_1403B9FA3                                            ; +0x14b, 0x1403b9f9b\nmov     [rdi+43Ch], esi                                                ; +0x14d, 0x1403b9f9d\nmov     edi, [rdi+43Ch]                                                ; +0x153, 0x1403b9fa3\ntest    edi, edi                                                       ; +0x159, 0x1403b9fa9\njle     short loc_1403BA00A                                            ; +0x15b, 0x1403b9fab\ncall    MusicDownloadManager__sharedState                              ; +0x15d, 0x1403b9fad\nmov     rcx, rax                                                       ; +0x162, 0x1403b9fb2\nmov     r8d, edi                                                       ; +0x165, 0x1403b9fb5\nlea     rdx, [rsp+98h+var_38]                                          ; +0x168, 0x1403b9fb8\ncall    MusicDownloadManager__pathForSong                              ; +0x16d, 0x1403b9fbd\nnop                                                                    ; +0x172, 0x1403b9fc2\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x173, 0x1403b9fc3\njbe     short loc_1403B9FCD                                            ; +0x178, 0x1403b9fc8\nmov     rax, [rax]                                                     ; +0x17a, 0x1403b9fca\nxorps   xmm0, xmm0                                                     ; +0x17d, 0x1403b9fcd\nmovups  [rsp+98h+var_60], xmm0                                         ; +0x180, 0x1403b9fd0\nmov     [rsp+98h+var_50], rsi                                          ; +0x185, 0x1403b9fd5\nmov     [rsp+98h+var_48], rsi                                          ; +0x18a, 0x1403b9fda\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x18f, 0x1403b9fdf\ninc     r8                                                             ; +0x196, 0x1403b9fe6\ncmp     byte ptr [rax+r8], 0                                           ; +0x199, 0x1403b9fe9\njnz     short loc_1403B9FE6                                            ; +0x19e, 0x1403b9fee\nmov     rdx, rax                                                       ; +0x1a0, 0x1403b9ff0\nlea     rcx, [rsp+98h+var_60]                                          ; +0x1a3, 0x1403b9ff3\ncall    sub_14003A930                                                  ; +0x1a8, 0x1403b9ff8\nnop                                                                    ; +0x1ad, 0x1403b9ffd\nlea     rcx, [rsp+98h+var_38]                                          ; +0x1ae, 0x1403b9ffe\ncall    sub_14003A830                                                  ; +0x1b3, 0x1403ba003\njmp     short loc_1403BA04F                                            ; +0x1b8, 0x1403ba008\nxorps   xmm0, xmm0                                                     ; +0x1ba, 0x1403ba00a\nmovups  [rsp+98h+var_60], xmm0                                         ; +0x1bd, 0x1403ba00d\nmov     [rsp+98h+var_50], rsi                                          ; +0x1c2, 0x1403ba012\nmov     [rsp+98h+var_48], 0Fh                                          ; +0x1c7, 0x1403ba017\nmov     ecx, 20h ; ' '                                                 ; +0x1d0, 0x1403ba020\ncall    sub_14003AA10                                                  ; +0x1d5, 0x1403ba025\nmov     qword ptr [rsp+98h+var_60], rax                                ; +0x1da, 0x1403ba02a\nmov     [rsp+98h+var_50], 10h                                          ; +0x1df, 0x1403ba02f\nmov     [rsp+98h+var_48], 1Fh                                          ; +0x1e8, 0x1403ba038\nmovups  xmm0, cs:xmmword_14055CE88                                     ; +0x1f1, 0x1403ba041\nmovups  xmmword ptr [rax], xmm0                                        ; +0x1f8, 0x1403ba048\nmov     byte ptr [rax+10h], 0                                          ; +0x1fb, 0x1403ba04b\nmov     rcx, cs:qword_1406C2E88                                        ; +0x1ff, 0x1403ba04f\ntest    rcx, rcx                                                       ; +0x206, 0x1403ba056\njnz     short loc_1403BA08A                                            ; +0x209, 0x1403ba059\nmov     ecx, 888h; Size                                                ; +0x20b, 0x1403ba05b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x210, 0x1403ba060\nmov     [rsp+98h+var_40], rax                                          ; +0x215, 0x1403ba065\nmov     rcx, rax                                                       ; +0x21a, 0x1403ba06a\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x21d, 0x1403ba06d\nnop                                                                    ; +0x222, 0x1403ba072\nmov     cs:qword_1406C2E88, rax                                        ; +0x223, 0x1403ba073\nmov     rdx, [rax]                                                     ; +0x22a, 0x1403ba07a\nmov     rcx, rax                                                       ; +0x22d, 0x1403ba07d\ncall    qword ptr [rdx+48h]                                            ; +0x230, 0x1403ba080\nmov     rcx, cs:qword_1406C2E88                                        ; +0x233, 0x1403ba083\nxorps   xmm3, xmm3                                                     ; +0x23a, 0x1403ba08a\nmov     r8b, 1                                                         ; +0x23d, 0x1403ba08d\nlea     rdx, [rsp+98h+var_60]                                          ; +0x240, 0x1403ba090\ncall    FMODAudioEngine__playMusic                                     ; +0x245, 0x1403ba095\ncmp     byte ptr [rbx+31F0h], 0                                        ; +0x24a, 0x1403ba09a\njz      short loc_1403BA0B1                                            ; +0x251, 0x1403ba0a1\nmov     edx, 1Fh                                                       ; +0x253, 0x1403ba0a3\nmov     rcx, rbx                                                       ; +0x258, 0x1403ba0a8\ncall    cs:?stopActionByTag@CCNode@cocos2d@@QEAAXH@Z; cocos2d::CCNode::stopActionByTag(int) ; +0x25b, 0x1403ba0ab\nmov     rcx, [rsp+98h+var_18]                                          ; +0x261, 0x1403ba0b1\nxor     rcx, rsp; StackCookie                                          ; +0x269, 0x1403ba0b9\ncall    __security_check_cookie                                        ; +0x26c, 0x1403ba0bc\nlea     r11, [rsp+98h+var_8]                                           ; +0x271, 0x1403ba0c1\nmov     rbx, [r11+20h]                                                 ; +0x279, 0x1403ba0c9\nmov     rsi, [r11+28h]                                                 ; +0x27d, 0x1403ba0cd\nmov     rsp, r11                                                       ; +0x281, 0x1403ba0d1\npop     rdi                                                            ; +0x284, 0x1403ba0d4\nretn                                                                   ; +0x285, 0x1403ba0d5", "xrefs": ["PauseLayer::onPracticeMode @ 0x14037e214", "PauseLayer::onNormalMode @ 0x14037e2ed", "PlayLayer::fullReset @ 0x1403b8c72", "<???> @ 0x1406d70d0"], "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"}