{"type": "func", "start": 5372127712, "end": 5372128308, "name": "MusicDownloadManager::downloadSFXLibrary", "pseudocode": "// \n// MusicDownloadManager::downloadSFXLibrary from 0x1403429e0 to 0x140342c34 (596 bytes)\n// \n// 5 xrefs:\n// > AudioAssetsBrowser::musicActionFinished @ 0x140083d93\n// > MusicDownloadManager::onTryUpdateSFXLibraryCompleted @ 0x14034298e\n// > SFXBrowser::trySetupSFXBrowser @ 0x14047f643\n// > SFXBrowser::musicActionFinished @ 0x14047f8db\n// > <???> @ 0x1406d5804\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=5\nvoid MusicDownloadManager::downloadSFXLibrary(MusicDownloadManager *a1)\n{\n  __int64 v2; // rdi\n  void *v3; // rcx\n  char *v4; // rdi\n  _DWORD *v5; // rax\n  const char *v6; // rax\n  cocos2d::extension::CCHttpRequest *Request; // rax\n  void *v8; // rcx\n  __int128 v9; // [rsp+38h] [rbp-71h] BYREF\n  __int64 v10; // [rsp+48h] [rbp-61h]\n  __int64 v11; // [rsp+50h] [rbp-59h]\n  _BYTE v12[32]; // [rsp+60h] [rbp-49h] BYREF\n  void *Block[2]; // [rsp+80h] [rbp-29h] BYREF\n  __int64 v14; // [rsp+90h] [rbp-19h]\n  unsigned __int64 v15; // [rsp+98h] [rbp-11h]\n  __int128 v16; // [rsp+A0h] [rbp-9h]\n  __int64 v17; // [rsp+B0h] [rbp+7h]\n  __int64 v18; // [rsp+B8h] [rbp+Fh]\n  _BYTE v19[32]; // [rsp+C0h] [rbp+17h] BYREF\n\n  if ( a1->m_customContentURL.m_data.m_size )\n  {\n    Block[1] = nullptr;\n    v14 = 8;\n    v15 = 15;\n    Block[0] = (void *)0x6C5F7866735F6C64LL;\n    v2 = cocos2d::CCDictionary::objectForKey(a1->m_activeDownloads, Block);\n    if ( v15 > 0xF )\n    {\n      v3 = Block[0];\n      if ( v15 + 1 >= 0x1000 )\n      {\n        v3 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v3 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v3);\n    }\n    if ( !v2 )\n    {\n      a1->m_requestedSfxLibraryDownloaded = 1;\n      v16 = 0;\n      v4 = (char *)sub_14003AA10(0x20u);\n      *(_QWORD *)&v16 = v4;\n      v17 = 19;\n      v18 = 31;\n      strcpy(v4, \"/sfx/sfxlibrary.dat\");\n      *(_OWORD *)Block = 0;\n      v14 = 0;\n      v15 = 15;\n      v5 = sub_14003AA10(0x20u);\n      Block[0] = v5;\n      v14 = 19;\n      v15 = 31;\n      *(_OWORD *)v5 = *(_OWORD *)v4;\n      v5[4] = *((_DWORD *)v4 + 4);\n      MusicDownloadManager::generateCustomContentURL(a1, v19, Block);\n      v9 = 0;\n      v10 = 0;\n      v11 = 15;\n      LOBYTE(v9) = 0;\n      v6 = (const char *)sub_14003BDB0((__int64)v12, (__int64)v19);\n      Request = MusicDownloadManager::ProcessHttpGetRequest(\n                  a1,\n                  v6,\n                  (const char *)&v9,\n                  (void (__cdecl *)(cocos2d::extension::CCHttpClient *, cocos2d::extension::CCHttpResponse *))MusicDownloadManager::onDownloadSFXLibraryCompleted,\n                  0,\n                  0);\n      v14 = 8;\n      v15 = 15;\n      Block[0] = (void *)0x6C5F7866735F6C64LL;\n      Block[1] = nullptr;\n      cocos2d::CCDictionary::setObject(a1->m_activeDownloads, Request, Block);\n      if ( v15 > 0xF )\n      {\n        v8 = Block[0];\n        if ( v15 + 1 >= 0x1000 )\n        {\n          v8 = *((void **)Block[0] - 1);\n          if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )\n            invalid_parameter_noinfo_noreturn();\n        }\n        j_j_free(v8);\n      }\n      sub_14003A830((__int64)v19);\n      j_j_free(v4);\n    }\n  }\n}", "assembly": "; \n; MusicDownloadManager::downloadSFXLibrary from 0x1403429e0 to 0x140342c34 (596 bytes)\n; \n; 5 xrefs:\n; > AudioAssetsBrowser::musicActionFinished @ 0x140083d93\n; > MusicDownloadManager::onTryUpdateSFXLibraryCompleted @ 0x14034298e\n; > SFXBrowser::trySetupSFXBrowser @ 0x14047f643\n; > SFXBrowser::musicActionFinished @ 0x14047f8db\n; > <???> @ 0x1406d5804\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-8+arg_8], rbx                                             ; +0x0, 0x1403429e0\nmov     [rsp-8+arg_10], rsi                                            ; +0x5, 0x1403429e5\npush    rbp                                                            ; +0xa, 0x1403429ea\npush    rdi                                                            ; +0xb, 0x1403429eb\npush    r14                                                            ; +0xc, 0x1403429ec\nlea     rbp, [rsp-47h]                                                 ; +0xe, 0x1403429ee\nsub     rsp, 0F0h                                                      ; +0x13, 0x1403429f3\nmov     rax, cs:__security_cookie                                      ; +0x1a, 0x1403429fa\nxor     rax, rsp                                                       ; +0x21, 0x140342a01\nmov     [rbp+57h+var_20], rax                                          ; +0x24, 0x140342a04\nmov     rbx, rcx                                                       ; +0x28, 0x140342a08\ncmp     qword ptr [rcx+180h], 0                                        ; +0x2b, 0x140342a0b\njz      loc_140342C10                                                  ; +0x33, 0x140342a13\nxorps   xmm0, xmm0                                                     ; +0x39, 0x140342a19\nmovups  xmmword ptr [rbp+57h+Block], xmm0                              ; +0x3c, 0x140342a1c\nmov     [rbp+57h+var_70], 8                                            ; +0x40, 0x140342a20\nmov     [rbp+57h+var_68], 0Fh                                          ; +0x48, 0x140342a28\nmov     r14, 6C5F7866735F6C64h                                         ; +0x50, 0x140342a30\nmov     [rbp+57h+Block], r14                                           ; +0x5a, 0x140342a3a\nmov     byte ptr [rbp+57h+Block+8], 0                                  ; +0x5e, 0x140342a3e\nlea     rdx, [rbp+57h+Block]                                           ; +0x62, 0x140342a42\nmov     rcx, [rcx+148h]                                                ; +0x66, 0x140342a46\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0x6d, 0x140342a4d\nmov     rdi, rax                                                       ; +0x73, 0x140342a53\nmov     rdx, [rbp+57h+var_68]                                          ; +0x76, 0x140342a56\ncmp     rdx, 0Fh                                                       ; +0x7a, 0x140342a5a\njbe     short loc_140342A94                                            ; +0x7e, 0x140342a5e\ninc     rdx                                                            ; +0x80, 0x140342a60\nmov     rcx, [rbp+57h+Block]; Block                                    ; +0x83, 0x140342a63\nmov     rax, rcx                                                       ; +0x87, 0x140342a67\ncmp     rdx, 1000h                                                     ; +0x8a, 0x140342a6a\njb      short loc_140342A8F                                            ; +0x91, 0x140342a71\nadd     rdx, 27h ; '''                                                 ; +0x93, 0x140342a73\nmov     rcx, [rcx-8]                                                   ; +0x97, 0x140342a77\nsub     rax, rcx                                                       ; +0x9b, 0x140342a7b\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x9e, 0x140342a7e\ncmp     rax, 1Fh                                                       ; +0xa2, 0x140342a82\njbe     short loc_140342A8F                                            ; +0xa6, 0x140342a86\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xa8, 0x140342a88\ndb 0CCh                                                                ; +0xae, 0x140342a8e\ncall    j_j_free                                                       ; +0xaf, 0x140342a8f\ntest    rdi, rdi                                                       ; +0xb4, 0x140342a94\njnz     loc_140342C10                                                  ; +0xb7, 0x140342a97\nmov     byte ptr [rbx+1A8h], 1                                         ; +0xbd, 0x140342a9d\nxorps   xmm0, xmm0                                                     ; +0xc4, 0x140342aa4\nmovups  [rbp+57h+var_60], xmm0                                         ; +0xc7, 0x140342aa7\nlea     ecx, [rdi+20h]                                                 ; +0xcb, 0x140342aab\ncall    sub_14003AA10                                                  ; +0xce, 0x140342aae\nmov     rdi, rax                                                       ; +0xd3, 0x140342ab3\nmov     qword ptr [rbp+57h+var_60], rax                                ; +0xd6, 0x140342ab6\nmov     [rbp+57h+var_50], 13h                                          ; +0xda, 0x140342aba\nmov     [rbp+57h+var_48], 1Fh                                          ; +0xe2, 0x140342ac2\nmovups  xmm0, cs:xmmword_1405AC830                                     ; +0xea, 0x140342aca\nmovups  xmmword ptr [rax], xmm0                                        ; +0xf1, 0x140342ad1\nmovzx   eax, cs:word_1405AC840                                         ; +0xf4, 0x140342ad4\nmov     [rdi+10h], ax                                                  ; +0xfb, 0x140342adb\nmovzx   eax, cs:byte_1405AC842                                         ; +0xff, 0x140342adf\nmov     [rdi+12h], al                                                  ; +0x106, 0x140342ae6\nmov     byte ptr [rdi+13h], 0                                          ; +0x109, 0x140342ae9\nxorps   xmm0, xmm0                                                     ; +0x10d, 0x140342aed\nmovups  xmmword ptr [rbp+57h+Block], xmm0                              ; +0x110, 0x140342af0\nxor     esi, esi                                                       ; +0x114, 0x140342af4\nmov     [rbp+57h+var_70], rsi                                          ; +0x116, 0x140342af6\nmov     [rbp+57h+var_68], 0Fh                                          ; +0x11a, 0x140342afa\nlea     ecx, [rsi+20h]                                                 ; +0x122, 0x140342b02\ncall    sub_14003AA10                                                  ; +0x125, 0x140342b05\nmov     [rbp+57h+Block], rax                                           ; +0x12a, 0x140342b0a\nmov     [rbp+57h+var_70], 13h                                          ; +0x12e, 0x140342b0e\nmov     [rbp+57h+var_68], 1Fh                                          ; +0x136, 0x140342b16\nmovups  xmm0, xmmword ptr [rdi]                                        ; +0x13e, 0x140342b1e\nmovups  xmmword ptr [rax], xmm0                                        ; +0x141, 0x140342b21\nmov     ecx, [rdi+10h]                                                 ; +0x144, 0x140342b24\nmov     [rax+10h], ecx                                                 ; +0x147, 0x140342b27\nlea     r8, [rbp+57h+Block]                                            ; +0x14a, 0x140342b2a\nlea     rdx, [rbp+57h+var_40]                                          ; +0x14e, 0x140342b2e\nmov     rcx, rbx                                                       ; +0x152, 0x140342b32\ncall    MusicDownloadManager__generateCustomContentURL                 ; +0x155, 0x140342b35\nnop                                                                    ; +0x15a, 0x140342b3a\nlea     rax, [rbp+57h+var_C8]                                          ; +0x15b, 0x140342b3b\nmov     [rbp+57h+var_D0], rax                                          ; +0x15f, 0x140342b3f\nxorps   xmm0, xmm0                                                     ; +0x163, 0x140342b43\nmovups  [rbp+57h+var_C8], xmm0                                         ; +0x166, 0x140342b46\nmov     [rbp+57h+var_B8], rsi                                          ; +0x16a, 0x140342b4a\nmov     [rbp+57h+var_B0], 0Fh                                          ; +0x16e, 0x140342b4e\nmov     byte ptr [rbp+57h+var_C8], sil                                 ; +0x176, 0x140342b56\nlea     rdx, [rbp+57h+var_40]                                          ; +0x17a, 0x140342b5a\nlea     rcx, [rbp+57h+var_A0]                                          ; +0x17e, 0x140342b5e\ncall    sub_14003BDB0                                                  ; +0x182, 0x140342b62\nnop                                                                    ; +0x187, 0x140342b67\nmov     [rsp+100h+var_D8], esi                                         ; +0x188, 0x140342b68\nmov     [rsp+100h+var_E0], esi                                         ; +0x18c, 0x140342b6c\nlea     r9, MusicDownloadManager__onDownloadSFXLibraryCompleted        ; +0x190, 0x140342b70\nlea     r8, [rbp+57h+var_C8]                                           ; +0x197, 0x140342b77\nmov     rdx, rax                                                       ; +0x19b, 0x140342b7b\nmov     rcx, rbx                                                       ; +0x19e, 0x140342b7e\ncall    MusicDownloadManager__ProcessHttpGetRequest                    ; +0x1a1, 0x140342b81\nxorps   xmm0, xmm0                                                     ; +0x1a6, 0x140342b86\nmovups  xmmword ptr [rbp+57h+Block], xmm0                              ; +0x1a9, 0x140342b89\nmov     [rbp+57h+var_70], 8                                            ; +0x1ad, 0x140342b8d\nmov     [rbp+57h+var_68], 0Fh                                          ; +0x1b5, 0x140342b95\nmov     [rbp+57h+Block], r14                                           ; +0x1bd, 0x140342b9d\nmov     byte ptr [rbp+57h+Block+8], sil                                ; +0x1c1, 0x140342ba1\nlea     r8, [rbp+57h+Block]                                            ; +0x1c5, 0x140342ba5\nmov     rdx, rax                                                       ; +0x1c9, 0x140342ba9\nmov     rcx, [rbx+148h]                                                ; +0x1cc, 0x140342bac\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 &) ; +0x1d3, 0x140342bb3\nnop                                                                    ; +0x1d9, 0x140342bb9\nmov     rdx, [rbp+57h+var_68]                                          ; +0x1da, 0x140342bba\ncmp     rdx, 0Fh                                                       ; +0x1de, 0x140342bbe\njbe     short loc_140342BF9                                            ; +0x1e2, 0x140342bc2\ninc     rdx                                                            ; +0x1e4, 0x140342bc4\nmov     rcx, [rbp+57h+Block]; Block                                    ; +0x1e7, 0x140342bc7\nmov     rax, rcx                                                       ; +0x1eb, 0x140342bcb\ncmp     rdx, 1000h                                                     ; +0x1ee, 0x140342bce\njb      short loc_140342BF3                                            ; +0x1f5, 0x140342bd5\nadd     rdx, 27h ; '''                                                 ; +0x1f7, 0x140342bd7\nmov     rcx, [rcx-8]                                                   ; +0x1fb, 0x140342bdb\nsub     rax, rcx                                                       ; +0x1ff, 0x140342bdf\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x202, 0x140342be2\ncmp     rax, 1Fh                                                       ; +0x206, 0x140342be6\njbe     short loc_140342BF3                                            ; +0x20a, 0x140342bea\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x20c, 0x140342bec\ndb 0CCh                                                                ; +0x212, 0x140342bf2\ncall    j_j_free                                                       ; +0x213, 0x140342bf3\nnop                                                                    ; +0x218, 0x140342bf8\nlea     rcx, [rbp+57h+var_40]                                          ; +0x219, 0x140342bf9\ncall    sub_14003A830                                                  ; +0x21d, 0x140342bfd\nnop                                                                    ; +0x222, 0x140342c02\nmov     edx, 20h ; ' '                                                 ; +0x223, 0x140342c03\nmov     rcx, rdi; Block                                                ; +0x228, 0x140342c08\ncall    j_j_free                                                       ; +0x22b, 0x140342c0b\nmov     rcx, [rbp+57h+var_20]                                          ; +0x230, 0x140342c10\nxor     rcx, rsp; StackCookie                                          ; +0x234, 0x140342c14\ncall    __security_check_cookie                                        ; +0x237, 0x140342c17\nlea     r11, [rsp+100h+var_10]                                         ; +0x23c, 0x140342c1c\nmov     rbx, [r11+28h]                                                 ; +0x244, 0x140342c24\nmov     rsi, [r11+30h]                                                 ; +0x248, 0x140342c28\nmov     rsp, r11                                                       ; +0x24c, 0x140342c2c\npop     r14                                                            ; +0x24f, 0x140342c2f\npop     rdi                                                            ; +0x251, 0x140342c31\npop     rbp                                                            ; +0x252, 0x140342c32\nretn                                                                   ; +0x253, 0x140342c33", "xrefs": ["AudioAssetsBrowser::musicActionFinished @ 0x140083d93", "MusicDownloadManager::onTryUpdateSFXLibraryCompleted @ 0x14034298e", "SFXBrowser::trySetupSFXBrowser @ 0x14047f643", "SFXBrowser::musicActionFinished @ 0x14047f8db", "<???> @ 0x1406d5804"], "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"}