{"type": "func", "start": 5371947600, "end": 5371947920, "name": "MoreSearchLayer::selectSong", "pseudocode": "// \n// MoreSearchLayer::selectSong from 0x140316a50 to 0x140316b90 (320 bytes)\n// \n// 5 xrefs:\n// > MoreSearchLayer::onSongFilter @ 0x140316526\n// > MoreSearchLayer::audioNext @ 0x140316913\n// > MoreSearchLayer::audioPrevious @ 0x140316a33\n// > <???> @ 0x1406d4964\n// > <???> @ 0x1406d4970\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=2\nvoid MoreSearchLayer::selectSong(MoreSearchLayer *a1, int a2)\n{\n  int v2; // ebx\n  __int64 v4; // rdi\n  struct cocos2d::CCString *v5; // rax\n  void *v6; // rcx\n  void *v7; // [rsp+20h] [rbp-38h]\n  void *Block[2]; // [rsp+28h] [rbp-30h] BYREF\n  __int64 v9; // [rsp+38h] [rbp-20h]\n  unsigned __int64 v10; // [rsp+40h] [rbp-18h]\n\n  v2 = a2;\n  if ( a2 > 22 )\n    v2 = 22;\n  if ( v2 < 1 )\n    v2 = 1;\n  v4 = qword_1406C2EC0;\n  if ( !qword_1406C2EC0 )\n  {\n    v7 = operator new(0x3D0u);\n    qword_1406C2EC0 = sub_140141280((__int64)v7);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n    v4 = qword_1406C2EC0;\n  }\n  v9 = 11;\n  v10 = 15;\n  Block[0] = (void *)0x6C69665F676E6F73LL;\n  Block[1] = (void *)7497076;\n  v5 = cocos2d::CCString::createWithFormat(\"%i\", v2);\n  cocos2d::CCDictionary::setObject(*(_QWORD *)(v4 + 344), v5, Block);\n  if ( v10 > 0xF )\n  {\n    v6 = Block[0];\n    if ( v10 + 1 >= 0x1000 )\n    {\n      v6 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v6);\n  }\n  MoreSearchLayer::updateAudioLabel(a1);\n}", "assembly": "; \n; MoreSearchLayer::selectSong from 0x140316a50 to 0x140316b90 (320 bytes)\n; \n; 5 xrefs:\n; > MoreSearchLayer::onSongFilter @ 0x140316526\n; > MoreSearchLayer::audioNext @ 0x140316913\n; > MoreSearchLayer::audioPrevious @ 0x140316a33\n; > <???> @ 0x1406d4964\n; > <???> @ 0x1406d4970\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, 0x140316a50\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x140316a55\npush    rdi                                                            ; +0xa, 0x140316a5a\nsub     rsp, 50h                                                       ; +0xb, 0x140316a5b\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x140316a5f\nxor     rax, rsp                                                       ; +0x16, 0x140316a66\nmov     [rsp+58h+var_10], rax                                          ; +0x19, 0x140316a69\nmov     ebx, edx                                                       ; +0x1e, 0x140316a6e\nmov     rsi, rcx                                                       ; +0x20, 0x140316a70\nmov     eax, 16h                                                       ; +0x23, 0x140316a73\ncmp     edx, eax                                                       ; +0x28, 0x140316a78\ncmovg   ebx, eax                                                       ; +0x2a, 0x140316a7a\nmov     eax, 1                                                         ; +0x2d, 0x140316a7d\ncmp     ebx, eax                                                       ; +0x32, 0x140316a82\ncmovl   ebx, eax                                                       ; +0x34, 0x140316a84\nmov     rdi, cs:qword_1406C2EC0                                        ; +0x37, 0x140316a87\ntest    rdi, rdi                                                       ; +0x3e, 0x140316a8e\njnz     short loc_140316AC2                                            ; +0x41, 0x140316a91\nmov     ecx, 3D0h; Size                                                ; +0x43, 0x140316a93\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x48, 0x140316a98\nmov     [rsp+58h+var_38], rax                                          ; +0x4d, 0x140316a9d\nmov     rcx, rax                                                       ; +0x52, 0x140316aa2\ncall    sub_140141280                                                  ; +0x55, 0x140316aa5\nnop                                                                    ; +0x5a, 0x140316aaa\nmov     cs:qword_1406C2EC0, rax                                        ; +0x5b, 0x140316aab\nmov     rdx, [rax]                                                     ; +0x62, 0x140316ab2\nmov     rcx, rax                                                       ; +0x65, 0x140316ab5\ncall    qword ptr [rdx+48h]                                            ; +0x68, 0x140316ab8\nmov     rdi, cs:qword_1406C2EC0                                        ; +0x6b, 0x140316abb\nxorps   xmm0, xmm0                                                     ; +0x72, 0x140316ac2\nmovups  xmmword ptr [rsp+58h+Block], xmm0                              ; +0x75, 0x140316ac5\nmov     [rsp+58h+var_20], 0Bh                                          ; +0x7a, 0x140316aca\nmov     [rsp+58h+var_18], 0Fh                                          ; +0x83, 0x140316ad3\nmovsd   xmm0, cs:qword_14058AA88                                       ; +0x8c, 0x140316adc\nmovsd   [rsp+58h+Block], xmm0                                          ; +0x94, 0x140316ae4\nmovzx   eax, cs:word_14058AA90                                         ; +0x9a, 0x140316aea\nmov     word ptr [rsp+58h+Block+8], ax                                 ; +0xa1, 0x140316af1\nmovzx   eax, cs:byte_14058AA92                                         ; +0xa6, 0x140316af6\nmov     byte ptr [rsp+58h+Block+0Ah], al                               ; +0xad, 0x140316afd\nmov     byte ptr [rsp+58h+Block+0Bh], 0                                ; +0xb1, 0x140316b01\nmov     edx, ebx                                                       ; +0xb6, 0x140316b06\nlea     rcx, aI_11; \"%i\"                                               ; +0xb8, 0x140316b08\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xbf, 0x140316b0f\nmov     rdx, rax                                                       ; +0xc5, 0x140316b15\nlea     r8, [rsp+58h+Block]                                            ; +0xc8, 0x140316b18\nmov     rcx, [rdi+158h]                                                ; +0xcd, 0x140316b1d\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0xd4, 0x140316b24\nnop                                                                    ; +0xda, 0x140316b2a\nmov     rdx, [rsp+58h+var_18]                                          ; +0xdb, 0x140316b2b\ncmp     rdx, 0Fh                                                       ; +0xe0, 0x140316b30\njbe     short loc_140316B6B                                            ; +0xe4, 0x140316b34\ninc     rdx                                                            ; +0xe6, 0x140316b36\nmov     rcx, [rsp+58h+Block]; Block                                    ; +0xe9, 0x140316b39\nmov     rax, rcx                                                       ; +0xee, 0x140316b3e\ncmp     rdx, 1000h                                                     ; +0xf1, 0x140316b41\njb      short loc_140316B66                                            ; +0xf8, 0x140316b48\nadd     rdx, 27h ; '''                                                 ; +0xfa, 0x140316b4a\nmov     rcx, [rcx-8]                                                   ; +0xfe, 0x140316b4e\nsub     rax, rcx                                                       ; +0x102, 0x140316b52\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x105, 0x140316b55\ncmp     rax, 1Fh                                                       ; +0x109, 0x140316b59\njbe     short loc_140316B66                                            ; +0x10d, 0x140316b5d\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x10f, 0x140316b5f\nalign 2                                                                ; +0x115, 0x140316b65\ncall    j_j_free                                                       ; +0x116, 0x140316b66\nmov     rcx, rsi                                                       ; +0x11b, 0x140316b6b\ncall    MoreSearchLayer__updateAudioLabel                              ; +0x11e, 0x140316b6e\nmov     rcx, [rsp+58h+var_10]                                          ; +0x123, 0x140316b73\nxor     rcx, rsp; StackCookie                                          ; +0x128, 0x140316b78\ncall    __security_check_cookie                                        ; +0x12b, 0x140316b7b\nmov     rbx, [rsp+58h+arg_10]                                          ; +0x130, 0x140316b80\nmov     rsi, [rsp+58h+arg_18]                                          ; +0x135, 0x140316b85\nadd     rsp, 50h                                                       ; +0x13a, 0x140316b8a\npop     rdi                                                            ; +0x13e, 0x140316b8e\nretn                                                                   ; +0x13f, 0x140316b8f", "xrefs": ["MoreSearchLayer::onSongFilter @ 0x140316526", "MoreSearchLayer::audioNext @ 0x140316913", "MoreSearchLayer::audioPrevious @ 0x140316a33", "<???> @ 0x1406d4964", "<???> @ 0x1406d4970"], "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"}