{"type": "func", "start": 5708768, "end": 5709016, "name": "CCAnimateFrameCache::spriteFrameByName", "pseudocode": "// \n// CCAnimateFrameCache::spriteFrameByName from 0x571be0 to 0x571cd8 (248 bytes)\n// \n// 3 xrefs:\n// > CCPartAnimSprite::setDisplayFrame @ 0x5779cc\n// > CCPartAnimSprite::tweenToFrame @ 0x577d4c\n// > <???> @ 0x566d0\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\ncocos2d::CCArray *CCAnimateFrameCache::spriteFrameByName(CCAnimateFrameCache *a1, const char *a2)\n{\n  cocos2d::CCDictionary *m_animateFrames; // x21\n  cocos2d::CCArray *v3; // x20\n  char *v4; // x0\n  unsigned int *v6; // x2\n  int v7; // w1\n  std::string v8; // [xsp+40h] [xbp+40h] BYREF\n\n  m_animateFrames = a1->m_animateFrames;\n  sub_D153B8((int)&v8, (char *)a2);\n  v3 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(m_animateFrames, &v8);\n  v4 = (char *)v8.m_data.m_data - 24;\n  if ( (__int64 *)v8.m_data.m_data - 3 != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v6 = (unsigned int *)((char *)v8.m_data.m_data - 8);\n      do\n        v7 = __ldaxr(v6);\n      while ( __stlxr(v7 - 1, v6) );\n    }\n    else\n    {\n      v7 = *((_DWORD *)v8.m_data.m_data - 2);\n      *((_DWORD *)v8.m_data.m_data - 2) = v7 - 1;\n    }\n    if ( v7 <= 0 )\n      operator delete(v4);\n  }\n  return v3;\n}", "assembly": "; \n; CCAnimateFrameCache::spriteFrameByName from 0x571be0 to 0x571cd8 (248 bytes)\n; \n; 3 xrefs:\n; > CCPartAnimSprite::setDisplayFrame @ 0x5779cc\n; > CCPartAnimSprite::tweenToFrame @ 0x577d4c\n; > <???> @ 0x566d0\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_50]!                                ; +0x0, 0x571be0\nMOV             X29, SP                                                ; +0x4, 0x571be4\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x571be8\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x571bec\nADD             X20, X29, #0x50+var_10                                 ; +0x10, 0x571bf0\nSTR             X21, [SP,#0x50+var_30]                                 ; +0x14, 0x571bf4\nADD             X2, X29, #0x50+var_20                                  ; +0x18, 0x571bf8\nLDR             X21, [X0,#0x38]                                        ; +0x1c, 0x571bfc\nMOV             X0, X20; int                                           ; +0x20, 0x571c00\nLDR             X3, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x24, 0x571c04\nLDR             X3, [X3]                                               ; +0x28, 0x571c08\nSTR             X3, [X29,#0x50+var_8]                                  ; +0x2c, 0x571c0c\nBL              sub_D153B8                                             ; +0x30, 0x571c10\nMOV             X0, X21                                                ; +0x34, 0x571c14\nMOV             X1, X20                                                ; +0x38, 0x571c18\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x3c, 0x571c1c\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x40, 0x571c20\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x44, 0x571c24\nMOV             X20, X0                                                ; +0x48, 0x571c28\nSUB             X0, X2, #0x18; p                                       ; +0x4c, 0x571c2c\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x50, 0x571c30\nCMP             X0, X1                                                 ; +0x54, 0x571c34\nB.NE            loc_571C64                                             ; +0x58, 0x571c38\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x5c, 0x571c3c\nMOV             X0, X20                                                ; +0x60, 0x571c40\nLDR             X2, [X29,#0x50+var_8]                                  ; +0x64, 0x571c44\nLDR             X1, [X19]                                              ; +0x68, 0x571c48\nCMP             X2, X1                                                 ; +0x6c, 0x571c4c\nB.NE            loc_571CA8                                             ; +0x70, 0x571c50\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x74, 0x571c54\nLDR             X21, [SP,#0x50+var_30]                                 ; +0x78, 0x571c58\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x7c, 0x571c5c\nRET                                                                    ; +0x80, 0x571c60\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x84, 0x571c64\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x88, 0x571c68\nCBZ             X1, loc_571C98                                         ; +0x8c, 0x571c6c\nSUB             X2, X2, #8                                             ; +0x90, 0x571c70\nLDAXR           W1, [X2]                                               ; +0x94, 0x571c74\nSUB             W3, W1, #1                                             ; +0x98, 0x571c78\nSTLXR           W4, W3, [X2]                                           ; +0x9c, 0x571c7c\nCBNZ            W4, loc_571C74                                         ; +0xa0, 0x571c80\nCMP             W1, WZR                                                ; +0xa4, 0x571c84\nB.GT            loc_571C3C                                             ; +0xa8, 0x571c88\nADD             X1, X29, #0x50+var_18                                  ; +0xac, 0x571c8c\nBL              j__ZdlPv; operator delete(void *)                      ; +0xb0, 0x571c90\nB               loc_571C3C                                             ; +0xb4, 0x571c94\nLDUR            W1, [X2,#-8]                                           ; +0xb8, 0x571c98\nSUB             W3, W1, #1                                             ; +0xbc, 0x571c9c\nSTUR            W3, [X2,#-8]                                           ; +0xc0, 0x571ca0\nB               loc_571C84                                             ; +0xc4, 0x571ca4\nBL              .__stack_chk_fail                                      ; +0xc8, 0x571ca8\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xcc, 0x571cac\nMOV             X19, X0                                                ; +0xd0, 0x571cb0\nLDR             X0, [X29,#0x50+var_10]                                 ; +0xd4, 0x571cb4\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xd8, 0x571cb8\nSUB             X0, X0, #0x18                                          ; +0xdc, 0x571cbc\nCMP             X0, X1                                                 ; +0xe0, 0x571cc0\nB.EQ            loc_571CD0                                             ; +0xe4, 0x571cc4\nADD             X1, X29, #0x50+var_18                                  ; +0xe8, 0x571cc8\nBL              start                                                  ; +0xec, 0x571ccc\nMOV             X0, X19                                                ; +0xf0, 0x571cd0\nBL              _Unwind_Resume                                         ; +0xf4, 0x571cd4", "xrefs": ["CCPartAnimSprite::setDisplayFrame @ 0x5779cc", "CCPartAnimSprite::tweenToFrame @ 0x577d4c", "<???> @ 0x566d0"], "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"}