{"type": "func", "start": 5372119056, "end": 5372119355, "name": "MusicDownloadManager::onTryUpdateMusicLibraryCompleted", "pseudocode": "// \n// MusicDownloadManager::onTryUpdateMusicLibraryCompleted from 0x140340810 to 0x14034093b (299 bytes)\n// \n// 2 xrefs:\n// > MusicDownloadManager::tryUpdateMusicLibrary @ 0x14034072d\n// > <???> @ 0x1406d575c\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 MusicDownloadManager::onTryUpdateMusicLibraryCompleted(\n        MusicDownloadManager *a1,\n        cocos2d::extension::CCHttpClient *a2,\n        cocos2d::extension::CCHttpResponse *a3)\n{\n  void *v5; // rcx\n  const char *v6; // rcx\n  void *Block[2]; // [rsp+20h] [rbp-58h] BYREF\n  __int64 v8; // [rsp+30h] [rbp-48h]\n  unsigned __int64 v9; // [rsp+38h] [rbp-40h]\n  char *String[4]; // [rsp+40h] [rbp-38h] BYREF\n\n  Block[1] = (void *)108;\n  v8 = 9;\n  v9 = 15;\n  Block[0] = (void *)0x5F636973756D5F76LL;\n  cocos2d::CCDictionary::removeObjectForKey(a1->m_activeDownloads, Block);\n  if ( v9 > 0xF )\n  {\n    v5 = Block[0];\n    if ( v9 + 1 >= 0x1000 )\n    {\n      v5 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v5);\n  }\n  if ( a3 && a3->_succeed )\n  {\n    GameToolbox::getResponse((__int64)String, (__int64)a3);\n    v6 = (const char *)String;\n    if ( String[3] > (char *)0xF )\n      v6 = String[0];\n    if ( atoi(v6) <= a1->m_musicLibraryVersion )\n      MusicDownloadManager::musicActionFailed(a1, UpdateMusicLibrary);\n    else\n      MusicDownloadManager::downloadMusicLibrary(a1);\n    sub_14003A830((__int64)String);\n  }\n  else\n  {\n    MusicDownloadManager::musicActionFailed(a1, (GJMusicAction)5);\n  }\n}", "assembly": "; \n; MusicDownloadManager::onTryUpdateMusicLibraryCompleted from 0x140340810 to 0x14034093b (299 bytes)\n; \n; 2 xrefs:\n; > MusicDownloadManager::tryUpdateMusicLibrary @ 0x14034072d\n; > <???> @ 0x1406d575c\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_8], rbx                                               ; +0x0, 0x140340810\npush    rdi                                                            ; +0x5, 0x140340815\nsub     rsp, 70h                                                       ; +0x6, 0x140340816\nmov     rax, cs:__security_cookie                                      ; +0xa, 0x14034081a\nxor     rax, rsp                                                       ; +0x11, 0x140340821\nmov     [rsp+78h+var_18], rax                                          ; +0x14, 0x140340824\nmov     rdi, r8                                                        ; +0x19, 0x140340829\nmov     rbx, rcx                                                       ; +0x1c, 0x14034082c\nxorps   xmm0, xmm0                                                     ; +0x1f, 0x14034082f\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0x22, 0x140340832\nmov     [rsp+78h+var_48], 9                                            ; +0x27, 0x140340837\nmov     [rsp+78h+var_40], 0Fh                                          ; +0x30, 0x140340840\nmovsd   xmm0, cs:qword_1405AC7A8                                       ; +0x39, 0x140340849\nmovsd   [rsp+78h+Block], xmm0                                          ; +0x41, 0x140340851\nmovzx   eax, cs:byte_1405AC7B0                                         ; +0x47, 0x140340857\nmov     byte ptr [rsp+78h+Block+8], al                                 ; +0x4e, 0x14034085e\nmov     byte ptr [rsp+78h+Block+9], 0                                  ; +0x52, 0x140340862\nlea     rdx, [rsp+78h+Block]                                           ; +0x57, 0x140340867\nmov     rcx, [rcx+148h]                                                ; +0x5c, 0x14034086c\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 &) ; +0x63, 0x140340873\nnop                                                                    ; +0x69, 0x140340879\nmov     rdx, [rsp+78h+var_40]                                          ; +0x6a, 0x14034087a\ncmp     rdx, 0Fh                                                       ; +0x6f, 0x14034087f\njbe     short loc_1403408BA                                            ; +0x73, 0x140340883\ninc     rdx                                                            ; +0x75, 0x140340885\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0x78, 0x140340888\nmov     rax, rcx                                                       ; +0x7d, 0x14034088d\ncmp     rdx, 1000h                                                     ; +0x80, 0x140340890\njb      short loc_1403408B5                                            ; +0x87, 0x140340897\nadd     rdx, 27h ; '''                                                 ; +0x89, 0x140340899\nmov     rcx, [rcx-8]                                                   ; +0x8d, 0x14034089d\nsub     rax, rcx                                                       ; +0x91, 0x1403408a1\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x94, 0x1403408a4\ncmp     rax, 1Fh                                                       ; +0x98, 0x1403408a8\njbe     short loc_1403408B5                                            ; +0x9c, 0x1403408ac\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x9e, 0x1403408ae\ndb 0CCh                                                                ; +0xa4, 0x1403408b4\ncall    j_j_free                                                       ; +0xa5, 0x1403408b5\ntest    rdi, rdi                                                       ; +0xaa, 0x1403408ba\njz      short loc_140340913                                            ; +0xad, 0x1403408bd\ncmp     byte ptr [rdi+40h], 0                                          ; +0xaf, 0x1403408bf\njz      short loc_140340913                                            ; +0xb3, 0x1403408c3\nmov     rdx, rdi                                                       ; +0xb5, 0x1403408c5\nlea     rcx, [rsp+78h+String]                                          ; +0xb8, 0x1403408c8\ncall    GameToolbox__getResponse                                       ; +0xbd, 0x1403408cd\nnop                                                                    ; +0xc2, 0x1403408d2\nlea     rcx, [rsp+78h+String]                                          ; +0xc3, 0x1403408d3\ncmp     [rsp+78h+var_20], 0Fh                                          ; +0xc8, 0x1403408d8\ncmova   rcx, [rsp+78h+String]; String                                  ; +0xce, 0x1403408de\ncall    cs:atoi                                                        ; +0xd4, 0x1403408e4\nmov     rcx, rbx                                                       ; +0xda, 0x1403408ea\ncmp     eax, [rbx+1D0h]                                                ; +0xdd, 0x1403408ed\njle     short loc_1403408FC                                            ; +0xe3, 0x1403408f3\ncall    MusicDownloadManager__downloadMusicLibrary                     ; +0xe5, 0x1403408f5\njmp     short loc_140340907                                            ; +0xea, 0x1403408fa\nmov     edx, 6                                                         ; +0xec, 0x1403408fc\ncall    MusicDownloadManager__musicActionFailed                        ; +0xf1, 0x140340901\nnop                                                                    ; +0xf6, 0x140340906\nlea     rcx, [rsp+78h+String]                                          ; +0xf7, 0x140340907\ncall    sub_14003A830                                                  ; +0xfc, 0x14034090c\njmp     short loc_140340920                                            ; +0x101, 0x140340911\nmov     edx, 5                                                         ; +0x103, 0x140340913\nmov     rcx, rbx                                                       ; +0x108, 0x140340918\ncall    MusicDownloadManager__musicActionFailed                        ; +0x10b, 0x14034091b\nmov     rcx, [rsp+78h+var_18]                                          ; +0x110, 0x140340920\nxor     rcx, rsp; StackCookie                                          ; +0x115, 0x140340925\ncall    __security_check_cookie                                        ; +0x118, 0x140340928\nmov     rbx, [rsp+78h+arg_8]                                           ; +0x11d, 0x14034092d\nadd     rsp, 70h                                                       ; +0x125, 0x140340935\npop     rdi                                                            ; +0x129, 0x140340939\nretn                                                                   ; +0x12a, 0x14034093a", "xrefs": ["MusicDownloadManager::tryUpdateMusicLibrary @ 0x14034072d", "<???> @ 0x1406d575c"], "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"}