{"type": "func", "start": 5372117376, "end": 5372117765, "name": "MusicDownloadManager::onGetCustomContentURLCompleted", "pseudocode": "// \n// MusicDownloadManager::onGetCustomContentURLCompleted from 0x140340180 to 0x140340305 (389 bytes)\n// \n// 2 xrefs:\n// > MusicDownloadManager::handleIt @ 0x14033d166\n// > <???> @ 0x1406d5738\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=3\nvoid __fastcall MusicDownloadManager::onGetCustomContentURLCompleted(\n        MusicDownloadManager *a1,\n        const void **a2,\n        __int64 a3)\n{\n  void *v6; // rcx\n  _BYTE *v7; // rcx\n  size_t v8; // r8\n  _BYTE *v9; // rdx\n  size_t v10; // r8\n  void *Block[2]; // [rsp+30h] [rbp-48h] BYREF\n  __int64 v12; // [rsp+40h] [rbp-38h]\n  unsigned __int64 v13; // [rsp+48h] [rbp-30h]\n\n  Block[1] = (void *)108;\n  v12 = 9;\n  v13 = 15;\n  Block[0] = (void *)0x72755F635F746567LL;\n  cocos2d::CCDictionary::removeObjectForKey(a1->m_activeDownloads, Block);\n  if ( v13 > 0xF )\n  {\n    v6 = Block[0];\n    if ( v13 + 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  *(_OWORD *)Block = 0;\n  v12 = 2;\n  v13 = 15;\n  strcpy((char *)Block, \"-1\");\n  v7 = a2;\n  if ( (unsigned __int64)a2[3] > 0xF )\n    v7 = *a2;\n  v8 = (size_t)a2[2];\n  if ( v8 > 2 )\n    v8 = 2;\n  if ( !memcmp(v7, Block, v8) && a2[2] == (const void *)2 )\n  {\n    MusicDownloadManager::musicActionFailed(a1, DownloadOrUpdate);\n  }\n  else\n  {\n    v9 = a2;\n    if ( (unsigned __int64)a2[3] > 0xF )\n      v9 = *a2;\n    v10 = -1;\n    do\n      ++v10;\n    while ( v9[v10] );\n    sub_14003CCE0((void **)&a1->m_customContentURL, v9, v10);\n    MusicDownloadManager::musicActionFinished(a1, DownloadOrUpdate);\n  }\n  sub_14003A830((__int64)a2);\n  sub_14003A830(a3);\n}", "assembly": "; \n; MusicDownloadManager::onGetCustomContentURLCompleted from 0x140340180 to 0x140340305 (389 bytes)\n; \n; 2 xrefs:\n; > MusicDownloadManager::handleIt @ 0x14033d166\n; > <???> @ 0x1406d5738\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_18], rbx                                              ; +0x0, 0x140340180\npush    rbp                                                            ; +0x5, 0x140340185\npush    r14                                                            ; +0x6, 0x140340186\npush    r15                                                            ; +0x8, 0x140340188\nsub     rsp, 60h                                                       ; +0xa, 0x14034018a\nmov     rax, cs:__security_cookie                                      ; +0xe, 0x14034018e\nxor     rax, rsp                                                       ; +0x15, 0x140340195\nmov     [rsp+78h+var_28], rax                                          ; +0x18, 0x140340198\nmov     r14, r8                                                        ; +0x1d, 0x14034019d\nmov     rbx, rdx                                                       ; +0x20, 0x1403401a0\nmov     rbp, rcx                                                       ; +0x23, 0x1403401a3\nmov     [rsp+78h+var_58], rdx                                          ; +0x26, 0x1403401a6\nmov     [rsp+78h+var_50], r8                                           ; +0x2b, 0x1403401ab\nxorps   xmm0, xmm0                                                     ; +0x30, 0x1403401b0\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0x33, 0x1403401b3\nmov     [rsp+78h+var_38], 9                                            ; +0x38, 0x1403401b8\nmov     [rsp+78h+var_30], 0Fh                                          ; +0x41, 0x1403401c1\nmovsd   xmm0, cs:qword_1405AC718                                       ; +0x4a, 0x1403401ca\nmovsd   [rsp+78h+Block], xmm0                                          ; +0x52, 0x1403401d2\nmovzx   eax, cs:byte_1405AC720                                         ; +0x58, 0x1403401d8\nmov     byte ptr [rsp+78h+Block+8], al                                 ; +0x5f, 0x1403401df\nmov     byte ptr [rsp+78h+Block+9], 0                                  ; +0x63, 0x1403401e3\nlea     rdx, [rsp+78h+Block]                                           ; +0x68, 0x1403401e8\nmov     rcx, [rcx+148h]                                                ; +0x6d, 0x1403401ed\ncall    cs:?removeObjectForKey@CCDictionary@cocos2d@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::removeObjectForKey(std::string const &) ; +0x74, 0x1403401f4\nnop                                                                    ; +0x7a, 0x1403401fa\nmov     rdx, [rsp+78h+var_30]                                          ; +0x7b, 0x1403401fb\ncmp     rdx, 0Fh                                                       ; +0x80, 0x140340200\njbe     short loc_14034023B                                            ; +0x84, 0x140340204\ninc     rdx                                                            ; +0x86, 0x140340206\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0x89, 0x140340209\nmov     rax, rcx                                                       ; +0x8e, 0x14034020e\ncmp     rdx, 1000h                                                     ; +0x91, 0x140340211\njb      short loc_140340236                                            ; +0x98, 0x140340218\nadd     rdx, 27h ; '''                                                 ; +0x9a, 0x14034021a\nmov     rcx, [rcx-8]                                                   ; +0x9e, 0x14034021e\nsub     rax, rcx                                                       ; +0xa2, 0x140340222\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xa5, 0x140340225\ncmp     rax, 1Fh                                                       ; +0xa9, 0x140340229\njbe     short loc_140340236                                            ; +0xad, 0x14034022d\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xaf, 0x14034022f\nalign 2                                                                ; +0xb5, 0x140340235\ncall    j_j_free                                                       ; +0xb6, 0x140340236\nxorps   xmm0, xmm0                                                     ; +0xbb, 0x14034023b\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0xbe, 0x14034023e\nmov     r15d, 2                                                        ; +0xc3, 0x140340243\nmov     [rsp+78h+var_38], r15                                          ; +0xc9, 0x140340249\nmov     [rsp+78h+var_30], 0Fh                                          ; +0xce, 0x14034024e\nmov     eax, 312Dh                                                     ; +0xd7, 0x140340257\nmov     word ptr [rsp+78h+Block], ax                                   ; +0xdc, 0x14034025c\nmov     byte ptr [rsp+78h+Block+2], 0                                  ; +0xe1, 0x140340261\nmov     rcx, rbx                                                       ; +0xe6, 0x140340266\ncmp     qword ptr [rbx+18h], 0Fh                                       ; +0xe9, 0x140340269\njbe     short loc_140340273                                            ; +0xee, 0x14034026e\nmov     rcx, [rbx]; Buf1                                               ; +0xf0, 0x140340270\nmov     r8, [rbx+10h]                                                  ; +0xf3, 0x140340273\ncmp     r8, r15                                                        ; +0xf7, 0x140340277\ncmova   r8, r15; Size                                                  ; +0xfa, 0x14034027a\nlea     rdx, [rsp+78h+Block]; Buf2                                     ; +0xfe, 0x14034027e\ncall    memcmp                                                         ; +0x103, 0x140340283\ntest    eax, eax                                                       ; +0x108, 0x140340288\njnz     short loc_14034029F                                            ; +0x10a, 0x14034028a\ncmp     [rbx+10h], r15                                                 ; +0x10c, 0x14034028c\njnz     short loc_14034029F                                            ; +0x110, 0x140340290\nmov     edx, r15d                                                      ; +0x112, 0x140340292\nmov     rcx, rbp                                                       ; +0x115, 0x140340295\ncall    MusicDownloadManager__musicActionFailed                        ; +0x118, 0x140340298\njmp     short loc_1403402D5                                            ; +0x11d, 0x14034029d\nmov     rdx, rbx                                                       ; +0x11f, 0x14034029f\ncmp     qword ptr [rbx+18h], 0Fh                                       ; +0x122, 0x1403402a2\njbe     short loc_1403402AC                                            ; +0x127, 0x1403402a7\nmov     rdx, [rbx]; Src                                                ; +0x129, 0x1403402a9\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x12c, 0x1403402ac\ninc     r8; Size                                                       ; +0x133, 0x1403402b3\ncmp     byte ptr [rdx+r8], 0                                           ; +0x136, 0x1403402b6\njnz     short loc_1403402B3                                            ; +0x13b, 0x1403402bb\nlea     rcx, [rbp+170h]; void *                                        ; +0x13d, 0x1403402bd\ncall    sub_14003CCE0                                                  ; +0x144, 0x1403402c4\nmov     edx, r15d                                                      ; +0x149, 0x1403402c9\nmov     rcx, rbp                                                       ; +0x14c, 0x1403402cc\ncall    MusicDownloadManager__musicActionFinished                      ; +0x14f, 0x1403402cf\nnop                                                                    ; +0x154, 0x1403402d4\nmov     rcx, rbx                                                       ; +0x155, 0x1403402d5\ncall    sub_14003A830                                                  ; +0x158, 0x1403402d8\nnop                                                                    ; +0x15d, 0x1403402dd\nmov     rcx, r14                                                       ; +0x15e, 0x1403402de\ncall    sub_14003A830                                                  ; +0x161, 0x1403402e1\nmov     rcx, [rsp+78h+var_28]                                          ; +0x166, 0x1403402e6\nxor     rcx, rsp; StackCookie                                          ; +0x16b, 0x1403402eb\ncall    __security_check_cookie                                        ; +0x16e, 0x1403402ee\nmov     rbx, [rsp+78h+arg_18]                                          ; +0x173, 0x1403402f3\nadd     rsp, 60h                                                       ; +0x17b, 0x1403402fb\npop     r15                                                            ; +0x17f, 0x1403402ff\npop     r14                                                            ; +0x181, 0x140340301\npop     rbp                                                            ; +0x183, 0x140340303\nretn                                                                   ; +0x184, 0x140340304", "xrefs": ["MusicDownloadManager::handleIt @ 0x14033d166", "<???> @ 0x1406d5738"], "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"}