{"type": "func", "start": 5373491856, "end": 5373492266, "name": "MusicDownloadManager::onDownloadSFXLibraryCompleted", "pseudocode": "// \n// MusicDownloadManager::onDownloadSFXLibraryCompleted from 0x14048fa90 to 0x14048fc2a (410 bytes)\n// \n// 2 xrefs:\n// > MusicDownloadManager::downloadSFXLibrary @ 0x14048f9bd\n// > <???> @ 0x140928e44\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:50 +0000\n// \n\n// Hidden C++ exception states: #wind=2\nvoid __fastcall MusicDownloadManager::onDownloadSFXLibraryCompleted(__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  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] = nullptr;\n  si128 = _mm_load_si128((const __m128i *)&xmmword_140836590);\n  Block[0] = (void *)0x6C5F7866735F6C64LL;\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::pathForSFXFolder(a1, FileName, 0);\n    sub_140044D80(FileName, \"sfxlibrary.dat\", 0xEu);\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    {\n      fwrite(*(const void **)(a3 + 72), 1u, *(_QWORD *)(a3 + 80) - *(_QWORD *)(a3 + 72), v7);\n      fclose(v8);\n      MusicDownloadManager::parseSFXLibrary(a1);\n      MusicDownloadManager::musicActionFinished(a1, 1);\n    }\n    else\n    {\n      MusicDownloadManager::musicActionFailed(a1, 1);\n    }\n    sub_14003D310((__int64)FileName);\n  }\n  else\n  {\n    MusicDownloadManager::musicActionFailed(a1, 1);\n  }\n}", "assembly": "; \n; MusicDownloadManager::onDownloadSFXLibraryCompleted from 0x14048fa90 to 0x14048fc2a (410 bytes)\n; \n; 2 xrefs:\n; > MusicDownloadManager::downloadSFXLibrary @ 0x14048f9bd\n; > <???> @ 0x140928e44\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:50 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x14048fa90\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x14048fa95\npush    rdi                                                            ; +0xa, 0x14048fa9a\nsub     rsp, 80h                                                       ; +0xb, 0x14048fa9b\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x14048faa2\nxor     rax, rsp                                                       ; +0x19, 0x14048faa9\nmov     [rsp+88h+var_18], rax                                          ; +0x1c, 0x14048faac\nmov     rdi, r8                                                        ; +0x21, 0x14048fab1\nmov     rbx, rcx                                                       ; +0x24, 0x14048fab4\nxorps   xmm0, xmm0                                                     ; +0x27, 0x14048fab7\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0x2a, 0x14048faba\nmovdqa  xmm1, cs:xmmword_140836590                                     ; +0x2f, 0x14048fabf\nmovdqu  [rsp+88h+var_48], xmm1                                         ; +0x37, 0x14048fac7\nmov     rax, 6C5F7866735F6C64h                                         ; +0x3d, 0x14048facd\nmov     [rsp+88h+Block], rax                                           ; +0x47, 0x14048fad7\nmov     byte ptr [rsp+88h+Block+8], 0                                  ; +0x4c, 0x14048fadc\nlea     rdx, [rsp+88h+Block]                                           ; +0x51, 0x14048fae1\nmov     rcx, [rcx+148h]                                                ; +0x56, 0x14048fae6\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 &) ; +0x5d, 0x14048faed\nnop                                                                    ; +0x63, 0x14048faf3\nmov     rdx, qword ptr [rsp+88h+var_48+8]                              ; +0x64, 0x14048faf4\ncmp     rdx, 0Fh                                                       ; +0x69, 0x14048faf9\njbe     short loc_14048FB47                                            ; +0x6d, 0x14048fafd\ninc     rdx                                                            ; +0x6f, 0x14048faff\nmov     rcx, [rsp+88h+Block]; Block                                    ; +0x72, 0x14048fb02\nmov     rax, rcx                                                       ; +0x77, 0x14048fb07\ncmp     rdx, 1000h                                                     ; +0x7a, 0x14048fb0a\njb      short loc_14048FB42                                            ; +0x81, 0x14048fb11\nadd     rdx, 27h ; '''                                                 ; +0x83, 0x14048fb13\nmov     rcx, [rcx-8]                                                   ; +0x87, 0x14048fb17\nsub     rax, rcx                                                       ; +0x8b, 0x14048fb1b\nsub     rax, 8                                                         ; +0x8e, 0x14048fb1e\ncmp     rax, 1Fh                                                       ; +0x92, 0x14048fb22\njbe     short loc_14048FB42                                            ; +0x96, 0x14048fb26\nmov     [rsp+88h+Reserved], 0; Reserved                                ; +0x98, 0x14048fb28\nxor     r9d, r9d; LineNo                                               ; +0xa1, 0x14048fb31\nxor     r8d, r8d; FileName                                             ; +0xa4, 0x14048fb34\nxor     edx, edx; FunctionName                                         ; +0xa7, 0x14048fb37\nxor     ecx, ecx; Expression                                           ; +0xa9, 0x14048fb39\ncall    cs:_invoke_watson                                              ; +0xab, 0x14048fb3b\nalign 2                                                                ; +0xb1, 0x14048fb41\ncall    j_j_free                                                       ; +0xb2, 0x14048fb42\ntest    rdi, rdi                                                       ; +0xb7, 0x14048fb47\njz      loc_14048FBFB                                                  ; +0xba, 0x14048fb4a\ncmp     byte ptr [rdi+40h], 0                                          ; +0xc0, 0x14048fb50\njz      loc_14048FBFB                                                  ; +0xc4, 0x14048fb54\nxor     r8d, r8d                                                       ; +0xca, 0x14048fb5a\nlea     rdx, [rsp+88h+FileName]                                        ; +0xcd, 0x14048fb5d\nmov     rcx, rbx                                                       ; +0xd2, 0x14048fb62\ncall    MusicDownloadManager__pathForSFXFolder                         ; +0xd5, 0x14048fb65\nnop                                                                    ; +0xda, 0x14048fb6a\nmov     r8d, 0Eh; Size                                                 ; +0xdb, 0x14048fb6b\nlea     rdx, aSfxlibraryDat; \"sfxlibrary.dat\"                          ; +0xe1, 0x14048fb71\nlea     rcx, [rsp+88h+FileName]; Src                                   ; +0xe8, 0x14048fb78\ncall    sub_140044D80                                                  ; +0xed, 0x14048fb7d\nlea     rcx, [rsp+88h+FileName]                                        ; +0xf2, 0x14048fb82\ncmp     [rsp+88h+var_20], 0Fh                                          ; +0xf7, 0x14048fb87\ncmova   rcx, [rsp+88h+FileName]; FileName                              ; +0xfd, 0x14048fb8d\nlea     rdx, aWb; \"wb\"                                                 ; +0x103, 0x14048fb93\ncall    cs:fopen                                                       ; +0x10a, 0x14048fb9a\nmov     rsi, rax                                                       ; +0x110, 0x14048fba0\ntest    rax, rax                                                       ; +0x113, 0x14048fba3\njnz     short loc_14048FBB7                                            ; +0x116, 0x14048fba6\nmov     edx, 1                                                         ; +0x118, 0x14048fba8\nmov     rcx, rbx                                                       ; +0x11d, 0x14048fbad\ncall    MusicDownloadManager__musicActionFailed                        ; +0x120, 0x14048fbb0\njmp     short loc_14048FBEF                                            ; +0x125, 0x14048fbb5\nmov     rcx, [rdi+48h]; Buffer                                         ; +0x127, 0x14048fbb7\nmov     r8, [rdi+50h]                                                  ; +0x12b, 0x14048fbbb\nsub     r8, rcx; ElementCount                                          ; +0x12f, 0x14048fbbf\nmov     r9, rsi; Stream                                                ; +0x132, 0x14048fbc2\nmov     edx, 1; ElementSize                                            ; +0x135, 0x14048fbc5\ncall    cs:fwrite                                                      ; +0x13a, 0x14048fbca\nmov     rcx, rsi; Stream                                               ; +0x140, 0x14048fbd0\ncall    cs:fclose                                                      ; +0x143, 0x14048fbd3\nmov     rcx, rbx                                                       ; +0x149, 0x14048fbd9\ncall    MusicDownloadManager__parseSFXLibrary                          ; +0x14c, 0x14048fbdc\nmov     edx, 1                                                         ; +0x151, 0x14048fbe1\nmov     rcx, rbx                                                       ; +0x156, 0x14048fbe6\ncall    MusicDownloadManager__musicActionFinished                      ; +0x159, 0x14048fbe9\nnop                                                                    ; +0x15e, 0x14048fbee\nlea     rcx, [rsp+88h+FileName]                                        ; +0x15f, 0x14048fbef\ncall    sub_14003D310                                                  ; +0x164, 0x14048fbf4\njmp     short loc_14048FC08                                            ; +0x169, 0x14048fbf9\nmov     edx, 1                                                         ; +0x16b, 0x14048fbfb\nmov     rcx, rbx                                                       ; +0x170, 0x14048fc00\ncall    MusicDownloadManager__musicActionFailed                        ; +0x173, 0x14048fc03\nmov     rcx, [rsp+88h+var_18]                                          ; +0x178, 0x14048fc08\nxor     rcx, rsp; StackCookie                                          ; +0x17d, 0x14048fc0d\ncall    __security_check_cookie                                        ; +0x180, 0x14048fc10\nlea     r11, [rsp+88h+var_8]                                           ; +0x185, 0x14048fc15\nmov     rbx, [r11+18h]                                                 ; +0x18d, 0x14048fc1d\nmov     rsi, [r11+28h]                                                 ; +0x191, 0x14048fc21\nmov     rsp, r11                                                       ; +0x195, 0x14048fc25\npop     rdi                                                            ; +0x198, 0x14048fc28\nretn                                                                   ; +0x199, 0x14048fc29", "xrefs": ["MusicDownloadManager::downloadSFXLibrary @ 0x14048f9bd", "<???> @ 0x140928e44"], "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"}