{"type": "func", "start": 5369526384, "end": 5369526917, "name": "SongSelectNode::onSongMode", "pseudocode": "// \n// SongSelectNode::onSongMode from 0x1400c7870 to 0x1400c7a85 (533 bytes)\n// \n// 4 xrefs:\n// > SongSelectNode::init @ 0x1400c769a\n// > SongSelectNode::onSongMode_1 @ 0x1400c785c\n// > SongSelectNode::customSongLayerClosed @ 0x1400c7db1\n// > <???> @ 0x1406c8214\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\nvoid SongSelectNode::onSongMode(SongSelectNode *a1, int a2)\n{\n  bool v4; // r14\n  int m_songID; // ebp\n  const char *v6; // rsi\n  const char *v7; // rdi\n  ButtonSprite *v8; // rax\n  ButtonSprite *v9; // rax\n  unsigned int i; // edi\n  struct cocos2d::CCObject *v11; // rax\n  unsigned int j; // edi\n  struct cocos2d::CCObject *v13; // rax\n  int m_selectedSongID; // ecx\n  SongInfoObject *v15; // rax\n  CustomSongWidget *m_songWidget; // rdi\n  cocos2d::CCObject *v17; // rsi\n  cocos2d::extension::CCScale9Sprite *m_bgSpr; // rcx\n  SongInfoObject *m_songInfoObject; // rax\n  cocos2d::CCObject *v20; // rcx\n\n  v4 = a2 == 2;\n  m_songID = 0;\n  if ( a1->m_isCustomSong != (a2 == 2) )\n  {\n    a1->m_isCustomSong = v4;\n    a1->m_selectedSongID = 0;\n    a1->m_songChanged = 1;\n    if ( a2 != 2 )\n      SongSelectNode::updateAudioLabel(a1);\n  }\n  v6 = \"GJ_button_04.png\";\n  v7 = \"GJ_button_01.png\";\n  if ( a2 == 2 )\n    v7 = \"GJ_button_04.png\";\n  v8 = (ButtonSprite *)a1->m_normalButton->getNormalImage(a1->m_normalButton);\n  ButtonSprite::updateBGImage(v8, v7);\n  if ( a2 == 2 )\n    v6 = \"GJ_button_01.png\";\n  v9 = (ButtonSprite *)a1->m_customButton->getNormalImage(a1->m_customButton);\n  ButtonSprite::updateBGImage(v9, v6);\n  for ( i = 0; i < cocos2d::CCArray::count(a1->m_normalSongObjects); ++i )\n  {\n    v11 = cocos2d::CCArray::objectAtIndex(a1->m_normalSongObjects, i);\n    ((void (__fastcall *)(struct cocos2d::CCObject *, bool))v11->__vftable[4].update)(v11, a2 != 2);\n  }\n  for ( j = 0; j < cocos2d::CCArray::count(a1->m_changeSongObjects); ++j )\n  {\n    v13 = cocos2d::CCArray::objectAtIndex(a1->m_changeSongObjects, j);\n    ((void (__fastcall *)(struct cocos2d::CCObject *, bool))v13->__vftable[4].update)(v13, v4);\n  }\n  if ( a1->m_isCustomSong )\n    m_selectedSongID = a1->m_selectedSongID;\n  else\n    m_selectedSongID = 0;\n  v15 = SongInfoObject::create_1(m_selectedSongID);\n  m_songWidget = a1->m_songWidget;\n  v17 = v15;\n  m_songWidget->m_errorLabel->setVisible(m_songWidget->m_errorLabel, 0);\n  m_bgSpr = m_songWidget->m_bgSpr;\n  if ( m_bgSpr )\n    m_bgSpr->setVisible(m_bgSpr, 0);\n  m_songInfoObject = m_songWidget->m_songInfoObject;\n  if ( m_songInfoObject != v17 )\n  {\n    if ( v17 )\n      cocos2d::CCObject::retain(v17);\n    v20 = m_songWidget->m_songInfoObject;\n    if ( v20 )\n      cocos2d::CCObject::release(v20);\n    m_songWidget->m_songInfoObject = (SongInfoObject *)v17;\n    m_songInfoObject = (SongInfoObject *)v17;\n  }\n  if ( m_songInfoObject )\n    m_songID = m_songInfoObject->m_songID;\n  m_songWidget->m_customSongID = m_songID;\n  CustomSongWidget::updateSongInfo(m_songWidget);\n  SongSelectNode::updateWidgetVisibility(a1);\n}", "assembly": "; \n; SongSelectNode::onSongMode from 0x1400c7870 to 0x1400c7a85 (533 bytes)\n; \n; 4 xrefs:\n; > SongSelectNode::init @ 0x1400c769a\n; > SongSelectNode::onSongMode_1 @ 0x1400c785c\n; > SongSelectNode::customSongLayerClosed @ 0x1400c7db1\n; > <???> @ 0x1406c8214\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_0], rbx                                               ; +0x0, 0x1400c7870\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1400c7875\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1400c787a\nmov     [rsp+arg_18], rdi                                              ; +0xf, 0x1400c787f\npush    r12                                                            ; +0x14, 0x1400c7884\npush    r14                                                            ; +0x16, 0x1400c7886\npush    r15                                                            ; +0x18, 0x1400c7888\nsub     rsp, 20h                                                       ; +0x1a, 0x1400c788a\ncmp     edx, 2                                                         ; +0x1e, 0x1400c788e\nmov     r15d, edx                                                      ; +0x21, 0x1400c7891\nmov     rbx, rcx                                                       ; +0x24, 0x1400c7894\nsetz    r14b                                                           ; +0x27, 0x1400c7897\nxor     ebp, ebp                                                       ; +0x2b, 0x1400c789b\ncmp     [rcx+15Ch], r14b                                               ; +0x2d, 0x1400c789d\njz      short loc_1400C78C4                                            ; +0x34, 0x1400c78a4\nmov     [rcx+15Ch], r14b                                               ; +0x36, 0x1400c78a6\nmov     [rcx+158h], ebp                                                ; +0x3d, 0x1400c78ad\nmov     byte ptr [rcx+15Dh], 1                                         ; +0x43, 0x1400c78b3\ncmp     edx, 2                                                         ; +0x4a, 0x1400c78ba\njz      short loc_1400C78C4                                            ; +0x4d, 0x1400c78bd\ncall    SongSelectNode__updateAudioLabel                               ; +0x4f, 0x1400c78bf\nmov     rcx, [rbx+180h]                                                ; +0x54, 0x1400c78c4\nlea     r12, aGjButton01Png; \"GJ_button_01.png\"                        ; +0x5b, 0x1400c78cb\ncmp     r15d, 2                                                        ; +0x62, 0x1400c78d2\nlea     rsi, aGjButton04Png; \"GJ_button_04.png\"                        ; +0x66, 0x1400c78d6\nmov     rdi, r12                                                       ; +0x6d, 0x1400c78dd\ncmovz   rdi, rsi                                                       ; +0x70, 0x1400c78e0\nmov     rax, [rcx]                                                     ; +0x74, 0x1400c78e4\ncall    qword ptr [rax+3A8h]                                           ; +0x77, 0x1400c78e7\nmov     rcx, rax                                                       ; +0x7d, 0x1400c78ed\nmov     rdx, rdi                                                       ; +0x80, 0x1400c78f0\ncall    ButtonSprite__updateBGImage                                    ; +0x83, 0x1400c78f3\nmov     rcx, [rbx+188h]                                                ; +0x88, 0x1400c78f8\ncmp     r15d, 2                                                        ; +0x8f, 0x1400c78ff\ncmovz   rsi, r12                                                       ; +0x93, 0x1400c7903\nmov     rax, [rcx]                                                     ; +0x97, 0x1400c7907\ncall    qword ptr [rax+3A8h]                                           ; +0x9a, 0x1400c790a\nmov     rcx, rax                                                       ; +0xa0, 0x1400c7910\nmov     rdx, rsi                                                       ; +0xa3, 0x1400c7913\ncall    ButtonSprite__updateBGImage                                    ; +0xa6, 0x1400c7916\nmov     rcx, [rbx+170h]                                                ; +0xab, 0x1400c791b\nmov     edi, ebp                                                       ; +0xb2, 0x1400c7922\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xb4, 0x1400c7924\ntest    eax, eax                                                       ; +0xba, 0x1400c792a\njz      short loc_1400C7973                                            ; +0xbc, 0x1400c792c\ncmp     r15d, 2                                                        ; +0xbe, 0x1400c792e\nsetnz   sil                                                            ; +0xc2, 0x1400c7932\nnop     word ptr [rax+rax+00000000h]                                   ; +0xc6, 0x1400c7936\nmov     rcx, [rbx+170h]                                                ; +0xd0, 0x1400c7940\nmov     edx, edi                                                       ; +0xd7, 0x1400c7947\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0xd9, 0x1400c7949\nmovzx   edx, sil                                                       ; +0xdf, 0x1400c794f\nmov     rcx, rax                                                       ; +0xe3, 0x1400c7953\nmov     r8, [rax]                                                      ; +0xe6, 0x1400c7956\ncall    qword ptr [r8+140h]                                            ; +0xe9, 0x1400c7959\nmov     rcx, [rbx+170h]                                                ; +0xf0, 0x1400c7960\ninc     edi                                                            ; +0xf7, 0x1400c7967\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xf9, 0x1400c7969\ncmp     edi, eax                                                       ; +0xff, 0x1400c796f\njb      short loc_1400C7940                                            ; +0x101, 0x1400c7971\nmov     rcx, [rbx+178h]                                                ; +0x103, 0x1400c7973\nmov     edi, ebp                                                       ; +0x10a, 0x1400c797a\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x10c, 0x1400c797c\ntest    eax, eax                                                       ; +0x112, 0x1400c7982\njz      short loc_1400C79C3                                            ; +0x114, 0x1400c7984\nnop     word ptr [rax+rax+00000000h]                                   ; +0x116, 0x1400c7986\nmov     rcx, [rbx+178h]                                                ; +0x120, 0x1400c7990\nmov     edx, edi                                                       ; +0x127, 0x1400c7997\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x129, 0x1400c7999\nmovzx   edx, r14b                                                      ; +0x12f, 0x1400c799f\nmov     rcx, rax                                                       ; +0x133, 0x1400c79a3\nmov     r8, [rax]                                                      ; +0x136, 0x1400c79a6\ncall    qword ptr [r8+140h]                                            ; +0x139, 0x1400c79a9\nmov     rcx, [rbx+178h]                                                ; +0x140, 0x1400c79b0\ninc     edi                                                            ; +0x147, 0x1400c79b7\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x149, 0x1400c79b9\ncmp     edi, eax                                                       ; +0x14f, 0x1400c79bf\njb      short loc_1400C7990                                            ; +0x151, 0x1400c79c1\ncmp     [rbx+15Ch], bpl                                                ; +0x153, 0x1400c79c3\njz      short loc_1400C79D4                                            ; +0x15a, 0x1400c79ca\nmov     ecx, [rbx+158h]                                                ; +0x15c, 0x1400c79cc\njmp     short loc_1400C79D6                                            ; +0x162, 0x1400c79d2\nmov     ecx, ebp                                                       ; +0x164, 0x1400c79d4\ncall    SongInfoObject__create_1                                       ; +0x166, 0x1400c79d6\nmov     rdi, [rbx+1A0h]                                                ; +0x16b, 0x1400c79db\nxor     edx, edx                                                       ; +0x172, 0x1400c79e2\nmov     rsi, rax                                                       ; +0x174, 0x1400c79e4\nmov     rcx, [rdi+178h]                                                ; +0x177, 0x1400c79e7\nmov     r8, [rcx]                                                      ; +0x17e, 0x1400c79ee\ncall    qword ptr [r8+140h]                                            ; +0x181, 0x1400c79f1\nmov     rcx, [rdi+1D8h]                                                ; +0x188, 0x1400c79f8\ntest    rcx, rcx                                                       ; +0x18f, 0x1400c79ff\njz      short loc_1400C7A10                                            ; +0x192, 0x1400c7a02\nmov     r8, [rcx]                                                      ; +0x194, 0x1400c7a04\nxor     edx, edx                                                       ; +0x197, 0x1400c7a07\ncall    qword ptr [r8+140h]                                            ; +0x199, 0x1400c7a09\nmov     rax, [rdi+150h]                                                ; +0x1a0, 0x1400c7a10\ncmp     rax, rsi                                                       ; +0x1a7, 0x1400c7a17\njz      short loc_1400C7A46                                            ; +0x1aa, 0x1400c7a1a\ntest    rsi, rsi                                                       ; +0x1ac, 0x1400c7a1c\njz      short loc_1400C7A2A                                            ; +0x1af, 0x1400c7a1f\nmov     rcx, rsi                                                       ; +0x1b1, 0x1400c7a21\ncall    cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x1b4, 0x1400c7a24\nmov     rcx, [rdi+150h]                                                ; +0x1ba, 0x1400c7a2a\ntest    rcx, rcx                                                       ; +0x1c1, 0x1400c7a31\njz      short loc_1400C7A3C                                            ; +0x1c4, 0x1400c7a34\ncall    cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x1c6, 0x1400c7a36\nmov     [rdi+150h], rsi                                                ; +0x1cc, 0x1400c7a3c\nmov     rax, rsi                                                       ; +0x1d3, 0x1400c7a43\ntest    rax, rax                                                       ; +0x1d6, 0x1400c7a46\njz      short loc_1400C7A51                                            ; +0x1d9, 0x1400c7a49\nmov     ebp, [rax+140h]                                                ; +0x1db, 0x1400c7a4b\nmov     rcx, rdi                                                       ; +0x1e1, 0x1400c7a51\nmov     [rdi+1F0h], ebp                                                ; +0x1e4, 0x1400c7a54\ncall    CustomSongWidget__updateSongInfo                               ; +0x1ea, 0x1400c7a5a\nmov     rcx, rbx                                                       ; +0x1ef, 0x1400c7a5f\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x1f2, 0x1400c7a62\nmov     rbp, [rsp+38h+arg_8]                                           ; +0x1f7, 0x1400c7a67\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x1fc, 0x1400c7a6c\nmov     rdi, [rsp+38h+arg_18]                                          ; +0x201, 0x1400c7a71\nadd     rsp, 20h                                                       ; +0x206, 0x1400c7a76\npop     r15                                                            ; +0x20a, 0x1400c7a7a\npop     r14                                                            ; +0x20c, 0x1400c7a7c\npop     r12                                                            ; +0x20e, 0x1400c7a7e\njmp     SongSelectNode__updateWidgetVisibility                         ; +0x210, 0x1400c7a80", "xrefs": ["SongSelectNode::init @ 0x1400c769a", "SongSelectNode::onSongMode_1 @ 0x1400c785c", "SongSelectNode::customSongLayerClosed @ 0x1400c7db1", "<???> @ 0x1406c8214"], "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"}