{"type": "func", "start": 7885276, "end": 7885506, "name": "EditorSoundConfigInfoLayer::onFavorite", "pseudocode": "// \n// EditorSoundConfigInfoLayer::onFavorite from 0x7851dc to 0x7852c2 (230 bytes)\n// \n// 1 xrefs:\n// > EditorSoundConfigInfoLayer::downloadEditorSoundFinished @ 0x78632a\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:59:32 +0000\n// \n\nEditorSFXManager *__fastcall EditorSoundConfigInfoLayer::onFavorite(EditorSFXManager *this, cocos2d::CCObject *a2)\n{\n  int v2; // r4\n  EditorSFXManager *FavoriteConfig; // r0\n  cocos2d::CCArray **v4; // r0\n  unsigned int v5; // r0\n  EditorSFXManager *v6; // r0\n  EditorSFXManager *FavoriteConfigs; // r0\n  int *v8; // r0\n  cocos2d::CCArray *v9; // r0\n  int v10[3]; // [sp+8h] [bp-10h] BYREF\n\n  v2 = (int)this;\n  if ( *((_DWORD *)this + 187) )\n  {\n    FavoriteConfig = (EditorSFXManager *)EditorSFXManager::sharedState(this);\n    if ( FavoriteConfig\n      && (v4 = (cocos2d::CCArray **)EditorSFXManager::sharedState(FavoriteConfig),\n          (FavoriteConfig = (EditorSFXManager *)EditorSFXManager::getFavoriteConfig(\n                                                  v4,\n                                                  *(_DWORD *)(*(_DWORD *)(v2 + 748) + 264))) != nullptr) )\n    {\n      v5 = EditorSFXManager::sharedState(FavoriteConfig);\n      EditorSFXManager::removeFavoriteConfig(v5, *(_DWORD *)(*(_DWORD *)(v2 + 748) + 264));\n      EditorSoundConfigInfoLayer::refreshActionButtons((EditorSoundConfigInfoLayer *)v2);\n      this = *(EditorSFXManager **)(v2 + 756);\n      if ( this )\n        return (EditorSFXManager *)EditorSoundBrowserLayer::onConfigListChanged(this);\n    }\n    else if ( *(_BYTE *)(*(_DWORD *)(v2 + 748) + 384) )\n    {\n      v6 = (EditorSFXManager *)EditorSFXManager::sharedState(FavoriteConfig);\n      FavoriteConfigs = (EditorSFXManager *)EditorSFXManager::getFavoriteConfigs(v6);\n      if ( FavoriteConfigs\n        && (FavoriteConfigs = (EditorSFXManager *)cocos2d::CCArray::count(FavoriteConfigs),\n            (unsigned int)FavoriteConfigs > 0x31) )\n      {\n        memset(v10, 0, sizeof(v10));\n        std::string::__init(v10, \"You have reached the maximum of 50 favorites. Remove some first.\", 0x40u);\n        v8 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)\"Limit Reached\", (int)v10, (ButtonSprite *)\"OK\", nullptr);\n        (*(void (__fastcall **)(int *))(*v8 + 656))(v8);\n        return (EditorSFXManager *)std::string::~string((int)v10);\n      }\n      else\n      {\n        v9 = (cocos2d::CCArray *)EditorSFXManager::sharedState(FavoriteConfigs);\n        EditorSFXManager::addFavoriteConfig(v9, *(GJEditorSoundConfig **)(v2 + 748));\n        return (EditorSFXManager *)EditorSoundConfigInfoLayer::refreshActionButtons((EditorSoundConfigInfoLayer *)v2);\n      }\n    }\n    else\n    {\n      *(_BYTE *)(v2 + 765) = 1;\n      return (EditorSFXManager *)EditorSoundConfigInfoLayer::startDownload(v2);\n    }\n  }\n  return this;\n}", "assembly": "; \n; EditorSoundConfigInfoLayer::onFavorite from 0x7851dc to 0x7852c2 (230 bytes)\n; \n; 1 xrefs:\n; > EditorSoundConfigInfoLayer::downloadEditorSoundFinished @ 0x78632a\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:59:32 +0000\n; \nLDR             R3, =(__stack_chk_guard_ptr - 0x7851E4)                ; +0x0, 0x7851dc\nPUSH            {R4-R6,LR}                                             ; +0x2, 0x7851de\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x4, 0x7851e0\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x6, 0x7851e2\nSUB             SP, SP, #0x18                                          ; +0x8, 0x7851e4\nMOV             R4, R0                                                 ; +0xa, 0x7851e6\nLDR             R2, [R3]                                               ; +0xc, 0x7851e8\nMOV             R6, R3                                                 ; +0xe, 0x7851ea\nSTR             R2, [SP,#0x18+var_4]                                   ; +0x10, 0x7851ec\nLDR.W           R2, [R0,#0x2EC]                                        ; +0x12, 0x7851ee\nCMP             R2, #0                                                 ; +0x16, 0x7851f2\nBEQ             loc_7852B2                                             ; +0x18, 0x7851f4\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x1a, 0x7851f6\nCBZ             R0, loc_785232                                         ; +0x1e, 0x7851fa\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x20, 0x7851fc\nLDR.W           R3, [R4,#0x2EC]                                        ; +0x24, 0x785200\nLDR.W           R1, [R3,#0x108]; int                                   ; +0x28, 0x785204\nBL              _ZN16EditorSFXManager17getFavoriteConfigEi; EditorSFXManager::getFavoriteConfig(int) ; +0x2c, 0x785208\nCBZ             R0, loc_785232                                         ; +0x30, 0x78520c\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x32, 0x78520e\nLDR.W           R3, [R4,#0x2EC]                                        ; +0x36, 0x785212\nLDR.W           R1, [R3,#0x108]; int                                   ; +0x3a, 0x785216\nBL              _ZN16EditorSFXManager20removeFavoriteConfigEi; EditorSFXManager::removeFavoriteConfig(int) ; +0x3e, 0x78521a\nMOV             R0, R4; this                                           ; +0x42, 0x78521e\nBL              _ZN26EditorSoundConfigInfoLayer20refreshActionButtonsEv; EditorSoundConfigInfoLayer::refreshActionButtons(void) ; +0x44, 0x785220\nLDR.W           R0, [R4,#0x2F4]; this                                  ; +0x48, 0x785224\nCMP             R0, #0                                                 ; +0x4c, 0x785228\nBEQ             loc_7852B2                                             ; +0x4e, 0x78522a\nBL              _ZN23EditorSoundBrowserLayer19onConfigListChangedEv; EditorSoundBrowserLayer::onConfigListChanged(void) ; +0x50, 0x78522c\nB               loc_7852B2                                             ; +0x54, 0x785230\nLDR.W           R3, [R4,#0x2EC]                                        ; +0x56, 0x785232\nLDRB.W          R3, [R3,#0x180]                                        ; +0x5a, 0x785236\nCBNZ            R3, loc_78524A                                         ; +0x5e, 0x78523a\nMOVS            R3, #1                                                 ; +0x60, 0x78523c\nMOV             R0, R4; this                                           ; +0x62, 0x78523e\nSTRB.W          R3, [R4,#0x2FD]                                        ; +0x64, 0x785240\nBL              _ZN26EditorSoundConfigInfoLayer13startDownloadEv; EditorSoundConfigInfoLayer::startDownload(void) ; +0x68, 0x785244\nB               loc_7852B2                                             ; +0x6c, 0x785248\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x6e, 0x78524a\nBL              _ZN16EditorSFXManager18getFavoriteConfigsEv; EditorSFXManager::getFavoriteConfigs(void) ; +0x72, 0x78524e\nCBZ             R0, loc_7852A0                                         ; +0x76, 0x785252\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x78, 0x785254\nCMP             R0, #0x31 ; '1'                                        ; +0x7c, 0x785258\nBLS             loc_7852A0                                             ; +0x7e, 0x78525a\nADD             R5, SP, #0x18+var_10                                   ; +0x80, 0x78525c\nLDR             R1, =(aYouHaveReached_1 - 0x78526A); \"You have reached the maximum of 50 favo\"... ; +0x82, 0x78525e\nMOVS            R2, #0x40 ; '@'                                        ; +0x84, 0x785260\nMOVS            R4, #0                                                 ; +0x86, 0x785262\nMOV             R0, R5                                                 ; +0x88, 0x785264\nADD             R1, PC; \"You have reached the maximum of 50 favo\"...   ; +0x8a, 0x785266\nSTR             R4, [SP,#0x18+var_10]                                  ; +0x8c, 0x785268\nSTR             R4, [SP,#0x18+var_C]                                   ; +0x8e, 0x78526a\nSTR             R4, [SP,#0x18+var_8]                                   ; +0x90, 0x78526c\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x92, 0x78526e\nLDR             R1, =(aLimitReached - 0x785280); \"Limit Reached\"       ; +0x96, 0x785272\nMOV             R0, R4                                                 ; +0x98, 0x785274\nLDR             R3, =(aOk - 0x785282); \"OK\"                            ; +0x9a, 0x785276\nMOV             R2, R5                                                 ; +0x9c, 0x785278\nSTR             R4, [SP,#0x18+var_18]                                  ; +0x9e, 0x78527a\nADD             R1, PC; \"Limit Reached\"                                ; +0xa0, 0x78527c\nADD             R3, PC; \"OK\"                                           ; +0xa2, 0x78527e\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*) ; +0xa4, 0x785280\nB               loc_785290                                             ; +0xa8, 0x785284\nMOV             R0, R5                                                 ; +0xaa, 0x785286\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xac, 0x785288\nBL              __cxa_end_cleanup                                      ; +0xb0, 0x78528c\nLDR             R3, [R0]                                               ; +0xb4, 0x785290\nLDR.W           R3, [R3,#0x290]                                        ; +0xb6, 0x785292\nBLX             R3                                                     ; +0xba, 0x785296\nMOV             R0, R5                                                 ; +0xbc, 0x785298\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xbe, 0x78529a\nB               loc_7852B2                                             ; +0xc2, 0x78529e\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0xc4, 0x7852a0\nLDR.W           R1, [R4,#0x2EC]; GJEditorSoundConfig *                 ; +0xc8, 0x7852a4\nBL              _ZN16EditorSFXManager17addFavoriteConfigEP19GJEditorSoundConfig; EditorSFXManager::addFavoriteConfig(GJEditorSoundConfig *) ; +0xcc, 0x7852a8\nMOV             R0, R4; this                                           ; +0xd0, 0x7852ac\nBL              _ZN26EditorSoundConfigInfoLayer20refreshActionButtonsEv; EditorSoundConfigInfoLayer::refreshActionButtons(void) ; +0xd2, 0x7852ae\nLDR             R2, [SP,#0x18+var_4]                                   ; +0xd6, 0x7852b2\nLDR             R3, [R6]                                               ; +0xd8, 0x7852b4\nCMP             R2, R3                                                 ; +0xda, 0x7852b6\nBEQ             loc_7852BE                                             ; +0xdc, 0x7852b8\nBLX             __stack_chk_fail                                       ; +0xde, 0x7852ba\nADD             SP, SP, #0x18                                          ; +0xe2, 0x7852be\nPOP             {R4-R6,PC}                                             ; +0xe4, 0x7852c0", "xrefs": ["EditorSoundConfigInfoLayer::downloadEditorSoundFinished @ 0x78632a"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "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"}