{"type": "func", "start": 5373507152, "end": 5373507802, "name": "MusicDownloadManager::downloadNewsImage", "pseudocode": "// \n// MusicDownloadManager::downloadNewsImage from 0x140493650 to 0x1404938da (650 bytes)\n// \n// 4 xrefs:\n// > NewsPopup::rebuildPage @ 0x14049f73b\n// > NewsPopup::prefetchPageImages @ 0x14049fab7\n// > NewsPopup::onBlockClicked @ 0x14049fe50\n// > <???> @ 0x140928ef8\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:51 +0000\n// \n\n// Hidden C++ exception states: #wind=5\nvoid __fastcall MusicDownloadManager::downloadNewsImage(cocos2d::CCObject *a1, void **a2)\n{\n  __int64 v4; // rax\n  __int64 v5; // rbx\n  const char *v6; // rdx\n  cocos2d::CCString *v7; // rax\n  void *v8; // rdx\n  __int64 v9; // rcx\n  void **v10; // r15\n  char *v11; // r14\n  unsigned __int64 v12; // r13\n  __int64 v13; // rbx\n  unsigned __int64 v14; // rsi\n  const char *v15; // rbx\n  const char *v16; // rax\n  cocos2d::extension::CCHttpRequest *Request; // rax\n  char *v18; // rax\n  char *CString; // [rsp+30h] [rbp-D0h]\n  __int128 v20; // [rsp+38h] [rbp-C8h] BYREF\n  unsigned __int64 v21; // [rsp+48h] [rbp-B8h]\n  __int64 v22; // [rsp+50h] [rbp-B0h]\n  _BYTE *v23; // [rsp+58h] [rbp-A8h]\n  char v24[32]; // [rsp+68h] [rbp-98h] BYREF\n  _BYTE v25[32]; // [rsp+88h] [rbp-78h] BYREF\n  char v26[32]; // [rsp+A8h] [rbp-58h] BYREF\n  void **v27; // [rsp+C8h] [rbp-38h]\n  void *Src[2]; // [rsp+D0h] [rbp-30h] BYREF\n  unsigned __int64 v29; // [rsp+E0h] [rbp-20h]\n  unsigned __int64 v30; // [rsp+E8h] [rbp-18h]\n  void *v31[4]; // [rsp+F0h] [rbp-10h] BYREF\n\n  v27 = a2;\n  if ( *((_QWORD *)a1 + 48) && a2[2] )\n  {\n    v4 = sub_14003F4F0((__int64)v24, (__int64)a2);\n    v5 = v4;\n    v6 = (const char *)v4;\n    if ( *(_QWORD *)(v4 + 24) > 0xFu )\n      v6 = *(const char **)v4;\n    v7 = cocos2d::CCString::createWithFormat(\"news_%s\", v6);\n    CString = (char *)cocos2d::CCString::getCString(v7);\n    sub_14003D310(v5);\n    if ( !AchievementManager::getAchievementsWithID((__int64)a1, (__int64)CString) )\n    {\n      *(_OWORD *)Src = 0;\n      v29 = 6;\n      v30 = 15;\n      strcpy((char *)Src, \"/news/\");\n      v8 = a2;\n      if ( (unsigned __int64)a2[3] > 0xF )\n        v8 = *a2;\n      sub_140044D80(Src, v8, (size_t)a2[2]);\n      v20 = 0;\n      v21 = 0;\n      v22 = 0;\n      v10 = Src;\n      v11 = (char *)Src[0];\n      v12 = v30;\n      if ( v30 > 0xF )\n        v10 = (void **)Src[0];\n      v13 = 0x7FFFFFFFFFFFFFFFLL;\n      v14 = v29;\n      if ( v29 > 0x7FFFFFFFFFFFFFFFLL )\n        sub_140009D90(v9);\n      if ( v29 > 0xF )\n      {\n        if ( (v29 | 0xF) <= 0x7FFFFFFFFFFFFFFFLL )\n        {\n          v13 = v29 | 0xF;\n          if ( (v29 | 0xF) < 0x16 )\n            v13 = 22;\n        }\n        *(_QWORD *)&v20 = sub_14003D460(v13 + 1);\n        v21 = v14;\n        v22 = v13;\n        memcpy((void *)v20, v10, v14 + 1);\n      }\n      else\n      {\n        v21 = v29;\n        v22 = 15;\n        v20 = *(_OWORD *)v10;\n      }\n      MusicDownloadManager::generateCustomContentURL((__int64)a1, v31, (const char *)&v20);\n      v23 = v25;\n      v15 = (const char *)sub_14003F4F0((__int64)v25, (__int64)a2);\n      v16 = (const char *)sub_14003F4F0((__int64)v26, (__int64)v31);\n      Request = MusicDownloadManager::ProcessHttpGetRequest(\n                  a1,\n                  v16,\n                  v15,\n                  (__int64)MusicDownloadManager::onDownloadNewsImageCompleted,\n                  5,\n                  30);\n      MusicDownloadManager::addDLToActive((__int64)a1, CString, (__int64)Request);\n      sub_14003D310((__int64)v31);\n      if ( v12 > 0xF )\n      {\n        v18 = v11;\n        if ( v12 + 1 >= 0x1000 )\n        {\n          v11 = *((char **)v11 - 1);\n          if ( (unsigned __int64)(v18 - v11 - 8) > 0x1F )\n            invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n        }\n        j_j_free(v11);\n      }\n    }\n  }\n  sub_14003D310((__int64)a2);\n}", "assembly": "; \n; MusicDownloadManager::downloadNewsImage from 0x140493650 to 0x1404938da (650 bytes)\n; \n; 4 xrefs:\n; > NewsPopup::rebuildPage @ 0x14049f73b\n; > NewsPopup::prefetchPageImages @ 0x14049fab7\n; > NewsPopup::onBlockClicked @ 0x14049fe50\n; > <???> @ 0x140928ef8\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:51 +0000\n; \nmov     [rsp-8+arg_10], rbx                                            ; +0x0, 0x140493650\npush    rbp                                                            ; +0x5, 0x140493655\npush    rsi                                                            ; +0x6, 0x140493656\npush    rdi                                                            ; +0x7, 0x140493657\npush    r12                                                            ; +0x8, 0x140493658\npush    r13                                                            ; +0xa, 0x14049365a\npush    r14                                                            ; +0xc, 0x14049365c\npush    r15                                                            ; +0xe, 0x14049365e\nlea     rbp, [rsp-20h]                                                 ; +0x10, 0x140493660\nsub     rsp, 120h                                                      ; +0x15, 0x140493665\nmov     rax, cs:__security_cookie                                      ; +0x1c, 0x14049366c\nxor     rax, rsp                                                       ; +0x23, 0x140493673\nmov     [rbp+50h+var_40], rax                                          ; +0x26, 0x140493676\nmov     rdi, rdx                                                       ; +0x2a, 0x14049367a\nmov     r12, rcx                                                       ; +0x2d, 0x14049367d\nmov     [rbp+50h+var_88], rdx                                          ; +0x30, 0x140493680\ncmp     qword ptr [rcx+180h], 0                                        ; +0x34, 0x140493684\njz      loc_1404938A5                                                  ; +0x3c, 0x14049368c\ncmp     qword ptr [rdx+10h], 0                                         ; +0x42, 0x140493692\njz      loc_1404938A5                                                  ; +0x47, 0x140493697\nlea     rcx, [rsp+150h+var_E8]                                         ; +0x4d, 0x14049369d\ncall    sub_14003F4F0                                                  ; +0x52, 0x1404936a2\nmov     rbx, rax                                                       ; +0x57, 0x1404936a7\nmov     [rsp+150h+var_120], rax                                        ; +0x5a, 0x1404936aa\nmov     rdx, rax                                                       ; +0x5f, 0x1404936af\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x62, 0x1404936b2\njbe     short loc_1404936BC                                            ; +0x67, 0x1404936b7\nmov     rdx, [rax]                                                     ; +0x69, 0x1404936b9\nlea     rcx, aNewsS; \"news_%s\"                                         ; +0x6c, 0x1404936bc\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x73, 0x1404936c3\nmov     rcx, rax                                                       ; +0x79, 0x1404936c9\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x7c, 0x1404936cc\nmov     rsi, rax                                                       ; +0x82, 0x1404936d2\nmov     [rsp+150h+var_120], rax                                        ; +0x85, 0x1404936d5\nmov     rcx, rbx                                                       ; +0x8a, 0x1404936da\ncall    sub_14003D310                                                  ; +0x8d, 0x1404936dd\nmov     rdx, rsi                                                       ; +0x92, 0x1404936e2\nmov     rcx, r12                                                       ; +0x95, 0x1404936e5\ncall    AchievementManager__getAchievementsWithID; Merged with: AchievementManager::getAchievementsWithID, MusicDownloadManager::getDLObject ; +0x98, 0x1404936e8\ntest    rax, rax                                                       ; +0x9d, 0x1404936ed\njnz     loc_1404938A5                                                  ; +0xa0, 0x1404936f0\nxorps   xmm0, xmm0                                                     ; +0xa6, 0x1404936f6\nmovups  xmmword ptr [rbp+50h+Src], xmm0                                ; +0xa9, 0x1404936f9\nmov     [rbp+50h+var_70], 6                                            ; +0xad, 0x1404936fd\nmov     [rbp+50h+var_68], 0Fh                                          ; +0xb5, 0x140493705\nmov     eax, cs:dword_1407B8420                                        ; +0xbd, 0x14049370d\nmov     dword ptr [rbp+50h+Src], eax                                   ; +0xc3, 0x140493713\nmovzx   eax, cs:word_1407B8424                                         ; +0xc6, 0x140493716\nmov     word ptr [rbp+50h+Src+4], ax                                   ; +0xcd, 0x14049371d\nmov     byte ptr [rbp+50h+Src+6], 0                                    ; +0xd1, 0x140493721\nmov     rdx, rdi                                                       ; +0xd5, 0x140493725\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0xd8, 0x140493728\njbe     short loc_140493732                                            ; +0xdd, 0x14049372d\nmov     rdx, [rdi]; void *                                             ; +0xdf, 0x14049372f\nmov     r8, [rdi+10h]; Size                                            ; +0xe2, 0x140493732\nlea     rcx, [rbp+50h+Src]; Src                                        ; +0xe6, 0x140493736\ncall    sub_140044D80                                                  ; +0xea, 0x14049373a\nxorps   xmm0, xmm0                                                     ; +0xef, 0x14049373f\nmovups  [rsp+150h+var_118], xmm0                                       ; +0xf2, 0x140493742\nxor     eax, eax                                                       ; +0xf7, 0x140493747\nmov     [rsp+150h+var_108], rax                                        ; +0xf9, 0x140493749\nmov     [rsp+150h+var_100], rax                                        ; +0xfe, 0x14049374e\nlea     r15, [rbp+50h+Src]                                             ; +0x103, 0x140493753\nmov     r14, [rbp+50h+Src]                                             ; +0x107, 0x140493757\nmov     r13, [rbp+50h+var_68]                                          ; +0x10b, 0x14049375b\ncmp     r13, 0Fh                                                       ; +0x10f, 0x14049375f\ncmova   r15, r14                                                       ; +0x113, 0x140493763\nmov     rbx, 7FFFFFFFFFFFFFFFh                                         ; +0x117, 0x140493767\nmov     rsi, [rbp+50h+var_70]                                          ; +0x121, 0x140493771\ncmp     rsi, rbx                                                       ; +0x125, 0x140493775\nja      loc_1404938D4                                                  ; +0x128, 0x140493778\ncmp     rsi, 0Fh                                                       ; +0x12e, 0x14049377e\nja      short loc_14049379D                                            ; +0x132, 0x140493782\nmov     [rsp+150h+var_108], rsi                                        ; +0x134, 0x140493784\nmov     [rsp+150h+var_100], 0Fh                                        ; +0x139, 0x140493789\nmovups  xmm0, xmmword ptr [r15]                                        ; +0x142, 0x140493792\nmovups  [rsp+150h+var_118], xmm0                                       ; +0x146, 0x140493796\njmp     short loc_1404937DF                                            ; +0x14b, 0x14049379b\nmov     rax, rsi                                                       ; +0x14d, 0x14049379d\nor      rax, 0Fh                                                       ; +0x150, 0x1404937a0\ncmp     rax, rbx                                                       ; +0x154, 0x1404937a4\nja      short loc_1404937B8                                            ; +0x157, 0x1404937a7\nmov     rbx, rax                                                       ; +0x159, 0x1404937a9\nmov     ecx, 16h                                                       ; +0x15c, 0x1404937ac\ncmp     rax, rcx                                                       ; +0x161, 0x1404937b1\ncmovb   rbx, rcx                                                       ; +0x164, 0x1404937b4\nlea     rcx, [rbx+1]                                                   ; +0x168, 0x1404937b8\ncall    sub_14003D460                                                  ; +0x16c, 0x1404937bc\nmov     qword ptr [rsp+150h+var_118], rax                              ; +0x171, 0x1404937c1\nmov     [rsp+150h+var_108], rsi                                        ; +0x176, 0x1404937c6\nmov     [rsp+150h+var_100], rbx                                        ; +0x17b, 0x1404937cb\nlea     r8, [rsi+1]; Size                                              ; +0x180, 0x1404937d0\nmov     rdx, r15; Src                                                  ; +0x184, 0x1404937d4\nmov     rcx, rax; void *                                               ; +0x187, 0x1404937d7\ncall    memcpy                                                         ; +0x18a, 0x1404937da\nlea     r8, [rsp+150h+var_118]                                         ; +0x18f, 0x1404937df\nlea     rdx, [rbp+50h+var_60]                                          ; +0x194, 0x1404937e4\nmov     rcx, r12                                                       ; +0x198, 0x1404937e8\ncall    MusicDownloadManager__generateCustomContentURL                 ; +0x19b, 0x1404937eb\nnop                                                                    ; +0x1a0, 0x1404937f0\nlea     rax, [rbp+50h+var_C8]                                          ; +0x1a1, 0x1404937f1\nmov     [rsp+150h+var_F8], rax                                         ; +0x1a5, 0x1404937f5\nmov     rdx, rdi                                                       ; +0x1aa, 0x1404937fa\nlea     rcx, [rbp+50h+var_C8]                                          ; +0x1ad, 0x1404937fd\ncall    sub_14003F4F0                                                  ; +0x1b1, 0x140493801\nmov     rbx, rax                                                       ; +0x1b6, 0x140493806\nlea     rdx, [rbp+50h+var_60]                                          ; +0x1b9, 0x140493809\nlea     rcx, [rbp+50h+var_A8]                                          ; +0x1bd, 0x14049380d\ncall    sub_14003F4F0                                                  ; +0x1c1, 0x140493811\nnop                                                                    ; +0x1c6, 0x140493816\nmov     [rsp+150h+var_128], 1Eh                                        ; +0x1c7, 0x140493817\nmov     dword ptr [rsp+150h+Reserved], 5                               ; +0x1cf, 0x14049381f\nlea     r9, MusicDownloadManager__onDownloadNewsImageCompleted         ; +0x1d7, 0x140493827\nmov     r8, rbx                                                        ; +0x1de, 0x14049382e\nmov     rdx, rax                                                       ; +0x1e1, 0x140493831\nmov     rcx, r12                                                       ; +0x1e4, 0x140493834\ncall    MusicDownloadManager__ProcessHttpGetRequest                    ; +0x1e7, 0x140493837\nmov     r8, rax                                                        ; +0x1ec, 0x14049383c\nmov     rdx, [rsp+150h+var_120]                                        ; +0x1ef, 0x14049383f\nmov     rcx, r12                                                       ; +0x1f4, 0x140493844\ncall    MusicDownloadManager__addDLToActive                            ; +0x1f7, 0x140493847\nnop                                                                    ; +0x1fc, 0x14049384c\nlea     rcx, [rbp+50h+var_60]                                          ; +0x1fd, 0x14049384d\ncall    sub_14003D310                                                  ; +0x201, 0x140493851\nnop                                                                    ; +0x206, 0x140493856\ncmp     r13, 0Fh                                                       ; +0x207, 0x140493857\njbe     short loc_1404938A5                                            ; +0x20b, 0x14049385b\nlea     rdx, [r13+1]                                                   ; +0x20d, 0x14049385d\nmov     rax, r14                                                       ; +0x211, 0x140493861\ncmp     rdx, 1000h                                                     ; +0x214, 0x140493864\njb      short loc_14049389C                                            ; +0x21b, 0x14049386b\nadd     rdx, 27h ; '''                                                 ; +0x21d, 0x14049386d\nmov     r14, [r14-8]                                                   ; +0x221, 0x140493871\nsub     rax, r14                                                       ; +0x225, 0x140493875\nsub     rax, 8                                                         ; +0x228, 0x140493878\ncmp     rax, 1Fh                                                       ; +0x22c, 0x14049387c\njbe     short loc_14049389C                                            ; +0x230, 0x140493880\nmov     [rsp+150h+Reserved], 0; Reserved                               ; +0x232, 0x140493882\nxor     r9d, r9d; LineNo                                               ; +0x23b, 0x14049388b\nxor     r8d, r8d; FileName                                             ; +0x23e, 0x14049388e\nxor     edx, edx; FunctionName                                         ; +0x241, 0x140493891\nxor     ecx, ecx; Expression                                           ; +0x243, 0x140493893\ncall    cs:_invoke_watson                                              ; +0x245, 0x140493895\nalign 4                                                                ; +0x24b, 0x14049389b\nmov     rcx, r14; Block                                                ; +0x24c, 0x14049389c\ncall    j_j_free                                                       ; +0x24f, 0x14049389f\nnop                                                                    ; +0x254, 0x1404938a4\nmov     rcx, rdi                                                       ; +0x255, 0x1404938a5\ncall    sub_14003D310                                                  ; +0x258, 0x1404938a8\nmov     rcx, [rbp+50h+var_40]                                          ; +0x25d, 0x1404938ad\nxor     rcx, rsp; StackCookie                                          ; +0x261, 0x1404938b1\ncall    __security_check_cookie                                        ; +0x264, 0x1404938b4\nmov     rbx, [rsp+150h+arg_10]                                         ; +0x269, 0x1404938b9\nadd     rsp, 120h                                                      ; +0x271, 0x1404938c1\npop     r15                                                            ; +0x278, 0x1404938c8\npop     r14                                                            ; +0x27a, 0x1404938ca\npop     r13                                                            ; +0x27c, 0x1404938cc\npop     r12                                                            ; +0x27e, 0x1404938ce\npop     rdi                                                            ; +0x280, 0x1404938d0\npop     rsi                                                            ; +0x281, 0x1404938d1\npop     rbp                                                            ; +0x282, 0x1404938d2\nretn                                                                   ; +0x283, 0x1404938d3\ncall    sub_140009D90                                                  ; +0x284, 0x1404938d4\nalign 2                                                                ; +0x289, 0x1404938d9", "xrefs": ["NewsPopup::rebuildPage @ 0x14049f73b", "NewsPopup::prefetchPageImages @ 0x14049fab7", "NewsPopup::onBlockClicked @ 0x14049fe50", "<???> @ 0x140928ef8"], "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"}