{"type": "func", "start": 5373480256, "end": 5373480699, "name": "MusicDownloadManager::onDownloadMusicLibraryCompleted", "pseudocode": "// \n// MusicDownloadManager::onDownloadMusicLibraryCompleted from 0x14048cd40 to 0x14048cefb (443 bytes)\n// \n// 2 xrefs:\n// > MusicDownloadManager::downloadMusicLibrary @ 0x14048cc4f\n// > <???> @ 0x140928dd8\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 11:32:49 +0000\n// \n\n// Hidden C++ exception states: #wind=2\nvoid __fastcall MusicDownloadManager::onDownloadMusicLibraryCompleted(__int64 a1, __int64 a2, __int64 a3)\n{\n  void *v5; // rcx\n  const char *v6; // rcx\n  FILE *v7; // rax\n  FILE *v8; // rsi\n  cocos2d::CCDictionary *v9; // rcx\n  void *Block[2]; // [rsp+30h] [rbp-58h] BYREF\n  __m128i si128; // [rsp+40h] [rbp-48h]\n  char *FileName[4]; // [rsp+50h] [rbp-38h] BYREF\n\n  Block[1] = (void *)27743;\n  si128 = _mm_load_si128((const __m128i *)&xmmword_1408365B0);\n  Block[0] = (void *)0x636973756D5F6C64LL;\n  cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 328), Block);\n  if ( si128.m128i_i64[1] > 0xFuLL )\n  {\n    v5 = Block[0];\n    if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )\n    {\n      v5 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v5);\n  }\n  if ( a3 && *(_BYTE *)(a3 + 64) )\n  {\n    MusicDownloadManager::pathForSongFolder(a1, FileName, 0);\n    sub_140044D80(FileName, \"musiclibrary.dat\", 0x10u);\n    v6 = (const char *)FileName;\n    if ( FileName[3] > (char *)0xF )\n      v6 = FileName[0];\n    v7 = fopen(v6, \"wb\");\n    v8 = v7;\n    if ( v7\n      && (fwrite(*(const void **)(a3 + 72), 1u, *(_QWORD *)(a3 + 80) - *(_QWORD *)(a3 + 72), v7),\n          fclose(v8),\n          MusicDownloadManager::parseMusicLibrary(a1),\n          (v9 = *(cocos2d::CCDictionary **)(a1 + 448)) != nullptr)\n      && cocos2d::CCDictionary::count(v9) )\n    {\n      MusicDownloadManager::musicActionFinished(a1, 7);\n    }\n    else\n    {\n      MusicDownloadManager::musicActionFailed(a1, 7);\n    }\n    sub_14003D310((__int64)FileName);\n  }\n  else\n  {\n    MusicDownloadManager::musicActionFailed(a1, 7);\n  }\n}", "assembly": "; \n; MusicDownloadManager::onDownloadMusicLibraryCompleted from 0x14048cd40 to 0x14048cefb (443 bytes)\n; \n; 2 xrefs:\n; > MusicDownloadManager::downloadMusicLibrary @ 0x14048cc4f\n; > <???> @ 0x140928dd8\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 11:32:49 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x14048cd40\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x14048cd45\npush    rdi                                                            ; +0xa, 0x14048cd4a\nsub     rsp, 80h                                                       ; +0xb, 0x14048cd4b\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x14048cd52\nxor     rax, rsp                                                       ; +0x19, 0x14048cd59\nmov     [rsp+88h+var_18], rax                                          ; +0x1c, 0x14048cd5c\nmov     rdi, r8                                                        ; +0x21, 0x14048cd61\nmov     rbx, rcx                                                       ; +0x24, 0x14048cd64\nxorps   xmm0, xmm0                                                     ; +0x27, 0x14048cd67\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0x2a, 0x14048cd6a\nmovdqa  xmm1, cs:xmmword_1408365B0                                     ; +0x2f, 0x14048cd6f\nmovdqu  [rsp+88h+var_48], xmm1                                         ; +0x37, 0x14048cd77\nmovsd   xmm0, cs:qword_1407B8130                                       ; +0x3d, 0x14048cd7d\nmovsd   [rsp+88h+Block], xmm0                                          ; +0x45, 0x14048cd85\nmovzx   eax, cs:word_1407B8138                                         ; +0x4b, 0x14048cd8b\nmov     word ptr [rsp+88h+Block+8], ax                                 ; +0x52, 0x14048cd92\nmov     byte ptr [rsp+88h+Block+0Ah], 0                                ; +0x57, 0x14048cd97\nlea     rdx, [rsp+88h+Block]                                           ; +0x5c, 0x14048cd9c\nmov     rcx, [rcx+148h]                                                ; +0x61, 0x14048cda1\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 &) ; +0x68, 0x14048cda8\nnop                                                                    ; +0x6e, 0x14048cdae\nmov     rdx, qword ptr [rsp+88h+var_48+8]                              ; +0x6f, 0x14048cdaf\ncmp     rdx, 0Fh                                                       ; +0x74, 0x14048cdb4\njbe     short loc_14048CE02                                            ; +0x78, 0x14048cdb8\ninc     rdx                                                            ; +0x7a, 0x14048cdba\nmov     rcx, [rsp+88h+Block]; Block                                    ; +0x7d, 0x14048cdbd\nmov     rax, rcx                                                       ; +0x82, 0x14048cdc2\ncmp     rdx, 1000h                                                     ; +0x85, 0x14048cdc5\njb      short loc_14048CDFD                                            ; +0x8c, 0x14048cdcc\nadd     rdx, 27h ; '''                                                 ; +0x8e, 0x14048cdce\nmov     rcx, [rcx-8]                                                   ; +0x92, 0x14048cdd2\nsub     rax, rcx                                                       ; +0x96, 0x14048cdd6\nsub     rax, 8                                                         ; +0x99, 0x14048cdd9\ncmp     rax, 1Fh                                                       ; +0x9d, 0x14048cddd\njbe     short loc_14048CDFD                                            ; +0xa1, 0x14048cde1\nmov     [rsp+88h+Reserved], 0; Reserved                                ; +0xa3, 0x14048cde3\nxor     r9d, r9d; LineNo                                               ; +0xac, 0x14048cdec\nxor     r8d, r8d; FileName                                             ; +0xaf, 0x14048cdef\nxor     edx, edx; FunctionName                                         ; +0xb2, 0x14048cdf2\nxor     ecx, ecx; Expression                                           ; +0xb4, 0x14048cdf4\ncall    cs:_invoke_watson                                              ; +0xb6, 0x14048cdf6\ndb 0CCh                                                                ; +0xbc, 0x14048cdfc\ncall    j_j_free                                                       ; +0xbd, 0x14048cdfd\ntest    rdi, rdi                                                       ; +0xc2, 0x14048ce02\njz      loc_14048CECC                                                  ; +0xc5, 0x14048ce05\ncmp     byte ptr [rdi+40h], 0                                          ; +0xcb, 0x14048ce0b\njz      loc_14048CECC                                                  ; +0xcf, 0x14048ce0f\nxor     r8d, r8d                                                       ; +0xd5, 0x14048ce15\nlea     rdx, [rsp+88h+FileName]                                        ; +0xd8, 0x14048ce18\nmov     rcx, rbx                                                       ; +0xdd, 0x14048ce1d\ncall    MusicDownloadManager__pathForSongFolder                        ; +0xe0, 0x14048ce20\nnop                                                                    ; +0xe5, 0x14048ce25\nmov     r8d, 10h; Size                                                 ; +0xe6, 0x14048ce26\nlea     rdx, aMusiclibraryDa; \"musiclibrary.dat\"                       ; +0xec, 0x14048ce2c\nlea     rcx, [rsp+88h+FileName]; Src                                   ; +0xf3, 0x14048ce33\ncall    sub_140044D80                                                  ; +0xf8, 0x14048ce38\nlea     rcx, [rsp+88h+FileName]                                        ; +0xfd, 0x14048ce3d\ncmp     [rsp+88h+var_20], 0Fh                                          ; +0x102, 0x14048ce42\ncmova   rcx, [rsp+88h+FileName]; FileName                              ; +0x108, 0x14048ce48\nlea     rdx, aWb; \"wb\"                                                 ; +0x10e, 0x14048ce4e\ncall    cs:fopen                                                       ; +0x115, 0x14048ce55\nmov     rsi, rax                                                       ; +0x11b, 0x14048ce5b\ntest    rax, rax                                                       ; +0x11e, 0x14048ce5e\njz      short loc_14048CEB2                                            ; +0x121, 0x14048ce61\nmov     rcx, [rdi+48h]; Buffer                                         ; +0x123, 0x14048ce63\nmov     r8, [rdi+50h]                                                  ; +0x127, 0x14048ce67\nsub     r8, rcx; ElementCount                                          ; +0x12b, 0x14048ce6b\nmov     r9, rax; Stream                                                ; +0x12e, 0x14048ce6e\nmov     edx, 1; ElementSize                                            ; +0x131, 0x14048ce71\ncall    cs:fwrite                                                      ; +0x136, 0x14048ce76\nmov     rcx, rsi; Stream                                               ; +0x13c, 0x14048ce7c\ncall    cs:fclose                                                      ; +0x13f, 0x14048ce7f\nmov     rcx, rbx                                                       ; +0x145, 0x14048ce85\ncall    MusicDownloadManager__parseMusicLibrary                        ; +0x148, 0x14048ce88\nmov     rcx, [rbx+1C0h]                                                ; +0x14d, 0x14048ce8d\ntest    rcx, rcx                                                       ; +0x154, 0x14048ce94\njz      short loc_14048CEB2                                            ; +0x157, 0x14048ce97\ncall    cs:?count@CCDictionary@cocos2d@@QEAAIXZ; cocos2d::CCDictionary::count(void) ; +0x159, 0x14048ce99\ntest    eax, eax                                                       ; +0x15f, 0x14048ce9f\njz      short loc_14048CEB2                                            ; +0x161, 0x14048cea1\nmov     edx, 7                                                         ; +0x163, 0x14048cea3\nmov     rcx, rbx                                                       ; +0x168, 0x14048cea8\ncall    MusicDownloadManager__musicActionFinished                      ; +0x16b, 0x14048ceab\njmp     short loc_14048CEC0                                            ; +0x170, 0x14048ceb0\nmov     edx, 7                                                         ; +0x172, 0x14048ceb2\nmov     rcx, rbx                                                       ; +0x177, 0x14048ceb7\ncall    MusicDownloadManager__musicActionFailed                        ; +0x17a, 0x14048ceba\nnop                                                                    ; +0x17f, 0x14048cebf\nlea     rcx, [rsp+88h+FileName]                                        ; +0x180, 0x14048cec0\ncall    sub_14003D310                                                  ; +0x185, 0x14048cec5\njmp     short loc_14048CED9                                            ; +0x18a, 0x14048ceca\nmov     edx, 7                                                         ; +0x18c, 0x14048cecc\nmov     rcx, rbx                                                       ; +0x191, 0x14048ced1\ncall    MusicDownloadManager__musicActionFailed                        ; +0x194, 0x14048ced4\nmov     rcx, [rsp+88h+var_18]                                          ; +0x199, 0x14048ced9\nxor     rcx, rsp; StackCookie                                          ; +0x19e, 0x14048cede\ncall    __security_check_cookie                                        ; +0x1a1, 0x14048cee1\nlea     r11, [rsp+88h+var_8]                                           ; +0x1a6, 0x14048cee6\nmov     rbx, [r11+18h]                                                 ; +0x1ae, 0x14048ceee\nmov     rsi, [r11+28h]                                                 ; +0x1b2, 0x14048cef2\nmov     rsp, r11                                                       ; +0x1b6, 0x14048cef6\npop     rdi                                                            ; +0x1b9, 0x14048cef9\nretn                                                                   ; +0x1ba, 0x14048cefa", "xrefs": ["MusicDownloadManager::downloadMusicLibrary @ 0x14048cc4f", "<???> @ 0x140928dd8"], "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"}