{"type": "func", "start": 5372127392, "end": 5372127700, "name": "MusicDownloadManager::onTryUpdateSFXLibraryCompleted", "pseudocode": "// \n// MusicDownloadManager::onTryUpdateSFXLibraryCompleted from 0x1403428a0 to 0x1403429d4 (308 bytes)\n// \n// 2 xrefs:\n// > MusicDownloadManager::tryUpdateSFXLibrary @ 0x1403427ba\n// > <???> @ 0x1406d57f8\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::onTryUpdateSFXLibraryCompleted(\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] = nullptr;\n  v8 = 7;\n  v9 = 15;\n  Block[0] = (void *)0x6C5F7866735F76LL;\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_sfxLibraryVersion )\n      MusicDownloadManager::musicActionFailed(a1, UpdateSFXLibrary);\n    else\n      MusicDownloadManager::downloadSFXLibrary(a1);\n    sub_14003A830((__int64)String);\n  }\n  else\n  {\n    MusicDownloadManager::musicActionFailed(a1, (GJMusicAction)3);\n  }\n}", "assembly": "; \n; MusicDownloadManager::onTryUpdateSFXLibraryCompleted from 0x1403428a0 to 0x1403429d4 (308 bytes)\n; \n; 2 xrefs:\n; > MusicDownloadManager::tryUpdateSFXLibrary @ 0x1403427ba\n; > <???> @ 0x1406d57f8\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, 0x1403428a0\npush    rdi                                                            ; +0x5, 0x1403428a5\nsub     rsp, 70h                                                       ; +0x6, 0x1403428a6\nmov     rax, cs:__security_cookie                                      ; +0xa, 0x1403428aa\nxor     rax, rsp                                                       ; +0x11, 0x1403428b1\nmov     [rsp+78h+var_18], rax                                          ; +0x14, 0x1403428b4\nmov     rdi, r8                                                        ; +0x19, 0x1403428b9\nmov     rbx, rcx                                                       ; +0x1c, 0x1403428bc\nxorps   xmm0, xmm0                                                     ; +0x1f, 0x1403428bf\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0x22, 0x1403428c2\nmov     [rsp+78h+var_48], 7                                            ; +0x27, 0x1403428c7\nmov     [rsp+78h+var_40], 0Fh                                          ; +0x30, 0x1403428d0\nmov     rax, cs:qword_1405AC828                                        ; +0x39, 0x1403428d9\nmov     dword ptr [rsp+78h+Block], eax                                 ; +0x40, 0x1403428e0\nmovzx   eax, word ptr cs:qword_1405AC828+4                             ; +0x44, 0x1403428e4\nmov     word ptr [rsp+78h+Block+4], ax                                 ; +0x4b, 0x1403428eb\nmovzx   eax, byte ptr cs:qword_1405AC828+6                             ; +0x50, 0x1403428f0\nmov     byte ptr [rsp+78h+Block+6], al                                 ; +0x57, 0x1403428f7\nmov     byte ptr [rsp+78h+Block+7], 0                                  ; +0x5b, 0x1403428fb\nlea     rdx, [rsp+78h+Block]                                           ; +0x60, 0x140342900\nmov     rcx, [rcx+148h]                                                ; +0x65, 0x140342905\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 &) ; +0x6c, 0x14034290c\nnop                                                                    ; +0x72, 0x140342912\nmov     rdx, [rsp+78h+var_40]                                          ; +0x73, 0x140342913\ncmp     rdx, 0Fh                                                       ; +0x78, 0x140342918\njbe     short loc_140342953                                            ; +0x7c, 0x14034291c\ninc     rdx                                                            ; +0x7e, 0x14034291e\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0x81, 0x140342921\nmov     rax, rcx                                                       ; +0x86, 0x140342926\ncmp     rdx, 1000h                                                     ; +0x89, 0x140342929\njb      short loc_14034294E                                            ; +0x90, 0x140342930\nadd     rdx, 27h ; '''                                                 ; +0x92, 0x140342932\nmov     rcx, [rcx-8]                                                   ; +0x96, 0x140342936\nsub     rax, rcx                                                       ; +0x9a, 0x14034293a\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x9d, 0x14034293d\ncmp     rax, 1Fh                                                       ; +0xa1, 0x140342941\njbe     short loc_14034294E                                            ; +0xa5, 0x140342945\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xa7, 0x140342947\nalign 2                                                                ; +0xad, 0x14034294d\ncall    j_j_free                                                       ; +0xae, 0x14034294e\ntest    rdi, rdi                                                       ; +0xb3, 0x140342953\njz      short loc_1403429AC                                            ; +0xb6, 0x140342956\ncmp     byte ptr [rdi+40h], 0                                          ; +0xb8, 0x140342958\njz      short loc_1403429AC                                            ; +0xbc, 0x14034295c\nmov     rdx, rdi                                                       ; +0xbe, 0x14034295e\nlea     rcx, [rsp+78h+String]                                          ; +0xc1, 0x140342961\ncall    GameToolbox__getResponse                                       ; +0xc6, 0x140342966\nnop                                                                    ; +0xcb, 0x14034296b\nlea     rcx, [rsp+78h+String]                                          ; +0xcc, 0x14034296c\ncmp     [rsp+78h+var_20], 0Fh                                          ; +0xd1, 0x140342971\ncmova   rcx, [rsp+78h+String]; String                                  ; +0xd7, 0x140342977\ncall    cs:atoi                                                        ; +0xdd, 0x14034297d\nmov     rcx, rbx                                                       ; +0xe3, 0x140342983\ncmp     eax, [rbx+1A0h]                                                ; +0xe6, 0x140342986\njle     short loc_140342995                                            ; +0xec, 0x14034298c\ncall    MusicDownloadManager__downloadSFXLibrary                       ; +0xee, 0x14034298e\njmp     short loc_1403429A0                                            ; +0xf3, 0x140342993\nmov     edx, 4                                                         ; +0xf5, 0x140342995\ncall    MusicDownloadManager__musicActionFailed                        ; +0xfa, 0x14034299a\nnop                                                                    ; +0xff, 0x14034299f\nlea     rcx, [rsp+78h+String]                                          ; +0x100, 0x1403429a0\ncall    sub_14003A830                                                  ; +0x105, 0x1403429a5\njmp     short loc_1403429B9                                            ; +0x10a, 0x1403429aa\nmov     edx, 3                                                         ; +0x10c, 0x1403429ac\nmov     rcx, rbx                                                       ; +0x111, 0x1403429b1\ncall    MusicDownloadManager__musicActionFailed                        ; +0x114, 0x1403429b4\nmov     rcx, [rsp+78h+var_18]                                          ; +0x119, 0x1403429b9\nxor     rcx, rsp; StackCookie                                          ; +0x11e, 0x1403429be\ncall    __security_check_cookie                                        ; +0x121, 0x1403429c1\nmov     rbx, [rsp+78h+arg_8]                                           ; +0x126, 0x1403429c6\nadd     rsp, 70h                                                       ; +0x12e, 0x1403429ce\npop     rdi                                                            ; +0x132, 0x1403429d2\nretn                                                                   ; +0x133, 0x1403429d3", "xrefs": ["MusicDownloadManager::tryUpdateSFXLibrary @ 0x1403427ba", "<???> @ 0x1406d57f8"], "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"}