{"type": "func", "start": 5373437696, "end": 5373437911, "name": "MusicDownloadManager::addMusicDownloadDelegate", "pseudocode": "// \n// MusicDownloadManager::addMusicDownloadDelegate from 0x140482700 to 0x1404827d7 (215 bytes)\n// \n// 12 xrefs:\n// > AudioAssetsBrowser::init @ 0x1400994e3\n// > AudioAssetsPopup::init @ 0x1400be364\n// > CustomSFXWidget::init @ 0x140161755\n// > CustomSongWidget::init @ 0x14016a61e\n// > EditorSoundConfigInfoLayer::FLAlert_Clicked @ 0x1401987e1\n// > EditorUI::init @ 0x1401ac33e\n// > MenuLayer::init @ 0x140473a13\n// > MusicBrowser::init @ 0x14047ba36\n// > NewsPopup::init @ 0x14049dce2\n// > SetupSongTriggerPopup::init @ 0x1405f3043\n// > SFXBrowser::init @ 0x14061886c\n// > <???> @ 0x1409289c4\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:45 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nvoid __fastcall MusicDownloadManager::addMusicDownloadDelegate(__int64 a1, __int64 a2)\n{\n  unsigned int v4; // ebx\n  cocos2d::CCNode *v5; // rbx\n\n  v4 = 0;\n  if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 336)) )\n  {\n    while ( *((_QWORD *)cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 336), v4) + 40) != a2 )\n    {\n      if ( ++v4 >= cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 336)) )\n        goto LABEL_4;\n    }\n  }\n  else\n  {\nLABEL_4:\n    v5 = (cocos2d::CCNode *)operator new(0x148u);\n    cocos2d::CCNode::CCNode(v5);\n    *(_QWORD *)v5 = &MusicDelegateHandler::`vftable';\n    *((_QWORD *)v5 + 40) = 0;\n    if ( cocos2d::CCNode::init(v5) )\n    {\n      *((_QWORD *)v5 + 40) = a2;\n      cocos2d::CCObject::autorelease(v5);\n    }\n    else\n    {\n      (*(void (__fastcall **)(cocos2d::CCNode *, __int64))(*(_QWORD *)v5 + 8LL))(v5, 1);\n      v5 = nullptr;\n    }\n    cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 336), v5);\n  }\n}", "assembly": "; \n; MusicDownloadManager::addMusicDownloadDelegate from 0x140482700 to 0x1404827d7 (215 bytes)\n; \n; 12 xrefs:\n; > AudioAssetsBrowser::init @ 0x1400994e3\n; > AudioAssetsPopup::init @ 0x1400be364\n; > CustomSFXWidget::init @ 0x140161755\n; > CustomSongWidget::init @ 0x14016a61e\n; > EditorSoundConfigInfoLayer::FLAlert_Clicked @ 0x1401987e1\n; > EditorUI::init @ 0x1401ac33e\n; > MenuLayer::init @ 0x140473a13\n; > MusicBrowser::init @ 0x14047ba36\n; > NewsPopup::init @ 0x14049dce2\n; > SetupSongTriggerPopup::init @ 0x1405f3043\n; > SFXBrowser::init @ 0x14061886c\n; > <???> @ 0x1409289c4\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:45 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x140482700\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x140482705\npush    rdi                                                            ; +0xa, 0x14048270a\nsub     rsp, 20h                                                       ; +0xb, 0x14048270b\nmov     rsi, rdx                                                       ; +0xf, 0x14048270f\nmov     rdi, rcx                                                       ; +0x12, 0x140482712\nxor     ebx, ebx                                                       ; +0x15, 0x140482715\nmov     rcx, [rcx+150h]                                                ; +0x17, 0x140482717\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x1e, 0x14048271e\ntest    eax, eax                                                       ; +0x24, 0x140482724\njz      short loc_14048275B                                            ; +0x26, 0x140482726\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x28, 0x140482728\nmov     edx, ebx                                                       ; +0x30, 0x140482730\nmov     rcx, [rdi+150h]                                                ; +0x32, 0x140482732\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x39, 0x140482739\ncmp     [rax+140h], rsi                                                ; +0x3f, 0x14048273f\njz      short loc_1404827C7                                            ; +0x46, 0x140482746\ninc     ebx                                                            ; +0x48, 0x140482748\nmov     rcx, [rdi+150h]                                                ; +0x4a, 0x14048274a\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x51, 0x140482751\ncmp     ebx, eax                                                       ; +0x57, 0x140482757\njb      short loc_140482730                                            ; +0x59, 0x140482759\nmov     ecx, 148h; Size                                                ; +0x5b, 0x14048275b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x60, 0x140482760\nmov     rbx, rax                                                       ; +0x65, 0x140482765\nmov     [rsp+28h+arg_0], rax                                           ; +0x68, 0x140482768\nmov     rcx, rax                                                       ; +0x6d, 0x14048276d\ncall    cs:??0CCNode@cocos2d@@QEAA@XZ; cocos2d::CCNode::CCNode(void)   ; +0x70, 0x140482770\nlea     rax, ??_7MusicDelegateHandler@@6B@; const MusicDelegateHandler::`vftable' ; +0x76, 0x140482776\nmov     [rbx], rax                                                     ; +0x7d, 0x14048277d\nmov     qword ptr [rbx+140h], 0                                        ; +0x80, 0x140482780\nmov     rcx, rbx                                                       ; +0x8b, 0x14048278b\ncall    cs:__imp_?init@CCNode@cocos2d@@UEAA_NXZ; cocos2d::CCNode::init(void) ; +0x8e, 0x14048278e\nmov     rcx, rbx                                                       ; +0x94, 0x140482794\ntest    al, al                                                         ; +0x97, 0x140482797\njnz     short loc_1404827AA                                            ; +0x99, 0x140482799\nmov     rax, [rbx]                                                     ; +0x9b, 0x14048279b\nmov     edx, 1                                                         ; +0x9e, 0x14048279e\ncall    qword ptr [rax+8]                                              ; +0xa3, 0x1404827a3\nxor     ebx, ebx                                                       ; +0xa6, 0x1404827a6\njmp     short loc_1404827B7                                            ; +0xa8, 0x1404827a8\nmov     [rbx+140h], rsi                                                ; +0xaa, 0x1404827aa\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0xb1, 0x1404827b1\nmov     rdx, rbx                                                       ; +0xb7, 0x1404827b7\nmov     rcx, [rdi+150h]                                                ; +0xba, 0x1404827ba\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xc1, 0x1404827c1\nmov     rbx, [rsp+28h+arg_8]                                           ; +0xc7, 0x1404827c7\nmov     rsi, [rsp+28h+arg_10]                                          ; +0xcc, 0x1404827cc\nadd     rsp, 20h                                                       ; +0xd1, 0x1404827d1\npop     rdi                                                            ; +0xd5, 0x1404827d5\nretn                                                                   ; +0xd6, 0x1404827d6", "xrefs": ["AudioAssetsBrowser::init @ 0x1400994e3", "AudioAssetsPopup::init @ 0x1400be364", "CustomSFXWidget::init @ 0x140161755", "CustomSongWidget::init @ 0x14016a61e", "EditorSoundConfigInfoLayer::FLAlert_Clicked @ 0x1401987e1", "EditorUI::init @ 0x1401ac33e", "MenuLayer::init @ 0x140473a13", "MusicBrowser::init @ 0x14047ba36", "NewsPopup::init @ 0x14049dce2", "SetupSongTriggerPopup::init @ 0x1405f3043", "SFXBrowser::init @ 0x14061886c", "<???> @ 0x1409289c4"], "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"}