{"type": "func", "start": 4297035856, "end": 4297036188, "name": "CustomSongLayer::onSearch", "pseudocode": "// \n// CustomSongLayer::onSearch from 0x1001f9050 to 0x1001f919c (332 bytes)\n// \n// 1 xrefs:\n// > CustomSongLayer::init @ 0x1001f8cf6\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:26:49 +0000\n// \n\nvoid __fastcall CustomSongLayer::onSearch(__int64 a1, __int64 a2, __int64 a3)\n{\n  double v4; // xmm0_8\n  __int64 v5; // rax\n  __int64 v6; // rdi\n  __int64 v7; // rdx\n  __int64 v8; // rax\n  const char *v9; // rdi\n  __int64 v10; // rax\n  __int64 v11; // rbx\n  unsigned int v12; // eax\n  __int64 v13; // r14\n  __int64 v14; // rax\n  char v15[8]; // [rsp+8h] [rbp-28h] BYREF\n  __int64 v16; // [rsp+10h] [rbp-20h]\n  void *__p; // [rsp+18h] [rbp-18h]\n\n  *(_QWORD *)&v4 = GameManager::sharedState(a1, a2, a3).u64[0];\n  v6 = v5;\n  if ( (unsigned __int8)GameManager::getGameVariable(v5, \"0051\") )\n  {\n    v8 = FMODAudioEngine::sharedEngine(v4);\n    FMODAudioEngine::stopAllMusic(v8, 1);\n    (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 688) + 1160LL))(*(_QWORD *)(a1 + 688), 0);\n    CCTextInputNode::getString(v15, *(_QWORD *)(a1 + 688));\n    if ( (v15[0] & 1) != 0 )\n      v9 = (const char *)__p;\n    else\n      v9 = &v15[1];\n    v12 = atoi(v9);\n    v13 = *(_QWORD *)(a1 + 696);\n    v14 = SongInfoObject::create_1(v12);\n    CustomSongWidget::updateSongObject(v13, v14);\n    CustomSongWidget::getSongInfoIfUnloaded(*(_QWORD *)(a1 + 696));\n    if ( (v15[0] & 1) != 0 )\n      operator delete(__p);\n  }\n  else\n  {\n    GameManager::sharedState(v6, \"0051\", v7);\n    GameManager::setGameVariable(v10, \"0051\", 1);\n    __p = operator new(0x118u);\n    *(_QWORD *)v15 = 281;\n    v16 = 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    v11 = FLAlertLayer::create_1(0, \"Newgrounds Info\", v15, \"OK\", 0, 380.0);\n    if ( (v15[0] & 1) != 0 )\n      operator delete(__p);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)v11 + 1312LL))(v11);\n  }\n}", "assembly": "; \n; CustomSongLayer::onSearch from 0x1001f9050 to 0x1001f919c (332 bytes)\n; \n; 1 xrefs:\n; > CustomSongLayer::init @ 0x1001f8cf6\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:26:49 +0000\n; \npush    rbp                                                            ; +0x0, 0x1001f9050\nmov     rbp, rsp                                                       ; +0x1, 0x1001f9051\npush    r14                                                            ; +0x4, 0x1001f9054\npush    rbx                                                            ; +0x6, 0x1001f9056\nsub     rsp, 20h                                                       ; +0x7, 0x1001f9057\nmov     rbx, rdi                                                       ; +0xb, 0x1001f905b\ncall    GameManager__sharedState                                       ; +0xe, 0x1001f905e\nlea     rsi, a0051; \"0051\"                                             ; +0x13, 0x1001f9063\nmov     rdi, rax                                                       ; +0x1a, 0x1001f906a\ncall    GameManager__getGameVariable                                   ; +0x1d, 0x1001f906d\ntest    al, al                                                         ; +0x22, 0x1001f9072\njz      short loc_1001F90BD                                            ; +0x24, 0x1001f9074\ncall    FMODAudioEngine__sharedEngine                                  ; +0x26, 0x1001f9076\nmov     rdi, rax                                                       ; +0x2b, 0x1001f907b\nmov     esi, 1                                                         ; +0x2e, 0x1001f907e\ncall    FMODAudioEngine__stopAllMusic                                  ; +0x33, 0x1001f9083\nmov     rdi, [rbx+2B0h]                                                ; +0x38, 0x1001f9088\nmov     rax, [rdi]                                                     ; +0x3f, 0x1001f908f\nxor     esi, esi                                                       ; +0x42, 0x1001f9092\ncall    qword ptr [rax+488h]                                           ; +0x44, 0x1001f9094\nmov     rsi, [rbx+2B0h]                                                ; +0x4a, 0x1001f909a\nlea     rdi, [rbp+var_28]                                              ; +0x51, 0x1001f90a1\ncall    CCTextInputNode__getString                                     ; +0x55, 0x1001f90a5\ntest    [rbp+var_28], 1                                                ; +0x5a, 0x1001f90aa\njz      loc_1001F9156                                                  ; +0x5e, 0x1001f90ae\nmov     rdi, [rbp+__p]                                                 ; +0x64, 0x1001f90b4\njmp     loc_1001F915A                                                  ; +0x68, 0x1001f90b8\ncall    GameManager__sharedState                                       ; +0x6d, 0x1001f90bd\nlea     rsi, a0051; \"0051\"                                             ; +0x72, 0x1001f90c2\nmov     rdi, rax                                                       ; +0x79, 0x1001f90c9\nmov     edx, 1                                                         ; +0x7c, 0x1001f90cc\ncall    GameManager__setGameVariable                                   ; +0x81, 0x1001f90d1\nmov     edi, 118h; __sz                                                ; +0x86, 0x1001f90d6\ncall    __Znwm; operator new(ulong)                                    ; +0x8b, 0x1001f90db\nmov     rbx, rax                                                       ; +0x90, 0x1001f90e0\nmov     [rbp+__p], rax                                                 ; +0x93, 0x1001f90e3\nmov     qword ptr [rbp+var_28], 119h                                   ; +0x97, 0x1001f90e7\nmov     [rbp+var_20], 111h                                             ; +0x9f, 0x1001f90ef\nlea     rsi, aThereAreThousa; \"There are thousands of great custom son\"... ; +0xa7, 0x1001f90f7\nmov     edx, 111h; __n                                                 ; +0xae, 0x1001f90fe\nmov     rdi, rax; __dst                                                ; +0xb3, 0x1001f9103\ncall    _memcpy                                                        ; +0xb6, 0x1001f9106\nmov     byte ptr [rbx+111h], 0                                         ; +0xbb, 0x1001f910b\nlea     rsi, aNewgroundsInfo; \"Newgrounds Info\"                        ; +0xc2, 0x1001f9112\nlea     rcx, aOk; \"OK\"                                                 ; +0xc9, 0x1001f9119\nlea     rdx, [rbp+var_28]                                              ; +0xd0, 0x1001f9120\nmovss   xmm0, cs:dword_100A03824                                       ; +0xd4, 0x1001f9124\nxor     edi, edi                                                       ; +0xdc, 0x1001f912c\nxor     r8d, r8d                                                       ; +0xde, 0x1001f912e\ncall    FLAlertLayer__create_1                                         ; +0xe1, 0x1001f9131\nmov     rbx, rax                                                       ; +0xe6, 0x1001f9136\ntest    [rbp+var_28], 1                                                ; +0xe9, 0x1001f9139\njz      short loc_1001F9148                                            ; +0xed, 0x1001f913d\nmov     rdi, [rbp+__p]; __p                                            ; +0xef, 0x1001f913f\ncall    __ZdlPv; operator delete(void *)                               ; +0xf3, 0x1001f9143\nmov     rax, [rbx]                                                     ; +0xf8, 0x1001f9148\nmov     rdi, rbx                                                       ; +0xfb, 0x1001f914b\ncall    qword ptr [rax+520h]                                           ; +0xfe, 0x1001f914e\njmp     short loc_1001F9193                                            ; +0x104, 0x1001f9154\nlea     rdi, [rbp+var_28+1]; char *                                    ; +0x106, 0x1001f9156\ncall    _atoi                                                          ; +0x10a, 0x1001f915a\nmov     r14, [rbx+2B8h]                                                ; +0x10f, 0x1001f915f\nmov     edi, eax                                                       ; +0x116, 0x1001f9166\ncall    SongInfoObject__create_1                                       ; +0x118, 0x1001f9168\nmov     rdi, r14                                                       ; +0x11d, 0x1001f916d\nmov     rsi, rax                                                       ; +0x120, 0x1001f9170\ncall    CustomSongWidget__updateSongObject                             ; +0x123, 0x1001f9173\nmov     rdi, [rbx+2B8h]                                                ; +0x128, 0x1001f9178\ncall    CustomSongWidget__getSongInfoIfUnloaded                        ; +0x12f, 0x1001f917f\ntest    [rbp+var_28], 1                                                ; +0x134, 0x1001f9184\njz      short loc_1001F9193                                            ; +0x138, 0x1001f9188\nmov     rdi, [rbp+__p]; __p                                            ; +0x13a, 0x1001f918a\ncall    __ZdlPv; operator delete(void *)                               ; +0x13e, 0x1001f918e\nadd     rsp, 20h                                                       ; +0x143, 0x1001f9193\npop     rbx                                                            ; +0x147, 0x1001f9197\npop     r14                                                            ; +0x148, 0x1001f9198\npop     rbp                                                            ; +0x14a, 0x1001f919a\nretn                                                                   ; +0x14b, 0x1001f919b", "xrefs": ["CustomSongLayer::init @ 0x1001f8cf6"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}