{"type": "func", "start": 5697320, "end": 5697528, "name": "ButtonSprite::~ButtonSprite", "pseudocode": "// \n// ButtonSprite::~ButtonSprite from 0x56ef28 to 0x56eff8 (208 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x8b008\n// > <???> @ 0x1135f00\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\nvoid __fastcall ButtonSprite::~ButtonSprite(ButtonSprite *this)\n{\n  stl::StringData<char>::Internal *m_data; // x2\n  char *v3; // x0\n  unsigned int *v4; // x2\n  int v5; // w1\n\n  m_data = this->m_caption.m_data.m_data;\n  this->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (ButtonSprite_vtbl *)&off_1135EF0;\n  this->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&off_11363C8;\n  this->cocos2d::CCSprite::cocos2d::CCTextureProtocol::cocos2d::CCBlendProtocol::__vftable = (cocos2d::CCTextureProtocol_vtbl *)&off_1136448;\n  v3 = (char *)m_data - 24;\n  if ( (__int64 *)((char *)m_data - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v4 = (unsigned int *)((char *)m_data - 8);\n      do\n        v5 = __ldaxr(v4);\n      while ( __stlxr(v5 - 1, v4) );\n    }\n    else\n    {\n      v5 = *((_DWORD *)m_data - 2);\n      *((_DWORD *)m_data - 2) = v5 - 1;\n    }\n    if ( v5 <= 0 )\n      operator delete(v3);\n  }\n  cocos2d::CCSprite::~CCSprite(this);\n  operator delete(this);\n}", "assembly": "; \n; ButtonSprite::~ButtonSprite from 0x56ef28 to 0x56eff8 (208 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x8b008\n; > <???> @ 0x1135f00\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\nSTP             X29, X30, [SP,#var_30]!                                ; +0x0, 0x56ef28\nMOV             X29, SP                                                ; +0x4, 0x56ef2c\nSTP             X19, X20, [SP,#0x30+var_20]                            ; +0x8, 0x56ef30\nADRP            X20, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x56ef34\nMOV             X19, X0                                                ; +0x10, 0x56ef38\nADRP            X0, #_ZTV12ButtonSprite_ptr@PAGE                       ; +0x14, 0x56ef3c\nLDR             X1, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x18, 0x56ef40\nLDR             X0, [X0,#_ZTV12ButtonSprite_ptr@PAGEOFF]; `vtable for'ButtonSprite ... ; +0x1c, 0x56ef44\nLDR             X2, [X19,#0x2A0]                                       ; +0x20, 0x56ef48\nLDR             X1, [X1]                                               ; +0x24, 0x56ef4c\nADD             X4, X0, #0x10                                          ; +0x28, 0x56ef50\nSTR             X1, [X29,#0x30+var_8]                                  ; +0x2c, 0x56ef54\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x30, 0x56ef58\nADD             X3, X0, #0x4E8                                         ; +0x34, 0x56ef5c\nSTR             X4, [X19]                                              ; +0x38, 0x56ef60\nADD             X0, X0, #0x568                                         ; +0x3c, 0x56ef64\nSTR             X3, [X19,#0x140]                                       ; +0x40, 0x56ef68\nSTR             X0, [X19,#0x158]                                       ; +0x44, 0x56ef6c\nSUB             X0, X2, #0x18; p                                       ; +0x48, 0x56ef70\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x4c, 0x56ef74\nCMP             X0, X1                                                 ; +0x50, 0x56ef78\nB.NE            loc_56EFB0                                             ; +0x54, 0x56ef7c\nMOV             X0, X19; this                                          ; +0x58, 0x56ef80\nBL              _ZN7cocos2d8CCSpriteD1Ev; cocos2d::CCSprite::~CCSprite() ; +0x5c, 0x56ef84\nMOV             X0, X19; p                                             ; +0x60, 0x56ef88\nBL              _ZdlPv; operator delete(void *)                        ; +0x64, 0x56ef8c\nLDR             X20, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x68, 0x56ef90\nLDR             X1, [X29,#0x30+var_8]                                  ; +0x6c, 0x56ef94\nLDR             X0, [X20]                                              ; +0x70, 0x56ef98\nCMP             X1, X0                                                 ; +0x74, 0x56ef9c\nB.NE            loc_56EFF4                                             ; +0x78, 0x56efa0\nLDP             X19, X20, [SP,#0x30+var_20]                            ; +0x7c, 0x56efa4\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0x80, 0x56efa8\nRET                                                                    ; +0x84, 0x56efac\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x88, 0x56efb0\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x8c, 0x56efb4\nCBZ             X1, loc_56EFE4                                         ; +0x90, 0x56efb8\nSUB             X2, X2, #8                                             ; +0x94, 0x56efbc\nLDAXR           W1, [X2]                                               ; +0x98, 0x56efc0\nSUB             W3, W1, #1                                             ; +0x9c, 0x56efc4\nSTLXR           W4, W3, [X2]                                           ; +0xa0, 0x56efc8\nCBNZ            W4, loc_56EFC0                                         ; +0xa4, 0x56efcc\nCMP             W1, WZR                                                ; +0xa8, 0x56efd0\nB.GT            loc_56EF80                                             ; +0xac, 0x56efd4\nADD             X1, X29, #0x30+var_10                                  ; +0xb0, 0x56efd8\nBL              j__ZdlPv; operator delete(void *)                      ; +0xb4, 0x56efdc\nB               loc_56EF80                                             ; +0xb8, 0x56efe0\nLDUR            W1, [X2,#-8]                                           ; +0xbc, 0x56efe4\nSUB             W3, W1, #1                                             ; +0xc0, 0x56efe8\nSTUR            W3, [X2,#-8]                                           ; +0xc4, 0x56efec\nB               loc_56EFD0                                             ; +0xc8, 0x56eff0\nBL              .__stack_chk_fail                                      ; +0xcc, 0x56eff4", "xrefs": ["<???> @ 0x8b008", "<???> @ 0x1135f00"], "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"}