{"type": "func", "start": 5369516208, "end": 5369516897, "name": "SongOptionsLayer::onPlayback", "pseudocode": "// \n// SongOptionsLayer::onPlayback from 0x1400c50b0 to 0x1400c5361 (689 bytes)\n// \n// 2 xrefs:\n// > SongOptionsLayer::init @ 0x1400c4ef5\n// > <???> @ 0x1406c8124\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 SongOptionsLayer::onPlayback(SongOptionsLayer *a1, cocos2d::CCObject *a2)\n{\n  FMODAudioEngine *v3; // rcx\n  __int64 v4; // rbx\n  cocos2d::CCLabelProtocol *v5; // rcx\n  const char *v6; // rax\n  size_t v7; // r8\n  const char *v8; // rcx\n  float v9; // xmm6_4\n  char *v10; // rcx\n  std::string *v11; // rbx\n  FMODAudioEngine *v12; // rcx\n  cocos2d::CCNode *v13; // rbx\n  FMODAudioEngine *v14; // rcx\n  bool isMusicPlaying_1; // al\n  cocos2d::CCNode_vtbl *v16; // rdi\n  cocos2d::CCSpriteFrameCache *v17; // rax\n  const char *v18; // rdx\n  struct cocos2d::CCSpriteFrame *v19; // rax\n  FMODAudioEngine *v20; // [rsp+20h] [rbp-58h]\n  FMODAudioEngine *v21; // [rsp+20h] [rbp-58h]\n  FMODAudioEngine *v22; // [rsp+28h] [rbp-50h]\n  FMODAudioEngine *v23; // [rsp+28h] [rbp-50h]\n  char *String[2]; // [rsp+30h] [rbp-48h] BYREF\n  __int64 v25; // [rsp+40h] [rbp-38h]\n  unsigned __int64 v26; // [rsp+48h] [rbp-30h]\n\n  v3 = (FMODAudioEngine *)qword_1406C2E88;\n  if ( !qword_1406C2E88 )\n  {\n    v20 = (FMODAudioEngine *)operator new(0x888u);\n    qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v20);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n    v3 = (FMODAudioEngine *)qword_1406C2E88;\n  }\n  if ( FMODAudioEngine::isMusicPlaying_1(v3, 0) )\n  {\n    v4 = qword_1406C2E88;\n    if ( !qword_1406C2E88 )\n    {\n      v21 = (FMODAudioEngine *)operator new(0x888u);\n      qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v21);\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  }\n  else\n  {\n    v5 = &a1->m_offsetInput->m_textField->cocos2d::CCLabelProtocol;\n    v6 = v5->getString(v5);\n    *(_OWORD *)String = 0;\n    v25 = 0;\n    v26 = 0;\n    v7 = -1;\n    do\n      ++v7;\n    while ( v6[v7] );\n    sub_14003A930(String, v6, v7);\n    v8 = (const char *)String;\n    if ( v26 > 0xF )\n      v8 = String[0];\n    v9 = atof(v8);\n    if ( v26 > 0xF )\n    {\n      v10 = String[0];\n      if ( v26 + 1 >= 0x1000 )\n      {\n        v10 = *((char **)String[0] - 1);\n        if ( (unsigned __int64)(String[0] - v10 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v10);\n    }\n    v11 = a1->m_delegate->getSongFileName(a1->m_delegate, String);\n    v12 = (FMODAudioEngine *)qword_1406C2E88;\n    if ( !qword_1406C2E88 )\n    {\n      v22 = (FMODAudioEngine *)operator new(0x888u);\n      qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v22);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n      v12 = (FMODAudioEngine *)qword_1406C2E88;\n    }\n    FMODAudioEngine::loadAndPlayMusic(v12, (__int64)v11, (int)(float)(v9 * 1000.0));\n  }\n  v13 = a1->m_playbackButton->getNormalImage(a1->m_playbackButton);\n  v14 = (FMODAudioEngine *)qword_1406C2E88;\n  if ( !qword_1406C2E88 )\n  {\n    v23 = (FMODAudioEngine *)operator new(0x888u);\n    qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v23);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n    v14 = (FMODAudioEngine *)qword_1406C2E88;\n  }\n  isMusicPlaying_1 = FMODAudioEngine::isMusicPlaying_1(v14, 0);\n  v16 = v13->__vftable;\n  if ( isMusicPlaying_1 )\n  {\n    v17 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();\n    v18 = \"GJ_stopMusicBtn_001.png\";\n  }\n  else\n  {\n    v17 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();\n    v18 = \"GJ_playMusicBtn_001.png\";\n  }\n  v19 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v17, v18);\n  ((void (__fastcall *)(cocos2d::CCNode *, struct cocos2d::CCSpriteFrame *))v16[1].setScaleX)(v13, v19);\n}", "assembly": "; \n; SongOptionsLayer::onPlayback from 0x1400c50b0 to 0x1400c5361 (689 bytes)\n; \n; 2 xrefs:\n; > SongOptionsLayer::init @ 0x1400c4ef5\n; > <???> @ 0x1406c8124\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_8], rbx                                               ; +0x0, 0x1400c50b0\npush    rdi                                                            ; +0x5, 0x1400c50b5\nsub     rsp, 70h                                                       ; +0x6, 0x1400c50b6\nmovaps  [rsp+78h+var_18], xmm6                                         ; +0xa, 0x1400c50ba\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x1400c50bf\nxor     rax, rsp                                                       ; +0x16, 0x1400c50c6\nmov     [rsp+78h+var_28], rax                                          ; +0x19, 0x1400c50c9\nmov     rdi, rcx                                                       ; +0x1e, 0x1400c50ce\nxor     ebx, ebx                                                       ; +0x21, 0x1400c50d1\nmov     rcx, cs:qword_1406C2E88                                        ; +0x23, 0x1400c50d3\ntest    rcx, rcx                                                       ; +0x2a, 0x1400c50da\njnz     short loc_1400C510E                                            ; +0x2d, 0x1400c50dd\nmov     ecx, 888h; Size                                                ; +0x2f, 0x1400c50df\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x34, 0x1400c50e4\nmov     [rsp+78h+var_58], rax                                          ; +0x39, 0x1400c50e9\nmov     rcx, rax                                                       ; +0x3e, 0x1400c50ee\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x41, 0x1400c50f1\nnop                                                                    ; +0x46, 0x1400c50f6\nmov     cs:qword_1406C2E88, rax                                        ; +0x47, 0x1400c50f7\nmov     rdx, [rax]                                                     ; +0x4e, 0x1400c50fe\nmov     rcx, rax                                                       ; +0x51, 0x1400c5101\ncall    qword ptr [rdx+48h]                                            ; +0x54, 0x1400c5104\nmov     rcx, cs:qword_1406C2E88                                        ; +0x57, 0x1400c5107\nxor     edx, edx                                                       ; +0x5e, 0x1400c510e\ncall    FMODAudioEngine__isMusicPlaying_1                              ; +0x60, 0x1400c5110\ntest    al, al                                                         ; +0x65, 0x1400c5115\njz      short loc_1400C5194                                            ; +0x67, 0x1400c5117\nmov     rbx, cs:qword_1406C2E88                                        ; +0x69, 0x1400c5119\ntest    rbx, rbx                                                       ; +0x70, 0x1400c5120\njnz     short loc_1400C5154                                            ; +0x73, 0x1400c5123\nmov     ecx, 888h; Size                                                ; +0x75, 0x1400c5125\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x7a, 0x1400c512a\nmov     [rsp+78h+var_58], rax                                          ; +0x7f, 0x1400c512f\nmov     rcx, rax                                                       ; +0x84, 0x1400c5134\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x87, 0x1400c5137\nnop                                                                    ; +0x8c, 0x1400c513c\nmov     cs:qword_1406C2E88, rax                                        ; +0x8d, 0x1400c513d\nmov     rdx, [rax]                                                     ; +0x94, 0x1400c5144\nmov     rcx, rax                                                       ; +0x97, 0x1400c5147\ncall    qword ptr [rdx+48h]                                            ; +0x9a, 0x1400c514a\nmov     rbx, cs:qword_1406C2E88                                        ; +0x9d, 0x1400c514d\ncmp     qword ptr [rbx+228h], 0                                        ; +0xa4, 0x1400c5154\njz      short loc_1400C516B                                            ; +0xac, 0x1400c515c\nmov     rcx, [rbx+228h]                                                ; +0xae, 0x1400c515e\ncall    cs:?stop@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@XZ; FMOD::ChannelControl::stop(void) ; +0xb5, 0x1400c5165\nlea     rcx, [rbx+428h]                                                ; +0xbb, 0x1400c516b\ncall    sub_14005E0D0                                                  ; +0xc2, 0x1400c5172\nlea     rcx, [rbx+468h]                                                ; +0xc7, 0x1400c5177\ncall    sub_14005E0D0                                                  ; +0xce, 0x1400c517e\nlea     rcx, [rbx+4A8h]                                                ; +0xd3, 0x1400c5183\ncall    sub_14005E0D0                                                  ; +0xda, 0x1400c518a\njmp     loc_1400C52B4                                                  ; +0xdf, 0x1400c518f\nmov     rax, [rdi+280h]                                                ; +0xe4, 0x1400c5194\nmov     rcx, [rax+228h]                                                ; +0xeb, 0x1400c519b\nadd     rcx, 258h                                                      ; +0xf2, 0x1400c51a2\nmov     rax, [rcx]                                                     ; +0xf9, 0x1400c51a9\ncall    qword ptr [rax+8]                                              ; +0xfc, 0x1400c51ac\nxorps   xmm0, xmm0                                                     ; +0xff, 0x1400c51af\nmovups  xmmword ptr [rsp+78h+String], xmm0                             ; +0x102, 0x1400c51b2\nmov     [rsp+78h+var_38], rbx                                          ; +0x107, 0x1400c51b7\nmov     [rsp+78h+var_30], rbx                                          ; +0x10c, 0x1400c51bc\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x111, 0x1400c51c1\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x118, 0x1400c51c8\ninc     r8                                                             ; +0x120, 0x1400c51d0\ncmp     byte ptr [rax+r8], 0                                           ; +0x123, 0x1400c51d3\njnz     short loc_1400C51D0                                            ; +0x128, 0x1400c51d8\nmov     rdx, rax                                                       ; +0x12a, 0x1400c51da\nlea     rcx, [rsp+78h+String]                                          ; +0x12d, 0x1400c51dd\ncall    sub_14003A930                                                  ; +0x132, 0x1400c51e2\nlea     rcx, [rsp+78h+String]                                          ; +0x137, 0x1400c51e7\ncmp     [rsp+78h+var_30], 0Fh                                          ; +0x13c, 0x1400c51ec\ncmova   rcx, [rsp+78h+String]; String                                  ; +0x142, 0x1400c51f2\ncall    cs:atof                                                        ; +0x148, 0x1400c51f8\nxorps   xmm6, xmm6                                                     ; +0x14e, 0x1400c51fe\ncvtsd2ss xmm6, xmm0                                                    ; +0x151, 0x1400c5201\nmov     rdx, [rsp+78h+var_30]                                          ; +0x155, 0x1400c5205\ncmp     rdx, 0Fh                                                       ; +0x15a, 0x1400c520a\njbe     short loc_1400C5245                                            ; +0x15e, 0x1400c520e\ninc     rdx                                                            ; +0x160, 0x1400c5210\nmov     rcx, [rsp+78h+String]; Block                                   ; +0x163, 0x1400c5213\nmov     rax, rcx                                                       ; +0x168, 0x1400c5218\ncmp     rdx, 1000h                                                     ; +0x16b, 0x1400c521b\njb      short loc_1400C5240                                            ; +0x172, 0x1400c5222\nadd     rdx, 27h ; '''                                                 ; +0x174, 0x1400c5224\nmov     rcx, [rcx-8]                                                   ; +0x178, 0x1400c5228\nsub     rax, rcx                                                       ; +0x17c, 0x1400c522c\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x17f, 0x1400c522f\ncmp     rax, 1Fh                                                       ; +0x183, 0x1400c5233\njbe     short loc_1400C5240                                            ; +0x187, 0x1400c5237\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x189, 0x1400c5239\nalign 20h                                                              ; +0x18f, 0x1400c523f\ncall    j_j_free                                                       ; +0x190, 0x1400c5240\nlea     rax, [rsp+78h+String]                                          ; +0x195, 0x1400c5245\nmov     [rsp+78h+var_58], rax                                          ; +0x19a, 0x1400c524a\nmov     rcx, [rdi+278h]                                                ; +0x19f, 0x1400c524f\nmov     rax, [rcx]                                                     ; +0x1a6, 0x1400c5256\nlea     rdx, [rsp+78h+String]                                          ; +0x1a9, 0x1400c5259\ncall    qword ptr [rax+10h]                                            ; +0x1ae, 0x1400c525e\nmov     rbx, rax                                                       ; +0x1b1, 0x1400c5261\nmov     rcx, cs:qword_1406C2E88                                        ; +0x1b4, 0x1400c5264\ntest    rcx, rcx                                                       ; +0x1bb, 0x1400c526b\njnz     short loc_1400C529F                                            ; +0x1be, 0x1400c526e\nmov     ecx, 888h; Size                                                ; +0x1c0, 0x1400c5270\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1c5, 0x1400c5275\nmov     [rsp+78h+var_50], rax                                          ; +0x1ca, 0x1400c527a\nmov     rcx, rax                                                       ; +0x1cf, 0x1400c527f\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x1d2, 0x1400c5282\nnop                                                                    ; +0x1d7, 0x1400c5287\nmov     cs:qword_1406C2E88, rax                                        ; +0x1d8, 0x1400c5288\nmov     rdx, [rax]                                                     ; +0x1df, 0x1400c528f\nmov     rcx, rax                                                       ; +0x1e2, 0x1400c5292\ncall    qword ptr [rdx+48h]                                            ; +0x1e5, 0x1400c5295\nmov     rcx, cs:qword_1406C2E88                                        ; +0x1e8, 0x1400c5298\nmulss   xmm6, cs:dword_14062350C                                       ; +0x1ef, 0x1400c529f\ncvttss2si r8, xmm6                                                     ; +0x1f7, 0x1400c52a7\nmov     rdx, rbx                                                       ; +0x1fc, 0x1400c52ac\ncall    FMODAudioEngine__loadAndPlayMusic                              ; +0x1ff, 0x1400c52af\nmov     rcx, [rdi+288h]                                                ; +0x204, 0x1400c52b4\nmov     rax, [rcx]                                                     ; +0x20b, 0x1400c52bb\ncall    qword ptr [rax+3A8h]                                           ; +0x20e, 0x1400c52be\nmov     rbx, rax                                                       ; +0x214, 0x1400c52c4\nmov     rcx, cs:qword_1406C2E88                                        ; +0x217, 0x1400c52c7\ntest    rcx, rcx                                                       ; +0x21e, 0x1400c52ce\njnz     short loc_1400C5302                                            ; +0x221, 0x1400c52d1\nmov     ecx, 888h; Size                                                ; +0x223, 0x1400c52d3\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x228, 0x1400c52d8\nmov     [rsp+78h+var_50], rax                                          ; +0x22d, 0x1400c52dd\nmov     rcx, rax                                                       ; +0x232, 0x1400c52e2\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x235, 0x1400c52e5\nnop                                                                    ; +0x23a, 0x1400c52ea\nmov     cs:qword_1406C2E88, rax                                        ; +0x23b, 0x1400c52eb\nmov     rdx, [rax]                                                     ; +0x242, 0x1400c52f2\nmov     rcx, rax                                                       ; +0x245, 0x1400c52f5\ncall    qword ptr [rdx+48h]                                            ; +0x248, 0x1400c52f8\nmov     rcx, cs:qword_1406C2E88                                        ; +0x24b, 0x1400c52fb\nxor     edx, edx                                                       ; +0x252, 0x1400c5302\ncall    FMODAudioEngine__isMusicPlaying_1                              ; +0x254, 0x1400c5304\nmov     rdi, [rbx]                                                     ; +0x259, 0x1400c5309\ntest    al, al                                                         ; +0x25c, 0x1400c530c\njz      short loc_1400C531F                                            ; +0x25e, 0x1400c530e\ncall    cs:?sharedSpriteFrameCache@CCSpriteFrameCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(void) ; +0x260, 0x1400c5310\nlea     rdx, aGjStopmusicbtn; \"GJ_stopMusicBtn_001.png\"                ; +0x266, 0x1400c5316\njmp     short loc_1400C532C                                            ; +0x26d, 0x1400c531d\ncall    cs:?sharedSpriteFrameCache@CCSpriteFrameCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(void) ; +0x26f, 0x1400c531f\nlea     rdx, aGjPlaymusicbtn; \"GJ_playMusicBtn_001.png\"                ; +0x275, 0x1400c5325\nmov     rcx, rax                                                       ; +0x27c, 0x1400c532c\ncall    cs:?spriteFrameByName@CCSpriteFrameCache@cocos2d@@QEAAPEAVCCSpriteFrame@2@PEBD@Z; cocos2d::CCSpriteFrameCache::spriteFrameByName(char const *) ; +0x27f, 0x1400c532f\nmov     rdx, rax                                                       ; +0x285, 0x1400c5335\nmov     rcx, rbx                                                       ; +0x288, 0x1400c5338\ncall    qword ptr [rdi+3E0h]                                           ; +0x28b, 0x1400c533b\nmov     rcx, [rsp+78h+var_28]                                          ; +0x291, 0x1400c5341\nxor     rcx, rsp; StackCookie                                          ; +0x296, 0x1400c5346\ncall    __security_check_cookie                                        ; +0x299, 0x1400c5349\nmov     rbx, [rsp+78h+arg_8]                                           ; +0x29e, 0x1400c534e\nmovaps  xmm6, [rsp+78h+var_18]                                         ; +0x2a6, 0x1400c5356\nadd     rsp, 70h                                                       ; +0x2ab, 0x1400c535b\npop     rdi                                                            ; +0x2af, 0x1400c535f\nretn                                                                   ; +0x2b0, 0x1400c5360", "xrefs": ["SongOptionsLayer::init @ 0x1400c4ef5", "<???> @ 0x1406c8124"], "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"}