{"type": "func", "start": 5734440, "end": 5734864, "name": "CCPartAnimSprite::changeTextureOfID", "pseudocode": "// \n// CCPartAnimSprite::changeTextureOfID from 0x578028 to 0x5781d0 (424 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x66c00\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 CCPartAnimSprite::changeTextureOfID(CCPartAnimSprite *a1, const char *a2, const char *a3)\n{\n  cocos2d::CCDictionary *m_spritePartIDs; // x21\n  CCSpritePart *v5; // x22\n  char *v6; // x0\n  char *v7; // x0\n  unsigned int *v8; // x1\n  int v9; // w2\n  unsigned int *v10; // x20\n  int v11; // w1\n  std::string v12; // [xsp+50h] [xbp+50h] BYREF\n\n  m_spritePartIDs = a1->m_spritePartIDs;\n  sub_D153B8((int)&v12, (char *)a2);\n  v5 = (CCSpritePart *)cocos2d::CCDictionary::objectForKey(m_spritePartIDs, &v12);\n  v6 = (char *)v12.m_data.m_data - 24;\n  if ( (__int64 *)v12.m_data.m_data - 3 != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v8 = (unsigned int *)((char *)v12.m_data.m_data - 8);\n      do\n        v9 = __ldaxr(v8);\n      while ( __stlxr(v9 - 1, v8) );\n    }\n    else\n    {\n      v9 = *((_DWORD *)v12.m_data.m_data - 2);\n      *((_DWORD *)v12.m_data.m_data - 2) = v9 - 1;\n    }\n    if ( v9 <= 0 )\n      operator delete(v6);\n  }\n  if ( v5 )\n  {\n    if ( a3 )\n    {\n      sub_D153B8((int)&v12, (char *)a3);\n      CCSpritePart::updateDisplayFrame((__int64)v5, (const char **)&v12);\n      v7 = (char *)v12.m_data.m_data - 24;\n      if ( (__int64 *)v12.m_data.m_data - 3 != &qword_124B6B0 )\n      {\n        if ( &pthread_create )\n        {\n          v10 = (unsigned int *)((char *)v12.m_data.m_data - 8);\n          do\n            v11 = __ldaxr(v10);\n          while ( __stlxr(v11 - 1, v10) );\n        }\n        else\n        {\n          v11 = *((_DWORD *)v12.m_data.m_data - 2);\n          *((_DWORD *)v12.m_data.m_data - 2) = v11 - 1;\n        }\n        if ( v11 <= 0 )\n          operator delete(v7);\n      }\n    }\n    else\n    {\n      CCSpritePart::resetTextureRect(v5);\n    }\n  }\n}", "assembly": "; \n; CCPartAnimSprite::changeTextureOfID from 0x578028 to 0x5781d0 (424 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x66c00\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_60]!                                ; +0x0, 0x578028\nMOV             X29, SP                                                ; +0x4, 0x57802c\nSTP             X19, X20, [SP,#0x60+var_50]                            ; +0x8, 0x578030\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x578034\nADD             X20, X29, #0x60+var_10                                 ; +0x10, 0x578038\nSTP             X23, X24, [SP,#0x60+var_30]                            ; +0x14, 0x57803c\nADD             X23, X29, #0x60+var_20                                 ; +0x18, 0x578040\nMOV             X24, X2                                                ; +0x1c, 0x578044\nLDR             X3, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x578048\nMOV             X2, X23                                                ; +0x24, 0x57804c\nSTP             X21, X22, [SP,#0x60+var_40]                            ; +0x28, 0x578050\nLDR             X21, [X0,#0x258]                                       ; +0x2c, 0x578054\nMOV             X0, X20; int                                           ; +0x30, 0x578058\nLDR             X3, [X3]                                               ; +0x34, 0x57805c\nSTR             X3, [X29,#0x60+var_8]                                  ; +0x38, 0x578060\nBL              sub_D153B8                                             ; +0x3c, 0x578064\nMOV             X0, X21                                                ; +0x40, 0x578068\nMOV             X1, X20                                                ; +0x44, 0x57806c\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x48, 0x578070\nADRP            X21, #off_122EFE8@PAGE                                 ; +0x4c, 0x578074\nLDR             X1, [X29,#0x60+var_10]                                 ; +0x50, 0x578078\nMOV             X22, X0                                                ; +0x54, 0x57807c\nSUB             X0, X1, #0x18; p                                       ; +0x58, 0x578080\nLDR             X2, [X21,#off_122EFE8@PAGEOFF]; qword_124B6B0          ; +0x5c, 0x578084\nCMP             X0, X2                                                 ; +0x60, 0x578088\nB.NE            loc_5780F0                                             ; +0x64, 0x57808c\nCBZ             X22, loc_5780C8                                        ; +0x68, 0x578090\nCBZ             X24, loc_578124                                        ; +0x6c, 0x578094\nMOV             X0, X20; int                                           ; +0x70, 0x578098\nMOV             X1, X24; char *                                        ; +0x74, 0x57809c\nMOV             X2, X23                                                ; +0x78, 0x5780a0\nBL              sub_D153B8                                             ; +0x7c, 0x5780a4\nMOV             X0, X22                                                ; +0x80, 0x5780a8\nMOV             X1, X20                                                ; +0x84, 0x5780ac\nBL              _ZN12CCSpritePart18updateDisplayFrameESs; CCSpritePart::updateDisplayFrame(std::string) ; +0x88, 0x5780b0\nLDR             X20, [X29,#0x60+var_10]                                ; +0x8c, 0x5780b4\nLDR             X21, [X21,#off_122EFE8@PAGEOFF]; qword_124B6B0         ; +0x90, 0x5780b8\nSUB             X0, X20, #0x18; p                                      ; +0x94, 0x5780bc\nCMP             X0, X21                                                ; +0x98, 0x5780c0\nB.NE            loc_578130                                             ; +0x9c, 0x5780c4\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xa0, 0x5780c8\nLDR             X1, [X29,#0x60+var_8]                                  ; +0xa4, 0x5780cc\nLDR             X0, [X19]                                              ; +0xa8, 0x5780d0\nCMP             X1, X0                                                 ; +0xac, 0x5780d4\nB.NE            loc_578184                                             ; +0xb0, 0x5780d8\nLDP             X19, X20, [SP,#0x60+var_50]                            ; +0xb4, 0x5780dc\nLDP             X21, X22, [SP,#0x60+var_40]                            ; +0xb8, 0x5780e0\nLDP             X23, X24, [SP,#0x60+var_30]                            ; +0xbc, 0x5780e4\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0xc0, 0x5780e8\nRET                                                                    ; +0xc4, 0x5780ec\nADRP            X2, #pthread_create_ptr_0@PAGE                         ; +0xc8, 0x5780f0\nLDR             X2, [X2,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xcc, 0x5780f4\nCBZ             X2, loc_578164                                         ; +0xd0, 0x5780f8\nSUB             X1, X1, #8                                             ; +0xd4, 0x5780fc\nLDAXR           W2, [X1]                                               ; +0xd8, 0x578100\nSUB             W3, W2, #1                                             ; +0xdc, 0x578104\nSTLXR           W4, W3, [X1]                                           ; +0xe0, 0x578108\nCBNZ            W4, loc_578100                                         ; +0xe4, 0x57810c\nCMP             W2, WZR                                                ; +0xe8, 0x578110\nB.GT            loc_578090                                             ; +0xec, 0x578114\nADD             X1, X29, #0x60+var_18                                  ; +0xf0, 0x578118\nBL              j__ZdlPv; operator delete(void *)                      ; +0xf4, 0x57811c\nB               loc_578090                                             ; +0xf8, 0x578120\nMOV             X0, X22; this                                          ; +0xfc, 0x578124\nBL              _ZN12CCSpritePart16resetTextureRectEv; CCSpritePart::resetTextureRect(void) ; +0x100, 0x578128\nB               loc_5780C8                                             ; +0x104, 0x57812c\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x108, 0x578130\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x10c, 0x578134\nCBZ             X1, loc_578174                                         ; +0x110, 0x578138\nSUB             X20, X20, #8                                           ; +0x114, 0x57813c\nLDAXR           W1, [X20]                                              ; +0x118, 0x578140\nSUB             W2, W1, #1                                             ; +0x11c, 0x578144\nSTLXR           W3, W2, [X20]                                          ; +0x120, 0x578148\nCBNZ            W3, loc_578140                                         ; +0x124, 0x57814c\nCMP             W1, WZR                                                ; +0x128, 0x578150\nB.GT            loc_5780C8                                             ; +0x12c, 0x578154\nADD             X1, X29, #0x60+var_18                                  ; +0x130, 0x578158\nBL              j__ZdlPv; operator delete(void *)                      ; +0x134, 0x57815c\nB               loc_5780C8                                             ; +0x138, 0x578160\nLDUR            W2, [X1,#-8]                                           ; +0x13c, 0x578164\nSUB             W3, W2, #1                                             ; +0x140, 0x578168\nSTUR            W3, [X1,#-8]                                           ; +0x144, 0x57816c\nB               loc_578110                                             ; +0x148, 0x578170\nLDUR            W1, [X20,#-8]                                          ; +0x14c, 0x578174\nSUB             W2, W1, #1                                             ; +0x150, 0x578178\nSTUR            W2, [X20,#-8]                                          ; +0x154, 0x57817c\nB               loc_578150                                             ; +0x158, 0x578180\nBL              .__stack_chk_fail                                      ; +0x15c, 0x578184\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x160, 0x578188\nMOV             X19, X0                                                ; +0x164, 0x57818c\nLDR             X0, [X29,#0x60+var_10]                                 ; +0x168, 0x578190\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x16c, 0x578194\nSUB             X0, X0, #0x18                                          ; +0x170, 0x578198\nCMP             X0, X1                                                 ; +0x174, 0x57819c\nB.NE            loc_5781C4                                             ; +0x178, 0x5781a0\nMOV             X0, X19                                                ; +0x17c, 0x5781a4\nBL              _Unwind_Resume                                         ; +0x180, 0x5781a8\nMOV             X19, X0                                                ; +0x184, 0x5781ac\nLDR             X0, [X29,#0x60+var_10]                                 ; +0x188, 0x5781b0\nLDR             X21, [X21,#0xFE8]                                      ; +0x18c, 0x5781b4\nSUB             X0, X0, #0x18                                          ; +0x190, 0x5781b8\nCMP             X0, X21                                                ; +0x194, 0x5781bc\nB.EQ            loc_5781A4                                             ; +0x198, 0x5781c0\nADD             X1, X29, #0x60+var_18                                  ; +0x19c, 0x5781c4\nBL              sub_4DB080                                             ; +0x1a0, 0x5781c8\nB               loc_5781A4                                             ; +0x1a4, 0x5781cc", "xrefs": ["<???> @ 0x66c00"], "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"}