{"type": "func", "start": 4297153136, "end": 4297153468, "name": "CustomSongLayer::onSearch", "pseudocode": "// \n// CustomSongLayer::onSearch from 0x100215a70 to 0x100215bbc (332 bytes)\n// \n// 1 xrefs:\n// > CustomSongLayer::init @ 0x100215726\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 __fastcall CustomSongLayer::onSearch(CustomSongLayer *a1, cocos2d::CCObject *a2)\n{\n  GameManager *v3; // rax\n  FMODAudioEngine *v4; // rax\n  double v5; // xmm0_8\n  const char *v6; // rdi\n  GameManager *v7; // rax\n  __int64 v8; // rbx\n  int v9; // eax\n  CustomSongWidget *m_songWidget; // r14\n  SongInfoObject *v11; // rax\n  char v12[8]; // [rsp+8h] [rbp-28h] BYREF\n  __int64 v13; // [rsp+10h] [rbp-20h]\n  void *__p; // [rsp+18h] [rbp-18h]\n\n  v3 = GameManager::sharedState();\n  if ( GameManager::getGameVariable(v3, \"0051\") )\n  {\n    v4 = FMODAudioEngine::sharedEngine();\n    FMODAudioEngine::stopAllMusic(v4, 1);\n    v5 = ((double (__fastcall *)(CCTextInputNode *, _QWORD))a1->m_songIDInput->onClickTrackNode)(a1->m_songIDInput, 0);\n    CCTextInputNode::getString(v12, (__int64)a1->m_songIDInput, v5);\n    if ( (v12[0] & 1) != 0 )\n      v6 = (const char *)__p;\n    else\n      v6 = &v12[1];\n    v9 = atoi(v6);\n    m_songWidget = a1->m_songWidget;\n    v11 = SongInfoObject::create_1(v9);\n    CustomSongWidget::updateSongObject(m_songWidget, v11);\n    CustomSongWidget::getSongInfoIfUnloaded(a1->m_songWidget);\n    if ( (v12[0] & 1) != 0 )\n      operator delete(__p);\n  }\n  else\n  {\n    v7 = GameManager::sharedState();\n    GameManager::setGameVariable(v7, \"0051\", 1);\n    __p = operator new(0x118u);\n    *(_QWORD *)v12 = 281;\n    v13 = 273;\n    strcpy(\n      (char *)__p,\n      \"There are thousands of great custom songs for you to choose from Newgrounds. Please do not upload music you did no\"\n      \"t create. You are only allowed to use songs from artists that have been scouted on Newgrounds. For more informatio\"\n      \"n, please check the <cy>Audio Guidelines</c>.\");\n    v8 = FLAlertLayer::create_1(0, \"Newgrounds Info\", v12, \"OK\", 0, 380.0);\n    if ( (v12[0] & 1) != 0 )\n      operator delete(__p);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 1288LL))(v8);\n  }\n}", "assembly": "; \n; CustomSongLayer::onSearch from 0x100215a70 to 0x100215bbc (332 bytes)\n; \n; 1 xrefs:\n; > CustomSongLayer::init @ 0x100215726\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    rbp                                                            ; +0x0, 0x100215a70\nmov     rbp, rsp                                                       ; +0x1, 0x100215a71\npush    r14                                                            ; +0x4, 0x100215a74\npush    rbx                                                            ; +0x6, 0x100215a76\nsub     rsp, 20h                                                       ; +0x7, 0x100215a77\nmov     rbx, rdi                                                       ; +0xb, 0x100215a7b\ncall    GameManager__sharedState                                       ; +0xe, 0x100215a7e\nlea     rsi, a0051; \"0051\"                                             ; +0x13, 0x100215a83\nmov     rdi, rax                                                       ; +0x1a, 0x100215a8a\ncall    GameManager__getGameVariable                                   ; +0x1d, 0x100215a8d\ntest    al, al                                                         ; +0x22, 0x100215a92\njz      short loc_100215ADD                                            ; +0x24, 0x100215a94\ncall    FMODAudioEngine__sharedEngine                                  ; +0x26, 0x100215a96\nmov     rdi, rax                                                       ; +0x2b, 0x100215a9b\nmov     esi, 1                                                         ; +0x2e, 0x100215a9e\ncall    FMODAudioEngine__stopAllMusic                                  ; +0x33, 0x100215aa3\nmov     rdi, [rbx+298h]                                                ; +0x38, 0x100215aa8\nmov     rax, [rdi]                                                     ; +0x3f, 0x100215aaf\nxor     esi, esi                                                       ; +0x42, 0x100215ab2\ncall    qword ptr [rax+478h]                                           ; +0x44, 0x100215ab4\nmov     rsi, [rbx+298h]                                                ; +0x4a, 0x100215aba\nlea     rdi, [rbp+var_28]                                              ; +0x51, 0x100215ac1\ncall    CCTextInputNode__getString                                     ; +0x55, 0x100215ac5\ntest    [rbp+var_28], 1                                                ; +0x5a, 0x100215aca\njz      loc_100215B76                                                  ; +0x5e, 0x100215ace\nmov     rdi, [rbp+__p]                                                 ; +0x64, 0x100215ad4\njmp     loc_100215B7A                                                  ; +0x68, 0x100215ad8\ncall    GameManager__sharedState                                       ; +0x6d, 0x100215add\nlea     rsi, a0051; \"0051\"                                             ; +0x72, 0x100215ae2\nmov     rdi, rax                                                       ; +0x79, 0x100215ae9\nmov     edx, 1                                                         ; +0x7c, 0x100215aec\ncall    GameManager__setGameVariable                                   ; +0x81, 0x100215af1\nmov     edi, 118h; __sz                                                ; +0x86, 0x100215af6\ncall    __Znwm; operator new(ulong)                                    ; +0x8b, 0x100215afb\nmov     rbx, rax                                                       ; +0x90, 0x100215b00\nmov     [rbp+__p], rax                                                 ; +0x93, 0x100215b03\nmov     qword ptr [rbp+var_28], 119h                                   ; +0x97, 0x100215b07\nmov     [rbp+var_20], 111h                                             ; +0x9f, 0x100215b0f\nlea     rsi, aThereAreThousa; \"There are thousands of great custom son\"... ; +0xa7, 0x100215b17\nmov     edx, 111h; __n                                                 ; +0xae, 0x100215b1e\nmov     rdi, rax; __dst                                                ; +0xb3, 0x100215b23\ncall    _memcpy                                                        ; +0xb6, 0x100215b26\nmov     byte ptr [rbx+111h], 0                                         ; +0xbb, 0x100215b2b\nlea     rsi, aNewgroundsInfo; \"Newgrounds Info\"                        ; +0xc2, 0x100215b32\nlea     rcx, aOk; \"OK\"                                                 ; +0xc9, 0x100215b39\nlea     rdx, [rbp+var_28]                                              ; +0xd0, 0x100215b40\nmovss   xmm0, cs:dword_1008152BC                                       ; +0xd4, 0x100215b44\nxor     edi, edi                                                       ; +0xdc, 0x100215b4c\nxor     r8d, r8d                                                       ; +0xde, 0x100215b4e\ncall    FLAlertLayer__create_1                                         ; +0xe1, 0x100215b51\nmov     rbx, rax                                                       ; +0xe6, 0x100215b56\ntest    [rbp+var_28], 1                                                ; +0xe9, 0x100215b59\njz      short loc_100215B68                                            ; +0xed, 0x100215b5d\nmov     rdi, [rbp+__p]; __p                                            ; +0xef, 0x100215b5f\ncall    __ZdlPv; operator delete(void *)                               ; +0xf3, 0x100215b63\nmov     rax, [rbx]                                                     ; +0xf8, 0x100215b68\nmov     rdi, rbx                                                       ; +0xfb, 0x100215b6b\ncall    qword ptr [rax+508h]                                           ; +0xfe, 0x100215b6e\njmp     short loc_100215BB3                                            ; +0x104, 0x100215b74\nlea     rdi, [rbp+var_28+1]; char *                                    ; +0x106, 0x100215b76\ncall    _atoi                                                          ; +0x10a, 0x100215b7a\nmov     r14, [rbx+2A0h]                                                ; +0x10f, 0x100215b7f\nmov     edi, eax                                                       ; +0x116, 0x100215b86\ncall    SongInfoObject__create_1                                       ; +0x118, 0x100215b88\nmov     rdi, r14                                                       ; +0x11d, 0x100215b8d\nmov     rsi, rax                                                       ; +0x120, 0x100215b90\ncall    CustomSongWidget__updateSongObject                             ; +0x123, 0x100215b93\nmov     rdi, [rbx+2A0h]                                                ; +0x128, 0x100215b98\ncall    CustomSongWidget__getSongInfoIfUnloaded                        ; +0x12f, 0x100215b9f\ntest    [rbp+var_28], 1                                                ; +0x134, 0x100215ba4\njz      short loc_100215BB3                                            ; +0x138, 0x100215ba8\nmov     rdi, [rbp+__p]; __p                                            ; +0x13a, 0x100215baa\ncall    __ZdlPv; operator delete(void *)                               ; +0x13e, 0x100215bae\nadd     rsp, 20h                                                       ; +0x143, 0x100215bb3\npop     rbx                                                            ; +0x147, 0x100215bb7\npop     r14                                                            ; +0x148, 0x100215bb8\npop     rbp                                                            ; +0x14a, 0x100215bba\nretn                                                                   ; +0x14b, 0x100215bbb", "xrefs": ["CustomSongLayer::init @ 0x100215726"], "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"}