{"type": "func", "start": 13426376, "end": 13426724, "name": "EditorSoundConfigInfoLayer::onFavorite", "pseudocode": "// \n// EditorSoundConfigInfoLayer::onFavorite from 0xccdec8 to 0xcce024 (348 bytes)\n// \n// 4 xrefs:\n// > EditorSoundConfigInfoLayer::downloadEditorSoundFinished @ 0xccf468\n// > <???> @ 0xb7280\n// > EditorSoundConfigInfoLayer::init @ 0xcd1e4c\n// > <???> @ 0x1545478\n// \n// This function is hookable on this platform (idp: arm, 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 13:06:25 +0000\n// \n\n__int64 __fastcall EditorSoundConfigInfoLayer::onFavorite(EditorSoundConfigInfoLayer *this, cocos2d::CCObject *a2)\n{\n  EditorSFXManager *v3; // x0\n  EditorSFXManager *v4; // x0\n  EditorSFXManager *v5; // x0\n  EditorSFXManager *FavoriteConfig; // x0\n  EditorSFXManager *v7; // x0\n  EditorSoundBrowserLayer *v8; // x0\n  EditorSFXManager *v10; // x0\n  EditorSFXManager *FavoriteConfigs; // x0\n  __int64 v12; // x0\n  __int64 v13; // x0\n  __int64 v14[2]; // [xsp+20h] [xbp+20h] BYREF\n  void *v15; // [xsp+30h] [xbp+30h]\n\n  v3 = *((EditorSFXManager **)this + 136);\n  if ( v3 )\n  {\n    v4 = (EditorSFXManager *)EditorSFXManager::sharedState(v3);\n    if ( v4\n      && (v5 = (EditorSFXManager *)EditorSFXManager::sharedState(v4),\n          (FavoriteConfig = (EditorSFXManager *)EditorSFXManager::getFavoriteConfig(\n                                                  v5,\n                                                  *(_DWORD *)(*((_QWORD *)this + 136) + 316LL))) != nullptr) )\n    {\n      v7 = (EditorSFXManager *)EditorSFXManager::sharedState(FavoriteConfig);\n      EditorSFXManager::removeFavoriteConfig(v7, *(_DWORD *)(*((_QWORD *)this + 136) + 316LL));\n      EditorSoundConfigInfoLayer::refreshActionButtons(this);\n      v8 = *((EditorSoundBrowserLayer **)this + 138);\n      if ( v8 )\n        EditorSoundBrowserLayer::onConfigListChanged(v8);\n    }\n    else if ( *(_BYTE *)(*((_QWORD *)this + 136) + 496LL) )\n    {\n      v10 = (EditorSFXManager *)EditorSFXManager::sharedState((EditorSFXManager *)*(unsigned __int8 *)(*((_QWORD *)this + 136) + 496LL));\n      FavoriteConfigs = (EditorSFXManager *)EditorSFXManager::getFavoriteConfigs(v10);\n      if ( FavoriteConfigs\n        && (FavoriteConfigs = (EditorSFXManager *)cocos2d::CCArray::count(FavoriteConfigs),\n            (unsigned int)FavoriteConfigs > 0x31) )\n      {\n        v14[0] = 0;\n        v14[1] = 0;\n        v15 = nullptr;\n        std::string::__init(v14, \"You have reached the maximum of 50 favorites. Remove some first.\", 0x40u);\n        v12 = FLAlertLayer::create(\n                0,\n                (cocos2d::CCLabelBMFont *)\"Limit Reached\",\n                (char *)v14,\n                (ButtonSprite *)\"OK\",\n                nullptr);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)v12 + 1312LL))(v12);\n        if ( (v14[0] & 1) != 0 )\n          operator delete(v15);\n      }\n      else\n      {\n        v13 = EditorSFXManager::sharedState(FavoriteConfigs);\n        EditorSFXManager::addFavoriteConfig(v13, *((GJEditorSoundConfig **)this + 136));\n        EditorSoundConfigInfoLayer::refreshActionButtons(this);\n      }\n    }\n    else\n    {\n      *((_BYTE *)this + 1121) = 1;\n      EditorSoundConfigInfoLayer::startDownload((__int64)this);\n    }\n  }\n  return _stack_chk_guard;\n}", "assembly": "; \n; EditorSoundConfigInfoLayer::onFavorite from 0xccdec8 to 0xcce024 (348 bytes)\n; \n; 4 xrefs:\n; > EditorSoundConfigInfoLayer::downloadEditorSoundFinished @ 0xccf468\n; > <???> @ 0xb7280\n; > EditorSoundConfigInfoLayer::init @ 0xcd1e4c\n; > <???> @ 0x1545478\n; \n; This function is hookable on this platform (idp: arm, 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 13:06:25 +0000\n; \nSTP             X29, X30, [SP,#var_40]!                                ; +0x0, 0xccdec8\nMOV             X29, SP                                                ; +0x4, 0xccdecc\nSTP             X19, X20, [SP,#0x40+var_30]                            ; +0x8, 0xccded0\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0xccded4\nMOV             X20, X0                                                ; +0x10, 0xccded8\nLDR             X0, [X0,#0x440]; this                                  ; +0x14, 0xccdedc\nLDR             X1, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x18, 0xccdee0\nLDR             X1, [X1]                                               ; +0x1c, 0xccdee4\nSTR             X1, [X29,#0x40+var_8]                                  ; +0x20, 0xccdee8\nCBZ             X0, loc_CCDF30                                         ; +0x24, 0xccdeec\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x28, 0xccdef0\nCBZ             X0, loc_CCDF50                                         ; +0x2c, 0xccdef4\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x30, 0xccdef8\nLDR             X1, [X20,#0x440]                                       ; +0x34, 0xccdefc\nLDR             W1, [X1,#0x13C]; int                                   ; +0x38, 0xccdf00\nBL              _ZN16EditorSFXManager17getFavoriteConfigEi; EditorSFXManager::getFavoriteConfig(int) ; +0x3c, 0xccdf04\nCBZ             X0, loc_CCDF50                                         ; +0x40, 0xccdf08\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x44, 0xccdf0c\nLDR             X1, [X20,#0x440]                                       ; +0x48, 0xccdf10\nLDR             W1, [X1,#0x13C]; int                                   ; +0x4c, 0xccdf14\nBL              _ZN16EditorSFXManager20removeFavoriteConfigEi; EditorSFXManager::removeFavoriteConfig(int) ; +0x50, 0xccdf18\nMOV             X0, X20; this                                          ; +0x54, 0xccdf1c\nBL              _ZN26EditorSoundConfigInfoLayer20refreshActionButtonsEv; EditorSoundConfigInfoLayer::refreshActionButtons(void) ; +0x58, 0xccdf20\nLDR             X0, [X20,#0x450]; this                                 ; +0x5c, 0xccdf24\nCBZ             X0, loc_CCDF30                                         ; +0x60, 0xccdf28\nBL              _ZN23EditorSoundBrowserLayer19onConfigListChangedEv; EditorSoundBrowserLayer::onConfigListChanged(void) ; +0x64, 0xccdf2c\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x68, 0xccdf30\nLDR             X1, [X29,#0x40+var_8]                                  ; +0x6c, 0xccdf34\nLDR             X0, [X19]                                              ; +0x70, 0xccdf38\nCMP             X1, X0                                                 ; +0x74, 0xccdf3c\nB.NE            loc_CCE004                                             ; +0x78, 0xccdf40\nLDP             X19, X20, [SP,#0x40+var_30]                            ; +0x7c, 0xccdf44\nLDP             X29, X30, [SP+0x40+var_40],#0x40                       ; +0x80, 0xccdf48\nRET                                                                    ; +0x84, 0xccdf4c\nLDR             X0, [X20,#0x440]                                       ; +0x88, 0xccdf50\nLDRB            W0, [X0,#0x1F0]; this                                  ; +0x8c, 0xccdf54\nCBZ             W0, loc_CCDFD8                                         ; +0x90, 0xccdf58\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x94, 0xccdf5c\nBL              _ZN16EditorSFXManager18getFavoriteConfigsEv; EditorSFXManager::getFavoriteConfigs(void) ; +0x98, 0xccdf60\nCBZ             X0, loc_CCDFEC                                         ; +0x9c, 0xccdf64\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xa0, 0xccdf68\nCMP             W0, #0x31 ; '1'                                        ; +0xa4, 0xccdf6c\nB.LS            loc_CCDFEC                                             ; +0xa8, 0xccdf70\nADD             X20, X29, #0x40+var_20                                 ; +0xac, 0xccdf74\nADRP            X1, #aYouHaveReached_1@PAGE; \"You have reached the maximum of 50 favo\"... ; +0xb0, 0xccdf78\nMOV             X0, X20                                                ; +0xb4, 0xccdf7c\nADD             X1, X1, #aYouHaveReached_1@PAGEOFF; \"You have reached the maximum of 50 favo\"... ; +0xb8, 0xccdf80\nMOV             X2, #0x40 ; '@'                                        ; +0xbc, 0xccdf84\nSTR             XZR, [X29,#0x40+var_20]                                ; +0xc0, 0xccdf88\nSTR             XZR, [X29,#0x40+var_18]                                ; +0xc4, 0xccdf8c\nSTR             XZR, [X29,#0x40+var_10]                                ; +0xc8, 0xccdf90\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm; std::string::__init(char const*,ulong) ; +0xcc, 0xccdf94\nADRP            X1, #aLimitReached@PAGE; \"Limit Reached\"               ; +0xd0, 0xccdf98\nADRP            X3, #aOk@PAGE; \"OK\"                                    ; +0xd4, 0xccdf9c\nMOV             X0, #0                                                 ; +0xd8, 0xccdfa0\nADD             X1, X1, #aLimitReached@PAGEOFF; \"Limit Reached\"        ; +0xdc, 0xccdfa4\nMOV             X2, X20                                                ; +0xe0, 0xccdfa8\nADD             X3, X3, #aOk@PAGEOFF; \"OK\"                             ; +0xe4, 0xccdfac\nMOV             X4, #0                                                 ; +0xe8, 0xccdfb0\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*) ; +0xec, 0xccdfb4\nLDR             X1, [X0]                                               ; +0xf0, 0xccdfb8\nLDR             X1, [X1,#0x520]                                        ; +0xf4, 0xccdfbc\nBLR             X1                                                     ; +0xf8, 0xccdfc0\nLDRB            W0, [X29,#0x40+var_20]                                 ; +0xfc, 0xccdfc4\nTBZ             W0, #0, loc_CCDF30                                     ; +0x100, 0xccdfc8\nLDR             X0, [X29,#0x40+var_10]; void *                         ; +0x104, 0xccdfcc\nBL              _ZdlPv; operator delete(void *)                        ; +0x108, 0xccdfd0\nB               loc_CCDF30                                             ; +0x10c, 0xccdfd4\nMOV             W1, #1                                                 ; +0x110, 0xccdfd8\nMOV             X0, X20; this                                          ; +0x114, 0xccdfdc\nSTRB            W1, [X20,#0x461]                                       ; +0x118, 0xccdfe0\nBL              _ZN26EditorSoundConfigInfoLayer13startDownloadEv; EditorSoundConfigInfoLayer::startDownload(void) ; +0x11c, 0xccdfe4\nB               loc_CCDF30                                             ; +0x120, 0xccdfe8\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x124, 0xccdfec\nLDR             X1, [X20,#0x440]; GJEditorSoundConfig *                ; +0x128, 0xccdff0\nBL              _ZN16EditorSFXManager17addFavoriteConfigEP19GJEditorSoundConfig; EditorSFXManager::addFavoriteConfig(GJEditorSoundConfig *) ; +0x12c, 0xccdff4\nMOV             X0, X20; this                                          ; +0x130, 0xccdff8\nBL              _ZN26EditorSoundConfigInfoLayer20refreshActionButtonsEv; EditorSoundConfigInfoLayer::refreshActionButtons(void) ; +0x134, 0xccdffc\nB               loc_CCDF30                                             ; +0x138, 0xcce000\nBL              .__stack_chk_fail                                      ; +0x13c, 0xcce004\nLDRB            W1, [X29,#0x40+var_20]                                 ; +0x140, 0xcce008\nMOV             X19, X0                                                ; +0x144, 0xcce00c\nTBZ             W1, #0, loc_CCE01C                                     ; +0x148, 0xcce010\nLDR             X0, [X29,#0x40+var_10]; void *                         ; +0x14c, 0xcce014\nBL              _ZdlPv; operator delete(void *)                        ; +0x150, 0xcce018\nMOV             X0, X19                                                ; +0x154, 0xcce01c\nBL              _Unwind_Resume                                         ; +0x158, 0xcce020", "xrefs": ["EditorSoundConfigInfoLayer::downloadEditorSoundFinished @ 0xccf468", "<???> @ 0xb7280", "EditorSoundConfigInfoLayer::init @ 0xcd1e4c", "<???> @ 0x1545478"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "arm", "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"}