{"type": "func", "start": 7868596, "end": 7869026, "name": "EditorSFXManager::encodeDataTo", "pseudocode": "// \n// EditorSFXManager::encodeDataTo from 0x7810b4 to 0x781262 (430 bytes)\n// \n// 1 xrefs:\n// > GameManager::encodeDataTo @ 0x41de88\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:59:28 +0000\n// \n\nint __fastcall EditorSFXManager::encodeDataTo(int this, DS_Dictionary *a2)\n{\n  int v2; // r6\n  cocos2d::CCArray *v4; // r0\n  cocos2d::CCArray *v5; // r7\n  const char *i; // r8\n  int v7; // r10\n  cocos2d::CCString *v8; // r0\n  const char *CString; // r0\n  size_t v10; // r0\n  char *v11; // r1\n  cocos2d::CCArray *v12; // r0\n  cocos2d::CCArray *v13; // r7\n  const char *v14; // r8\n  int v15; // r10\n  cocos2d::CCString *v16; // r0\n  const char *v17; // r0\n  size_t v18; // r0\n  char *v19; // r1\n  const char *v20; // [sp+4h] [bp-18h]\n  const char *v21; // [sp+4h] [bp-18h]\n  int v22; // [sp+8h] [bp-14h] BYREF\n  int v23; // [sp+Ch] [bp-10h]\n  char *v24; // [sp+10h] [bp-Ch]\n\n  v2 = this;\n  if ( a2 )\n  {\n    DS_Dictionary::setIntegerForKey(a2, \"editorSFXVersion\", 1);\n    EditorSFXManager::ensureLoaded(v2);\n    EditorSFXManager::serializeAll((EditorSFXManager *)&v22, v2);\n    DS_Dictionary::setStringForKey(a2, \"editorSFX\", &v22);\n    std::string::~string((int)&v22);\n    v4 = *(cocos2d::CCArray **)(v2 + 72);\n    if ( v4 )\n      v4 = (cocos2d::CCArray *)cocos2d::CCArray::count(v4);\n    v5 = v4;\n    DS_Dictionary::setIntegerForKey(a2, \"editorSFXFavoriteCount\", (int)v4);\n    for ( i = nullptr; (int)i < (int)v5; ++i )\n    {\n      v7 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(v2 + 72), (unsigned int)i);\n      if ( v7 )\n      {\n        v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"editorSFXFavorite_%d\", i);\n        CString = (const char *)cocos2d::CCString::getCString(v8);\n        v22 = 0;\n        v23 = 0;\n        v24 = nullptr;\n        v20 = CString;\n        v10 = strlen(CString);\n        std::string::__init(&v22, v20, v10);\n        if ( (v22 & 1) != 0 )\n          v11 = v24;\n        else\n          v11 = (char *)&v22 + 1;\n        DS_Dictionary::setSubDictForKey(a2, v11, 0, 1);\n        (*(void (__fastcall **)(int, DS_Dictionary *))(*(_DWORD *)v7 + 24))(v7, a2);\n        DS_Dictionary::stepOutOfSubDict(a2);\n        std::string::~string((int)&v22);\n      }\n    }\n    v12 = *(cocos2d::CCArray **)(v2 + 76);\n    if ( v12 )\n      v12 = (cocos2d::CCArray *)cocos2d::CCArray::count(v12);\n    v13 = v12;\n    DS_Dictionary::setIntegerForKey(a2, \"editorSFXMyCount\", (int)v12);\n    v14 = nullptr;\n    DS_Dictionary::setIntegerForKey(a2, \"editorSFXNextLocalID\", *(_DWORD *)(v2 + 80));\n    while ( (int)v14 < (int)v13 )\n    {\n      v15 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(v2 + 76), (unsigned int)v14);\n      if ( v15 )\n      {\n        v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"editorSFXMy_%d\", v14);\n        v17 = (const char *)cocos2d::CCString::getCString(v16);\n        v22 = 0;\n        v23 = 0;\n        v24 = nullptr;\n        v21 = v17;\n        v18 = strlen(v17);\n        std::string::__init(&v22, v21, v18);\n        if ( (v22 & 1) != 0 )\n          v19 = v24;\n        else\n          v19 = (char *)&v22 + 1;\n        DS_Dictionary::setSubDictForKey(a2, v19, 0, 1);\n        (*(void (__fastcall **)(int, DS_Dictionary *))(*(_DWORD *)v15 + 24))(v15, a2);\n        DS_Dictionary::stepOutOfSubDict(a2);\n        std::string::~string((int)&v22);\n      }\n      ++v14;\n    }\n    return DS_Dictionary::setFloatForKey(a2, \"editorSFXGlobalVolume\", *(float *)(v2 + 96));\n  }\n  return this;\n}", "assembly": "; \n; EditorSFXManager::encodeDataTo from 0x7810b4 to 0x781262 (430 bytes)\n; \n; 1 xrefs:\n; > GameManager::encodeDataTo @ 0x41de88\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:59:28 +0000\n; \nLDR             R3, =(__stack_chk_guard_ptr - 0x7810BE)                ; +0x0, 0x7810b4\nPUSH.W          {R4-R11,LR}                                            ; +0x2, 0x7810b6\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x6, 0x7810ba\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x8, 0x7810bc\nSUB             SP, SP, #0x1C                                          ; +0xa, 0x7810be\nMOV             R6, R0                                                 ; +0xc, 0x7810c0\nLDR             R2, [R3]                                               ; +0xe, 0x7810c2\nMOV             R4, R1                                                 ; +0x10, 0x7810c4\nSTR             R3, [SP,#0x1C+var_1C]                                  ; +0x12, 0x7810c6\nSTR             R2, [SP,#0x1C+var_8]                                   ; +0x14, 0x7810c8\nCMP             R1, #0                                                 ; +0x16, 0x7810ca\nBEQ.W           loc_78124E                                             ; +0x18, 0x7810cc\nMOV             R0, R1; this                                           ; +0x1c, 0x7810d0\nLDR             R1, =(aEditorsfxversi - 0x7810DC); \"editorSFXVersion\"  ; +0x1e, 0x7810d2\nMOVS            R2, #1; int                                            ; +0x20, 0x7810d4\nADD             R5, SP, #0x1C+var_14                                   ; +0x22, 0x7810d6\nADD             R1, PC; \"editorSFXVersion\"                             ; +0x24, 0x7810d8\nBL              _ZN13DS_Dictionary16setIntegerForKeyEPKci; DS_Dictionary::setIntegerForKey(char const*,int) ; +0x26, 0x7810da\nMOV             R0, R6; this                                           ; +0x2a, 0x7810de\nBL              _ZN16EditorSFXManager12ensureLoadedEv; EditorSFXManager::ensureLoaded(void) ; +0x2c, 0x7810e0\nMOV             R0, R5; this                                           ; +0x30, 0x7810e4\nMOV             R1, R6                                                 ; +0x32, 0x7810e6\nBL              _ZN16EditorSFXManager12serializeAllEv; EditorSFXManager::serializeAll(void) ; +0x34, 0x7810e8\nLDR             R1, =(aEditorsfx - 0x7810F6); \"editorSFX\"              ; +0x38, 0x7810ec\nMOV             R0, R4                                                 ; +0x3a, 0x7810ee\nMOV             R2, R5                                                 ; +0x3c, 0x7810f0\nADD             R1, PC; \"editorSFX\"                                    ; +0x3e, 0x7810f2\nBL              _ZN13DS_Dictionary15setStringForKeyEPKcRKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE; DS_Dictionary::setStringForKey(char const*,std::string const&) ; +0x40, 0x7810f4\nMOV             R0, R5                                                 ; +0x44, 0x7810f8\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x46, 0x7810fa\nLDR             R0, [R6,#0x48]; this                                   ; +0x4a, 0x7810fe\nCBZ             R0, loc_781106                                         ; +0x4c, 0x781100\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x4e, 0x781102\nLDR             R1, =(aEditorsfxfavor - 0x781112); \"editorSFXFavoriteCount\" ; +0x52, 0x781106\nMOV             R7, R0                                                 ; +0x54, 0x781108\nMOV             R2, R7; int                                            ; +0x56, 0x78110a\nMOV             R0, R4; this                                           ; +0x58, 0x78110c\nADD             R1, PC; \"editorSFXFavoriteCount\"                       ; +0x5a, 0x78110e\nLDR.W           R11, =(aEditorsfxfavor_0 - 0x781120); \"editorSFXFavorite_%d\" ; +0x5c, 0x781110\nBL              _ZN13DS_Dictionary16setIntegerForKeyEPKci; DS_Dictionary::setIntegerForKey(char const*,int) ; +0x60, 0x781114\nMOV.W           R8, #0                                                 ; +0x64, 0x781118\nADD             R11, PC; \"editorSFXFavorite_%d\"                        ; +0x68, 0x78111c\nMOV             R9, R8                                                 ; +0x6a, 0x78111e\nCMP             R8, R7                                                 ; +0x6c, 0x781120\nBGE             loc_781194                                             ; +0x6e, 0x781122\nLDR             R0, [R6,#0x48]; this                                   ; +0x70, 0x781124\nMOV             R1, R8; unsigned int                                   ; +0x72, 0x781126\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x74, 0x781128\nMOV             R10, R0                                                ; +0x78, 0x78112c\nCBZ             R0, loc_78118E                                         ; +0x7a, 0x78112e\nMOV             R1, R8; char *                                         ; +0x7c, 0x781130\nMOV             R0, R11; this                                          ; +0x7e, 0x781132\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x80, 0x781134\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x84, 0x781138\nSTR.W           R9, [SP,#0x1C+var_14]                                  ; +0x88, 0x78113c\nSTR.W           R9, [SP,#0x1C+var_10]                                  ; +0x8c, 0x781140\nSTR.W           R9, [SP,#0x1C+var_C]                                   ; +0x90, 0x781144\nSTR             R0, [SP,#0x1C+var_18]                                  ; +0x94, 0x781148\nBLX             strlen                                                 ; +0x96, 0x78114a\nLDR             R1, [SP,#0x1C+var_18]                                  ; +0x9a, 0x78114e\nMOV             R2, R0                                                 ; +0x9c, 0x781150\nMOV             R0, R5                                                 ; +0x9e, 0x781152\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0xa0, 0x781154\nLDRB.W          R3, [SP,#0x1C+var_14]                                  ; +0xa4, 0x781158\nMOV             R0, R4; this                                           ; +0xa8, 0x78115c\nLSLS            R2, R3, #0x1F                                          ; +0xaa, 0x78115e\nMOV.W           R2, #0; bool                                           ; +0xac, 0x781160\nIT PL                                                                  ; +0xb0, 0x781164\nADDPL.W         R1, SP, #0x1C+var_14+1                                 ; +0xb2, 0x781166\nMOV.W           R3, #1; bool                                           ; +0xb6, 0x78116a\nIT MI                                                                  ; +0xba, 0x78116e\nLDRMI           R1, [SP,#0x1C+var_C]; char *                           ; +0xbc, 0x781170\nBL              _ZN13DS_Dictionary16setSubDictForKeyEPKcbb; DS_Dictionary::setSubDictForKey(char const*,bool,bool) ; +0xbe, 0x781172\nLDR.W           R3, [R10]                                              ; +0xc2, 0x781176\nMOV             R0, R10                                                ; +0xc6, 0x78117a\nMOV             R1, R4                                                 ; +0xc8, 0x78117c\nLDR             R3, [R3,#0x18]                                         ; +0xca, 0x78117e\nBLX             R3                                                     ; +0xcc, 0x781180\nMOV             R0, R4; this                                           ; +0xce, 0x781182\nBL              _ZN13DS_Dictionary16stepOutOfSubDictEv; DS_Dictionary::stepOutOfSubDict(void) ; +0xd0, 0x781184\nMOV             R0, R5                                                 ; +0xd4, 0x781188\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xd6, 0x78118a\nADD.W           R8, R8, #1                                             ; +0xda, 0x78118e\nB               loc_781120                                             ; +0xde, 0x781192\nLDR             R0, [R6,#0x4C]; this                                   ; +0xe0, 0x781194\nCBZ             R0, loc_78119C                                         ; +0xe2, 0x781196\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xe4, 0x781198\nLDR             R1, =(aEditorsfxmycou - 0x7811A8); \"editorSFXMyCount\"  ; +0xe8, 0x78119c\nMOV             R7, R0                                                 ; +0xea, 0x78119e\nMOV             R2, R7; int                                            ; +0xec, 0x7811a0\nMOV             R0, R4; this                                           ; +0xee, 0x7811a2\nADD             R1, PC; \"editorSFXMyCount\"                             ; +0xf0, 0x7811a4\nLDR.W           R11, =(aEditorsfxmyD - 0x7811C2); \"editorSFXMy_%d\"     ; +0xf2, 0x7811a6\nBL              _ZN13DS_Dictionary16setIntegerForKeyEPKci; DS_Dictionary::setIntegerForKey(char const*,int) ; +0xf6, 0x7811aa\nLDR             R1, =(aEditorsfxnextl - 0x7811B8); \"editorSFXNextLocalID\" ; +0xfa, 0x7811ae\nMOV             R0, R4; this                                           ; +0xfc, 0x7811b0\nLDR             R2, [R6,#0x50]; int                                    ; +0xfe, 0x7811b2\nADD             R1, PC; \"editorSFXNextLocalID\"                         ; +0x100, 0x7811b4\nMOV.W           R8, #0                                                 ; +0x102, 0x7811b6\nBL              _ZN13DS_Dictionary16setIntegerForKeyEPKci; DS_Dictionary::setIntegerForKey(char const*,int) ; +0x106, 0x7811ba\nADD             R11, PC; \"editorSFXMy_%d\"                              ; +0x10a, 0x7811be\nMOV             R9, R8                                                 ; +0x10c, 0x7811c0\nCMP             R8, R7                                                 ; +0x10e, 0x7811c2\nBGE             loc_781232                                             ; +0x110, 0x7811c4\nLDR             R0, [R6,#0x4C]; this                                   ; +0x112, 0x7811c6\nMOV             R1, R8; unsigned int                                   ; +0x114, 0x7811c8\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x116, 0x7811ca\nMOV             R10, R0                                                ; +0x11a, 0x7811ce\nCBZ             R0, loc_78122C                                         ; +0x11c, 0x7811d0\nMOV             R1, R8; char *                                         ; +0x11e, 0x7811d2\nMOV             R0, R11; this                                          ; +0x120, 0x7811d4\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x122, 0x7811d6\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x126, 0x7811da\nSTR.W           R9, [SP,#0x1C+var_14]                                  ; +0x12a, 0x7811de\nSTR.W           R9, [SP,#0x1C+var_10]                                  ; +0x12e, 0x7811e2\nSTR.W           R9, [SP,#0x1C+var_C]                                   ; +0x132, 0x7811e6\nSTR             R0, [SP,#0x1C+var_18]                                  ; +0x136, 0x7811ea\nBLX             strlen                                                 ; +0x138, 0x7811ec\nLDR             R1, [SP,#0x1C+var_18]                                  ; +0x13c, 0x7811f0\nMOV             R2, R0                                                 ; +0x13e, 0x7811f2\nMOV             R0, R5                                                 ; +0x140, 0x7811f4\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x142, 0x7811f6\nLDRB.W          R3, [SP,#0x1C+var_14]                                  ; +0x146, 0x7811fa\nMOV             R0, R4; this                                           ; +0x14a, 0x7811fe\nMOVS            R2, #0; bool                                           ; +0x14c, 0x781200\nLSLS            R3, R3, #0x1F                                          ; +0x14e, 0x781202\nMOV.W           R3, #1; bool                                           ; +0x150, 0x781204\nITE PL                                                                 ; +0x154, 0x781208\nADDPL.W         R1, SP, #0x1C+var_14+1                                 ; +0x156, 0x78120a\nLDRMI           R1, [SP,#0x1C+var_C]; char *                           ; +0x15a, 0x78120e\nBL              _ZN13DS_Dictionary16setSubDictForKeyEPKcbb; DS_Dictionary::setSubDictForKey(char const*,bool,bool) ; +0x15c, 0x781210\nLDR.W           R3, [R10]                                              ; +0x160, 0x781214\nMOV             R0, R10                                                ; +0x164, 0x781218\nMOV             R1, R4                                                 ; +0x166, 0x78121a\nLDR             R3, [R3,#0x18]                                         ; +0x168, 0x78121c\nBLX             R3                                                     ; +0x16a, 0x78121e\nMOV             R0, R4; this                                           ; +0x16c, 0x781220\nBL              _ZN13DS_Dictionary16stepOutOfSubDictEv; DS_Dictionary::stepOutOfSubDict(void) ; +0x16e, 0x781222\nMOV             R0, R5                                                 ; +0x172, 0x781226\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x174, 0x781228\nADD.W           R8, R8, #1                                             ; +0x178, 0x78122c\nB               loc_7811C2                                             ; +0x17c, 0x781230\nLDR             R1, =(aEditorsfxgloba - 0x78123C); \"editorSFXGlobalVolume\" ; +0x17e, 0x781232\nMOV             R0, R4; this                                           ; +0x180, 0x781234\nLDR             R2, [R6,#0x60]; float                                  ; +0x182, 0x781236\nADD             R1, PC; \"editorSFXGlobalVolume\"                        ; +0x184, 0x781238\nBL              _ZN13DS_Dictionary14setFloatForKeyEPKcf; DS_Dictionary::setFloatForKey(char const*,float) ; +0x186, 0x78123a\nB               loc_78124E                                             ; +0x18a, 0x78123e\nB               loc_781242                                             ; +0x18c, 0x781240\nMOV             R0, R5                                                 ; +0x18e, 0x781242\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x190, 0x781244\nBL              __cxa_end_cleanup                                      ; +0x194, 0x781248\nB               loc_781242                                             ; +0x198, 0x78124c\nLDR             R3, [SP,#0x1C+var_1C]                                  ; +0x19a, 0x78124e\nLDR             R2, [SP,#0x1C+var_8]                                   ; +0x19c, 0x781250\nLDR             R3, [R3]                                               ; +0x19e, 0x781252\nCMP             R2, R3                                                 ; +0x1a0, 0x781254\nBEQ             loc_78125C                                             ; +0x1a2, 0x781256\nBLX             __stack_chk_fail                                       ; +0x1a4, 0x781258\nADD             SP, SP, #0x1C                                          ; +0x1a8, 0x78125c\nPOP.W           {R4-R11,PC}                                            ; +0x1aa, 0x78125e", "xrefs": ["GameManager::encodeDataTo @ 0x41de88"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}