{"type": "func", "start": 11822296, "end": 11822844, "name": "DS_Dictionary::setObjectForKey", "pseudocode": "// \n// DS_Dictionary::setObjectForKey from 0xb464d8 to 0xb466fc (548 bytes)\n// \n// 3 xrefs:\n// > DS_Dictionary::setArrayForKey @ 0xb46498\n// > DS_Dictionary::setDictForKey @ 0xb467b8\n// > <???> @ 0x57c18\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 DS_Dictionary::setObjectForKey(DS_Dictionary *a1, const char *a2, cocos2d::CCObject *a3)\n{\n  char *CString; // x0\n  char *v7; // x0\n  char *v8; // x23\n  unsigned int *v9; // x22\n  int v10; // w0\n  unsigned int *v11; // x1\n  int v12; // w2\n  const char *v13; // [xsp+58h] [xbp+58h] BYREF\n  const char *v14; // [xsp+60h] [xbp+60h] BYREF\n\n  if ( a3 )\n  {\n    if ( _dynamic_cast(\n           a3,\n           (const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,\n           (const struct __class_type_info *)&`typeinfo for'cocos2d::CCString,\n           0) )\n    {\n      CString = (char *)cocos2d::CCString::getCString((cocos2d::CCString *)a3);\n      sub_D153B8((int)&v13, CString);\n      v14 = v13;\n      v13 = &byte_124B6C8;\n      DS_Dictionary::setStringForKey((__int64)a1, a2, &v14);\n      v7 = (char *)(v14 - 24);\n      if ( v14 - 24 != (const char *)&qword_124B6B0 )\n      {\n        if ( &pthread_create )\n        {\n          v11 = (unsigned int *)(v14 - 8);\n          do\n            v12 = __ldaxr(v11);\n          while ( __stlxr(v12 - 1, v11) );\n        }\n        else\n        {\n          v12 = *((_DWORD *)v14 - 2);\n          *((_DWORD *)v14 - 2) = v12 - 1;\n        }\n        if ( v12 <= 0 )\n          operator delete(v7);\n      }\n      v8 = (char *)(v13 - 24);\n      if ( v13 - 24 != (const char *)&qword_124B6B0 )\n      {\n        if ( &pthread_create )\n        {\n          v9 = (unsigned int *)(v13 - 8);\n          do\n            v10 = __ldaxr(v9);\n          while ( __stlxr(v10 - 1, v9) );\n        }\n        else\n        {\n          v10 = *((_DWORD *)v13 - 2);\n          *((_DWORD *)v13 - 2) = v10 - 1;\n        }\n        if ( v10 <= 0 )\n          operator delete(v8);\n      }\n      return;\n    }\n    if ( _dynamic_cast(\n           a3,\n           (const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,\n           (const struct __class_type_info *)&`typeinfo for'cocos2d::CCDictionary,\n           0) )\n    {\n      DS_Dictionary::setDictForKey(a1, a2, (cocos2d::CCDictionary *)a3);\n      return;\n    }\n    if ( _dynamic_cast(\n           a3,\n           (const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,\n           (const struct __class_type_info *)&`typeinfo for'cocos2d::CCArray,\n           0) )\n    {\n      DS_Dictionary::setArrayForKey(a1, a2, (cocos2d::CCArray *)a3);\n      return;\n    }\n  }\n  if ( a3->canEncode(a3) )\n  {\n    DS_Dictionary::setSubDictForKey(a1, a2, 0, 1u);\n    a3->encodeWithCoder(a3, a1);\n    DS_Dictionary::stepOutOfSubDict(a1);\n  }\n}", "assembly": "; \n; DS_Dictionary::setObjectForKey from 0xb464d8 to 0xb466fc (548 bytes)\n; \n; 3 xrefs:\n; > DS_Dictionary::setArrayForKey @ 0xb46498\n; > DS_Dictionary::setDictForKey @ 0xb467b8\n; > <???> @ 0x57c18\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, 0xb464d8\nMOV             X29, SP                                                ; +0x4, 0xb464dc\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0xb464e0\nADRP            X20, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0xb464e4\nMOV             X19, X2                                                ; +0x10, 0xb464e8\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x14, 0xb464ec\nMOV             X22, X0                                                ; +0x18, 0xb464f0\nLDR             X0, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0xb464f4\nSTP             X23, X24, [SP,#0x70+var_40]                            ; +0x20, 0xb464f8\nMOV             X23, X1                                                ; +0x24, 0xb464fc\nLDR             X0, [X0]                                               ; +0x28, 0xb46500\nSTR             X0, [X29,#0x70+var_8]                                  ; +0x2c, 0xb46504\nCBZ             X2, loc_B46620                                         ; +0x30, 0xb46508\nADRP            X21, #_ZTIN7cocos2d8CCObjectE_ptr@PAGE                 ; +0x34, 0xb4650c\nMOV             X0, X2; lpsrc                                          ; +0x38, 0xb46510\nADRP            X2, #_ZTIN7cocos2d8CCStringE_ptr@PAGE                  ; +0x3c, 0xb46514\nMOV             X3, #0; s2d                                            ; +0x40, 0xb46518\nLDR             X21, [X21,#_ZTIN7cocos2d8CCObjectE_ptr@PAGEOFF]; `typeinfo for'cocos2d::CCObject ... ; +0x44, 0xb4651c\nLDR             X2, [X2,#_ZTIN7cocos2d8CCStringE_ptr@PAGEOFF]; lpdtype ; +0x48, 0xb46520\nMOV             X1, X21; lpstype                                       ; +0x4c, 0xb46524\nBL              __dynamic_cast                                         ; +0x50, 0xb46528\nCBZ             X0, loc_B465C0                                         ; +0x54, 0xb4652c\nMOV             X0, X19; this                                          ; +0x58, 0xb46530\nADRP            X19, #off_122EFE8@PAGE                                 ; +0x5c, 0xb46534\nADD             X24, X29, #0x70+var_10                                 ; +0x60, 0xb46538\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x64, 0xb4653c\nMOV             X1, X0; char *                                         ; +0x68, 0xb46540\nADD             X2, X29, #0x70+var_28                                  ; +0x6c, 0xb46544\nADD             X0, X29, #0x70+var_18; int                             ; +0x70, 0xb46548\nBL              sub_D153B8                                             ; +0x74, 0xb4654c\nLDR             X21, [X19,#off_122EFE8@PAGEOFF]; qword_124B6B0         ; +0x78, 0xb46550\nLDR             X3, [X29,#0x70+var_18]                                 ; +0x7c, 0xb46554\nMOV             X0, X22                                                ; +0x80, 0xb46558\nMOV             X1, X23                                                ; +0x84, 0xb4655c\nSTR             X3, [X29,#0x70+var_10]                                 ; +0x88, 0xb46560\nMOV             X2, X24                                                ; +0x8c, 0xb46564\nADD             X3, X21, #0x18                                         ; +0x90, 0xb46568\nSTR             X3, [X29,#0x70+var_18]                                 ; +0x94, 0xb4656c\nBL              _ZN13DS_Dictionary15setStringForKeyEPKcRKSs; DS_Dictionary::setStringForKey(char const*,std::string const&) ; +0x98, 0xb46570\nLDR             X1, [X29,#0x70+var_10]                                 ; +0x9c, 0xb46574\nSUB             X0, X1, #0x18; p                                       ; +0xa0, 0xb46578\nCMP             X0, X21                                                ; +0xa4, 0xb4657c\nB.NE            loc_B466A4                                             ; +0xa8, 0xb46580\nLDR             X22, [X29,#0x70+var_18]                                ; +0xac, 0xb46584\nLDR             X19, [X19,#off_122EFE8@PAGEOFF]; qword_124B6B0         ; +0xb0, 0xb46588\nSUB             X23, X22, #0x18                                        ; +0xb4, 0xb4658c\nCMP             X23, X19                                               ; +0xb8, 0xb46590\nB.NE            loc_B4666C                                             ; +0xbc, 0xb46594\nLDR             X20, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xc0, 0xb46598\nLDR             X1, [X29,#0x70+var_8]                                  ; +0xc4, 0xb4659c\nLDR             X0, [X20]                                              ; +0xc8, 0xb465a0\nCMP             X1, X0                                                 ; +0xcc, 0xb465a4\nB.NE            loc_B466F8                                             ; +0xd0, 0xb465a8\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0xd4, 0xb465ac\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0xd8, 0xb465b0\nLDP             X23, X24, [SP,#0x70+var_40]                            ; +0xdc, 0xb465b4\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0xe0, 0xb465b8\nRET                                                                    ; +0xe4, 0xb465bc\nADRP            X2, #_ZTIN7cocos2d12CCDictionaryE_ptr@PAGE             ; +0xe8, 0xb465c0\nMOV             X0, X19; lpsrc                                         ; +0xec, 0xb465c4\nMOV             X1, X21; lpstype                                       ; +0xf0, 0xb465c8\nMOV             X3, #0; s2d                                            ; +0xf4, 0xb465cc\nLDR             X2, [X2,#_ZTIN7cocos2d12CCDictionaryE_ptr@PAGEOFF]; lpdtype ; +0xf8, 0xb465d0\nBL              __dynamic_cast                                         ; +0xfc, 0xb465d4\nCBZ             X0, loc_B465F0                                         ; +0x100, 0xb465d8\nMOV             X0, X22; this                                          ; +0x104, 0xb465dc\nMOV             X1, X23; char *                                        ; +0x108, 0xb465e0\nMOV             X2, X19; cocos2d::CCDictionary *                       ; +0x10c, 0xb465e4\nBL              _ZN13DS_Dictionary13setDictForKeyEPKcPN7cocos2d12CCDictionaryE; DS_Dictionary::setDictForKey(char const*,cocos2d::CCDictionary *) ; +0x110, 0xb465e8\nB               loc_B46598                                             ; +0x114, 0xb465ec\nADRP            X2, #_ZTIN7cocos2d7CCArrayE_ptr@PAGE                   ; +0x118, 0xb465f0\nMOV             X0, X19; lpsrc                                         ; +0x11c, 0xb465f4\nMOV             X1, X21; lpstype                                       ; +0x120, 0xb465f8\nMOV             X3, #0; s2d                                            ; +0x124, 0xb465fc\nLDR             X2, [X2,#_ZTIN7cocos2d7CCArrayE_ptr@PAGEOFF]; lpdtype  ; +0x128, 0xb46600\nBL              __dynamic_cast                                         ; +0x12c, 0xb46604\nCBZ             X0, loc_B46620                                         ; +0x130, 0xb46608\nMOV             X0, X22; this                                          ; +0x134, 0xb4660c\nMOV             X1, X23; char *                                        ; +0x138, 0xb46610\nMOV             X2, X19; cocos2d::CCArray *                            ; +0x13c, 0xb46614\nBL              _ZN13DS_Dictionary14setArrayForKeyEPKcPN7cocos2d7CCArrayE; DS_Dictionary::setArrayForKey(char const*,cocos2d::CCArray *) ; +0x140, 0xb46618\nB               loc_B46598                                             ; +0x144, 0xb4661c\nLDR             X1, [X19]                                              ; +0x148, 0xb46620\nMOV             X0, X19                                                ; +0x14c, 0xb46624\nLDR             X1, [X1,#0x38]                                         ; +0x150, 0xb46628\nBLR             X1                                                     ; +0x154, 0xb4662c\nUXTB            W0, W0                                                 ; +0x158, 0xb46630\nCBZ             W0, loc_B46598                                         ; +0x15c, 0xb46634\nMOV             X0, X22; this                                          ; +0x160, 0xb46638\nMOV             X1, X23; char *                                        ; +0x164, 0xb4663c\nMOV             W3, #1; bool                                           ; +0x168, 0xb46640\nMOV             W2, #0; bool                                           ; +0x16c, 0xb46644\nBL              _ZN13DS_Dictionary16setSubDictForKeyEPKcbb; DS_Dictionary::setSubDictForKey(char const*,bool,bool) ; +0x170, 0xb46648\nLDR             X2, [X19]                                              ; +0x174, 0xb4664c\nMOV             X0, X19                                                ; +0x178, 0xb46650\nMOV             X1, X22                                                ; +0x17c, 0xb46654\nLDR             X2, [X2,#0x30]                                         ; +0x180, 0xb46658\nBLR             X2                                                     ; +0x184, 0xb4665c\nMOV             X0, X22; this                                          ; +0x188, 0xb46660\nBL              _ZN13DS_Dictionary16stepOutOfSubDictEv; DS_Dictionary::stepOutOfSubDict(void) ; +0x18c, 0xb46664\nB               loc_B46598                                             ; +0x190, 0xb46668\nADRP            X0, #pthread_create_ptr_0@PAGE                         ; +0x194, 0xb4666c\nLDR             X0, [X0,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x198, 0xb46670\nCBZ             X0, loc_B466D8                                         ; +0x19c, 0xb46674\nSUB             X22, X22, #8                                           ; +0x1a0, 0xb46678\nLDAXR           W0, [X22]                                              ; +0x1a4, 0xb4667c\nSUB             W1, W0, #1                                             ; +0x1a8, 0xb46680\nSTLXR           W2, W1, [X22]                                          ; +0x1ac, 0xb46684\nCBNZ            W2, loc_B4667C                                         ; +0x1b0, 0xb46688\nCMP             W0, WZR                                                ; +0x1b4, 0xb4668c\nB.GT            loc_B46598                                             ; +0x1b8, 0xb46690\nMOV             X0, X23; p                                             ; +0x1bc, 0xb46694\nMOV             X1, X24                                                ; +0x1c0, 0xb46698\nBL              j__ZdlPv; operator delete(void *)                      ; +0x1c4, 0xb4669c\nB               loc_B46598                                             ; +0x1c8, 0xb466a0\nADRP            X2, #pthread_create_ptr_0@PAGE                         ; +0x1cc, 0xb466a4\nLDR             X2, [X2,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x1d0, 0xb466a8\nCBZ             X2, loc_B466E8                                         ; +0x1d4, 0xb466ac\nSUB             X1, X1, #8                                             ; +0x1d8, 0xb466b0\nLDAXR           W2, [X1]                                               ; +0x1dc, 0xb466b4\nSUB             W3, W2, #1                                             ; +0x1e0, 0xb466b8\nSTLXR           W4, W3, [X1]                                           ; +0x1e4, 0xb466bc\nCBNZ            W4, loc_B466B4                                         ; +0x1e8, 0xb466c0\nCMP             W2, WZR                                                ; +0x1ec, 0xb466c4\nB.GT            loc_B46584                                             ; +0x1f0, 0xb466c8\nADD             X1, X29, #0x70+var_20                                  ; +0x1f4, 0xb466cc\nBL              j__ZdlPv; operator delete(void *)                      ; +0x1f8, 0xb466d0\nB               loc_B46584                                             ; +0x1fc, 0xb466d4\nLDUR            W0, [X22,#(dword_124B6C0 - 0x124B6C8)]                 ; +0x200, 0xb466d8\nSUB             W1, W0, #1                                             ; +0x204, 0xb466dc\nSTUR            W1, [X22,#(dword_124B6C0 - 0x124B6C8)]                 ; +0x208, 0xb466e0\nB               loc_B4668C                                             ; +0x20c, 0xb466e4\nLDUR            W2, [X1,#-8]                                           ; +0x210, 0xb466e8\nSUB             W3, W2, #1                                             ; +0x214, 0xb466ec\nSTUR            W3, [X1,#-8]                                           ; +0x218, 0xb466f0\nB               loc_B466C4                                             ; +0x21c, 0xb466f4\nBL              .__stack_chk_fail                                      ; +0x220, 0xb466f8", "xrefs": ["DS_Dictionary::setArrayForKey @ 0xb46498", "DS_Dictionary::setDictForKey @ 0xb467b8", "<???> @ 0x57c18"], "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"}