{"type": "func", "start": 5712412, "end": 5712912, "name": "CCAnimateFrameCache::addSpriteFramesWithFile", "pseudocode": "// \n// CCAnimateFrameCache::addSpriteFramesWithFile from 0x572a1c to 0x572c10 (500 bytes)\n// \n// 3 xrefs:\n// > CCPartAnimSprite::initWithAnimDesc @ 0x5782a4\n// > LoadingLayer::loadAssets @ 0x5c4b18\n// > <???> @ 0xa85e8\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::CCDictionary *CCAnimateFrameCache::addSpriteFramesWithFile(CCAnimateFrameCache *a1, const char *a2)\n{\n  cocos2d::CCDictionary *m_animateDescriptions; // x21\n  __int64 v5; // x25\n  char *v6; // x0\n  cocos2d::CCDictionary *v7; // x22\n  cocos2d::CCDictionary *v8; // x22\n  char *v9; // x0\n  unsigned int *v11; // x1\n  int v12; // w2\n  DS_Dictionary *v13; // x20\n  unsigned int *v14; // x20\n  int v15; // w1\n  std::string v16; // [xsp+60h] [xbp+60h] BYREF\n\n  m_animateDescriptions = a1->m_animateDescriptions;\n  sub_D153B8((int)&v16, (char *)a2);\n  v5 = cocos2d::CCDictionary::objectForKey(m_animateDescriptions, &v16);\n  v6 = (char *)v16.m_data.m_data - 24;\n  if ( (__int64 *)v16.m_data.m_data - 3 == &qword_124B6B0 )\n    goto LABEL_2;\n  if ( &pthread_create )\n  {\n    v11 = (unsigned int *)((char *)v16.m_data.m_data - 8);\n    do\n      v12 = __ldaxr(v11);\n    while ( __stlxr(v12 - 1, v11) );\n  }\n  else\n  {\n    v12 = *((_DWORD *)v16.m_data.m_data - 2);\n    *((_DWORD *)v16.m_data.m_data - 2) = v12 - 1;\n  }\n  if ( v12 > 0 )\n  {\nLABEL_2:\n    if ( !v5 )\n    {\nLABEL_10:\n      v13 = (DS_Dictionary *)operator new(0xF0u);\n      DS_Dictionary::DS_Dictionary(v13);\n      DS_Dictionary::loadRootSubDictFromFile(v13, a2);\n      return CCAnimateFrameCache::addDict(a1, v13, (char *)a2);\n    }\n  }\n  else\n  {\n    operator delete(v6);\n    if ( !v5 )\n      goto LABEL_10;\n  }\n  v7 = a1->m_animateDescriptions;\n  sub_D153B8((int)&v16, (char *)a2);\n  v8 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(v7, &v16);\n  v9 = (char *)v16.m_data.m_data - 24;\n  if ( (__int64 *)v16.m_data.m_data - 3 != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v14 = (unsigned int *)((char *)v16.m_data.m_data - 8);\n      do\n        v15 = __ldaxr(v14);\n      while ( __stlxr(v15 - 1, v14) );\n    }\n    else\n    {\n      v15 = *((_DWORD *)v16.m_data.m_data - 2);\n      *((_DWORD *)v16.m_data.m_data - 2) = v15 - 1;\n    }\n    if ( v15 <= 0 )\n      operator delete(v9);\n  }\n  return v8;\n}", "assembly": "; \n; CCAnimateFrameCache::addSpriteFramesWithFile from 0x572a1c to 0x572c10 (500 bytes)\n; \n; 3 xrefs:\n; > CCPartAnimSprite::initWithAnimDesc @ 0x5782a4\n; > LoadingLayer::loadAssets @ 0x5c4b18\n; > <???> @ 0xa85e8\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_70]!                                ; +0x0, 0x572a1c\nMOV             X29, SP                                                ; +0x4, 0x572a20\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0x572a24\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x572a28\nADD             X20, X29, #0x70+var_10                                 ; +0x10, 0x572a2c\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x14, 0x572a30\nMOV             X22, X0                                                ; +0x18, 0x572a34\nMOV             X0, X20; int                                           ; +0x1c, 0x572a38\nLDR             X3, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x572a3c\nSTP             X23, X24, [SP,#0x70+var_40]                            ; +0x24, 0x572a40\nADD             X23, X29, #0x70+var_20                                 ; +0x28, 0x572a44\nLDR             X21, [X22,#0x48]                                       ; +0x2c, 0x572a48\nLDR             X3, [X3]                                               ; +0x30, 0x572a4c\nMOV             X2, X23                                                ; +0x34, 0x572a50\nMOV             X24, X1                                                ; +0x38, 0x572a54\nSTR             X25, [SP,#0x70+var_30]                                 ; +0x3c, 0x572a58\nSTR             X3, [X29,#0x70+var_8]                                  ; +0x40, 0x572a5c\nBL              sub_D153B8                                             ; +0x44, 0x572a60\nMOV             X0, X21                                                ; +0x48, 0x572a64\nMOV             X1, X20                                                ; +0x4c, 0x572a68\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x50, 0x572a6c\nADRP            X21, #off_122EFE8@PAGE                                 ; +0x54, 0x572a70\nLDR             X1, [X29,#0x70+var_10]                                 ; +0x58, 0x572a74\nMOV             X25, X0                                                ; +0x5c, 0x572a78\nSUB             X0, X1, #0x18; p                                       ; +0x60, 0x572a7c\nLDR             X2, [X21,#off_122EFE8@PAGEOFF]; qword_124B6B0          ; +0x64, 0x572a80\nCMP             X0, X2                                                 ; +0x68, 0x572a84\nB.NE            loc_572AF8                                             ; +0x6c, 0x572a88\nCBZ             X25, loc_572B2C                                        ; +0x70, 0x572a8c\nMOV             X0, X20; int                                           ; +0x74, 0x572a90\nMOV             X1, X24; char *                                        ; +0x78, 0x572a94\nMOV             X2, X23                                                ; +0x7c, 0x572a98\nLDR             X22, [X22,#0x48]                                       ; +0x80, 0x572a9c\nBL              sub_D153B8                                             ; +0x84, 0x572aa0\nMOV             X0, X22                                                ; +0x88, 0x572aa4\nMOV             X1, X20                                                ; +0x8c, 0x572aa8\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x90, 0x572aac\nLDR             X20, [X29,#0x70+var_10]                                ; +0x94, 0x572ab0\nMOV             X22, X0                                                ; +0x98, 0x572ab4\nLDR             X21, [X21,#off_122EFE8@PAGEOFF]; qword_124B6B0         ; +0x9c, 0x572ab8\nSUB             X0, X20, #0x18; p                                      ; +0xa0, 0x572abc\nCMP             X0, X21                                                ; +0xa4, 0x572ac0\nB.NE            loc_572B60                                             ; +0xa8, 0x572ac4\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xac, 0x572ac8\nMOV             X0, X22                                                ; +0xb0, 0x572acc\nLDR             X2, [X29,#0x70+var_8]                                  ; +0xb4, 0x572ad0\nLDR             X1, [X19]                                              ; +0xb8, 0x572ad4\nCMP             X2, X1                                                 ; +0xbc, 0x572ad8\nB.NE            loc_572BB4                                             ; +0xc0, 0x572adc\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0xc4, 0x572ae0\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0xc8, 0x572ae4\nLDP             X23, X24, [SP,#0x70+var_40]                            ; +0xcc, 0x572ae8\nLDR             X25, [SP,#0x70+var_30]                                 ; +0xd0, 0x572aec\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0xd4, 0x572af0\nRET                                                                    ; +0xd8, 0x572af4\nADRP            X2, #pthread_create_ptr_0@PAGE                         ; +0xdc, 0x572af8\nLDR             X2, [X2,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xe0, 0x572afc\nCBZ             X2, loc_572B94                                         ; +0xe4, 0x572b00\nSUB             X1, X1, #8                                             ; +0xe8, 0x572b04\nLDAXR           W2, [X1]                                               ; +0xec, 0x572b08\nSUB             W3, W2, #1                                             ; +0xf0, 0x572b0c\nSTLXR           W4, W3, [X1]                                           ; +0xf4, 0x572b10\nCBNZ            W4, loc_572B08                                         ; +0xf8, 0x572b14\nCMP             W2, WZR                                                ; +0xfc, 0x572b18\nB.GT            loc_572A8C                                             ; +0x100, 0x572b1c\nADD             X1, X29, #0x70+var_18                                  ; +0x104, 0x572b20\nBL              j__ZdlPv; operator delete(void *)                      ; +0x108, 0x572b24\nCBNZ            X25, loc_572A90                                        ; +0x10c, 0x572b28\nMOV             X0, #0xF0; unsigned __int64                            ; +0x110, 0x572b2c\nBL              _Znwm; operator new(ulong)                             ; +0x114, 0x572b30\nMOV             X20, X0                                                ; +0x118, 0x572b34\nBL              _ZN13DS_DictionaryC1Ev; DS_Dictionary::DS_Dictionary(void) ; +0x11c, 0x572b38\nMOV             X1, X24; char *                                        ; +0x120, 0x572b3c\nMOV             X0, X20; this                                          ; +0x124, 0x572b40\nBL              _ZN13DS_Dictionary23loadRootSubDictFromFileEPKc; DS_Dictionary::loadRootSubDictFromFile(char const*) ; +0x128, 0x572b44\nMOV             X0, X22; this                                          ; +0x12c, 0x572b48\nMOV             X1, X20; DS_Dictionary *                               ; +0x130, 0x572b4c\nMOV             X2, X24; char *                                        ; +0x134, 0x572b50\nBL              _ZN19CCAnimateFrameCache7addDictEP13DS_DictionaryPKc; CCAnimateFrameCache::addDict(DS_Dictionary *,char const*) ; +0x138, 0x572b54\nMOV             X22, X0                                                ; +0x13c, 0x572b58\nB               loc_572AC8                                             ; +0x140, 0x572b5c\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x144, 0x572b60\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x148, 0x572b64\nCBZ             X1, loc_572BA4                                         ; +0x14c, 0x572b68\nSUB             X20, X20, #8                                           ; +0x150, 0x572b6c\nLDAXR           W1, [X20]                                              ; +0x154, 0x572b70\nSUB             W2, W1, #1                                             ; +0x158, 0x572b74\nSTLXR           W3, W2, [X20]                                          ; +0x15c, 0x572b78\nCBNZ            W3, loc_572B70                                         ; +0x160, 0x572b7c\nCMP             W1, WZR                                                ; +0x164, 0x572b80\nB.GT            loc_572AC8                                             ; +0x168, 0x572b84\nADD             X1, X29, #0x70+var_18                                  ; +0x16c, 0x572b88\nBL              j__ZdlPv; operator delete(void *)                      ; +0x170, 0x572b8c\nB               loc_572AC8                                             ; +0x174, 0x572b90\nLDUR            W2, [X1,#-8]                                           ; +0x178, 0x572b94\nSUB             W3, W2, #1                                             ; +0x17c, 0x572b98\nSTUR            W3, [X1,#-8]                                           ; +0x180, 0x572b9c\nB               loc_572B18                                             ; +0x184, 0x572ba0\nLDUR            W1, [X20,#-8]                                          ; +0x188, 0x572ba4\nSUB             W2, W1, #1                                             ; +0x18c, 0x572ba8\nSTUR            W2, [X20,#-8]                                          ; +0x190, 0x572bac\nB               loc_572B80                                             ; +0x194, 0x572bb0\nBL              .__stack_chk_fail                                      ; +0x198, 0x572bb4\nMOV             X19, X0                                                ; +0x19c, 0x572bb8\nMOV             X0, X20; p                                             ; +0x1a0, 0x572bbc\nBL              _ZdlPv; operator delete(void *)                        ; +0x1a4, 0x572bc0\nMOV             X0, X19                                                ; +0x1a8, 0x572bc4\nBL              _Unwind_Resume                                         ; +0x1ac, 0x572bc8\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x1b0, 0x572bcc\nMOV             X19, X0                                                ; +0x1b4, 0x572bd0\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x1b8, 0x572bd4\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x1bc, 0x572bd8\nSUB             X0, X0, #0x18                                          ; +0x1c0, 0x572bdc\nCMP             X0, X1                                                 ; +0x1c4, 0x572be0\nB.EQ            loc_572BC4                                             ; +0x1c8, 0x572be4\nADD             X1, X29, #0x70+var_18                                  ; +0x1cc, 0x572be8\nBL              start                                                  ; +0x1d0, 0x572bec\nB               loc_572BC4                                             ; +0x1d4, 0x572bf0\nMOV             X19, X0                                                ; +0x1d8, 0x572bf4\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x1dc, 0x572bf8\nLDR             X21, [X21,#0xFE8]                                      ; +0x1e0, 0x572bfc\nSUB             X0, X0, #0x18                                          ; +0x1e4, 0x572c00\nCMP             X0, X21                                                ; +0x1e8, 0x572c04\nB.EQ            loc_572BC4                                             ; +0x1ec, 0x572c08\nB               loc_572BE8                                             ; +0x1f0, 0x572c0c", "xrefs": ["CCPartAnimSprite::initWithAnimDesc @ 0x5782a4", "LoadingLayer::loadAssets @ 0x5c4b18", "<???> @ 0xa85e8"], "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"}