{"type": "func", "start": 4735536, "end": 4736020, "name": "GJBaseGameLayer::createCustomParticle", "pseudocode": "// \n// GJBaseGameLayer::createCustomParticle from 0x484230 to 0x484414 (484 bytes)\n// \n// 0 xrefs:\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::CCParticleSystemQuad *__fastcall GJBaseGameLayer::createCustomParticle(\n        _DWORD *a1,\n        char **a2,\n        const cocos2d::ParticleStruct *a3,\n        int a4,\n        char a5)\n{\n  cocos2d::CCDictionary *v9; // r8\n  cocos2d::CCArray *v10; // r4\n  cocos2d::CCArray *v11; // r0\n  void (__fastcall *setTag)(cocos2d::CCObject *__hidden, int); // r3\n  unsigned int v13; // r0\n  unsigned int v14; // r1\n  unsigned int v15; // r11\n  _DWORD **v16; // r0\n  _DWORD *inserted; // r0\n  int v18; // r11\n  cocos2d::CCArray *v19; // r0\n  int v20; // r5\n  cocos2d::CCObject *v21; // r11\n  _DWORD *v23; // r0\n  cocos2d::CCParticleSystemQuad *v24; // r5\n  int v25; // [sp+8h] [bp-1Ch]\n  std::string v26; // [sp+18h] [bp-Ch] BYREF\n\n  v9 = (cocos2d::CCDictionary *)a1[2699];\n  sub_776584((int)&v26, *a2);\n  v10 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v9, &v26);\n  v11 = (cocos2d::CCArray *)sub_774008(&v26);\n  if ( v10 )\n  {\n    if ( a4 <= 0 )\n      goto LABEL_10;\n  }\n  else if ( a5 )\n  {\n    if ( a4 <= 0 )\n    {\n      v24 = GameToolbox::particleFromStruct(a3, nullptr, 1);\n      v24->setTag(v24, 0);\n      cocos2d::CCParticleSystem::stopSystem(v24);\n      v24->setVisible(v24, 0);\n      return v24;\n    }\n  }\n  else\n  {\n    v10 = (cocos2d::CCArray *)cocos2d::CCArray::create(v11);\n    setTag = v10->setTag;\n    ++a1[2696];\n    ((void (__fastcall *)(cocos2d::CCArray *))setTag)(v10);\n    v13 = v10->getTag(v10);\n    v14 = a1[2702];\n    v15 = v13;\n    v26.m_data.m_data = (stl::StringData<char>::Internal *)v13;\n    v25 = v13 % v14;\n    v16 = sub_46C90C(a1 + 2701, v13 % v14, &v26);\n    if ( !v16 || (inserted = *v16) == nullptr )\n    {\n      v23 = (_DWORD *)operator new(0xCu);\n      *v23 = 0;\n      v23[1] = v15;\n      v23[2] = &unk_ACDDA8;\n      inserted = std::_Hashtable<int,std::pair<int const,std::string>,std::allocator<std::pair<int const,std::string>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>>::_M_insert_unique_node(\n                   (int)(a1 + 2701),\n                   v25,\n                   v15,\n                   v23);\n    }\n    sub_775D40(inserted + 2, a2);\n    v18 = a1[2699];\n    sub_776584((int)&v26, *a2);\n    cocos2d::CCDictionary::setObject(v18, v10);\n    v19 = (cocos2d::CCArray *)sub_774008(&v26);\n    v20 = a1[2708];\n    v21 = (cocos2d::CCObject *)cocos2d::CCArray::create(v19);\n    sub_776584((int)&v26, *a2);\n    cocos2d::CCDictionary::setObject(v20, v21);\n    sub_774008(&v26);\n    if ( a4 <= 0 )\n    {\n      v24 = GameToolbox::particleFromStruct(a3, nullptr, 1);\n      v24->setTag(v24, 0);\n      cocos2d::CCParticleSystem::stopSystem(v24);\n      v24->setVisible(v24, 0);\nLABEL_11:\n      cocos2d::CCArray::addObject(v10, v24);\n      v24->m_nCustomParticleIndex = v10->getTag(v10);\n      return v24;\n    }\n  }\n  if ( cocos2d::CCArray::count(v10) >= (unsigned int)a4 )\n    return nullptr;\nLABEL_10:\n  v24 = GameToolbox::particleFromStruct(a3, nullptr, 1);\n  v24->setTag(v24, 0);\n  cocos2d::CCParticleSystem::stopSystem(v24);\n  v24->setVisible(v24, 0);\n  if ( !a5 )\n    goto LABEL_11;\n  return v24;\n}", "assembly": "; \n; GJBaseGameLayer::createCustomParticle from 0x484230 to 0x484414 (484 bytes)\n; \n; 0 xrefs:\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\nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x484230\nSUB             SP, SP, #0x24                                          ; +0x4, 0x484234\nLDR             R4, =(__stack_chk_guard_ptr - 0x484244)                ; +0x6, 0x484236\nMOV             R7, R3                                                 ; +0x8, 0x484238\nLDRB.W          R3, [SP,#0x24+arg_0]                                   ; +0xa, 0x48423a\nADD             R6, SP, #0x24+var_C                                    ; +0xe, 0x48423e\nADD             R4, PC; __stack_chk_guard_ptr                          ; +0x10, 0x484240\nLDR             R4, [R4]; __stack_chk_guard                            ; +0x12, 0x484242\nMOV             R5, R0                                                 ; +0x14, 0x484244\nMOV             R9, R1                                                 ; +0x16, 0x484246\nMOV             R10, R2                                                ; +0x18, 0x484248\nSTR             R3, [SP,#0x24+var_20]                                  ; +0x1a, 0x48424a\nADD             R2, SP, #0x24+var_10                                   ; +0x1c, 0x48424c\nLDR             R3, [R4]                                               ; +0x1e, 0x48424e\nLDR             R1, [R1]; char *                                       ; +0x20, 0x484250\nSTR             R3, [SP,#0x24+var_8]                                   ; +0x22, 0x484252\nMOVW            R3, #0x2A2C                                            ; +0x24, 0x484254\nLDR.W           R8, [R0,R3]                                            ; +0x28, 0x484258\nMOV             R0, R6; int                                            ; +0x2c, 0x48425c\nBL              sub_776584                                             ; +0x2e, 0x48425e\nMOV             R1, R6                                                 ; +0x32, 0x484262\nSTR             R4, [SP,#0x24+var_18]                                  ; +0x34, 0x484264\nMOV             R0, R8                                                 ; +0x36, 0x484266\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x38, 0x484268\nMOV             R4, R0                                                 ; +0x3c, 0x48426c\nMOV             R0, R6                                                 ; +0x3e, 0x48426e\nBL              sub_774008                                             ; +0x40, 0x484270\nCMP             R4, #0                                                 ; +0x44, 0x484274\nBNE             loc_484328                                             ; +0x46, 0x484276\nLDR             R3, [SP,#0x24+var_20]                                  ; +0x48, 0x484278\nCMP             R3, #0                                                 ; +0x4a, 0x48427a\nBNE.W           loc_4843E2                                             ; +0x4c, 0x48427c\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x50, 0x484280\nMOVW            R2, #0x2A20                                            ; +0x54, 0x484284\nLDR             R1, [R5,R2]                                            ; +0x58, 0x484288\nADD.W           R8, R5, #0x2A00                                        ; +0x5a, 0x48428a\nADD.W           R8, R8, #0x34 ; '4'                                    ; +0x5e, 0x48428e\nADDS            R1, #1                                                 ; +0x62, 0x484292\nLDR             R3, [R0]                                               ; +0x64, 0x484294\nMOV             R4, R0                                                 ; +0x66, 0x484296\nLDR             R3, [R3,#0x24]                                         ; +0x68, 0x484298\nSTR             R1, [R5,R2]                                            ; +0x6a, 0x48429a\nBLX             R3                                                     ; +0x6c, 0x48429c\nLDR             R3, [R4]                                               ; +0x6e, 0x48429e\nMOV             R0, R4                                                 ; +0x70, 0x4842a0\nLDR             R3, [R3,#0x20]                                         ; +0x72, 0x4842a2\nBLX             R3                                                     ; +0x74, 0x4842a4\nMOVW            R3, #0x2A38                                            ; +0x76, 0x4842a6\nLDR             R1, [R5,R3]                                            ; +0x7a, 0x4842aa\nMOV             R11, R0                                                ; +0x7c, 0x4842ac\nSTR             R0, [SP,#0x24+var_C]                                   ; +0x7e, 0x4842ae\nBLX             __aeabi_uidivmod                                       ; +0x80, 0x4842b0\nMOV             R0, R8                                                 ; +0x84, 0x4842b4\nMOV             R2, R6                                                 ; +0x86, 0x4842b6\nSTR             R1, [SP,#0x24+var_1C]                                  ; +0x88, 0x4842b8\nBL              sub_46C90C                                             ; +0x8a, 0x4842ba\nCMP             R0, #0                                                 ; +0x8e, 0x4842be\nBEQ             loc_484396                                             ; +0x90, 0x4842c0\nLDR             R0, [R0]                                               ; +0x92, 0x4842c2\nCMP             R0, #0                                                 ; +0x94, 0x4842c4\nBEQ             loc_484396                                             ; +0x96, 0x4842c6\nMOV             R1, R9                                                 ; +0x98, 0x4842c8\nADDS            R0, #8                                                 ; +0x9a, 0x4842ca\nBL              sub_775D40                                             ; +0x9c, 0x4842cc\nMOVW            R3, #0x2A2C                                            ; +0xa0, 0x4842d0\nLDR.W           R11, [R5,R3]                                           ; +0xa4, 0x4842d4\nADD             R6, SP, #0x24+var_C                                    ; +0xa8, 0x4842d8\nADD.W           R8, SP, #0x24+var_10                                   ; +0xaa, 0x4842da\nLDR.W           R1, [R9]; char *                                       ; +0xae, 0x4842de\nMOV             R0, R6; int                                            ; +0xb2, 0x4842e2\nMOV             R2, R8                                                 ; +0xb4, 0x4842e4\nBL              sub_776584                                             ; +0xb6, 0x4842e6\nMOV             R0, R11; int                                           ; +0xba, 0x4842ea\nMOV             R1, R4; this                                           ; +0xbc, 0x4842ec\nMOV             R2, R6                                                 ; +0xbe, 0x4842ee\nBL              _ZN7cocos2d12CCDictionary9setObjectEPNS_8CCObjectERKSs; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const&) ; +0xc0, 0x4842f0\nMOV             R0, R6                                                 ; +0xc4, 0x4842f4\nBL              sub_774008                                             ; +0xc6, 0x4842f6\nMOVW            R3, #0x2A50                                            ; +0xca, 0x4842fa\nLDR             R5, [R5,R3]                                            ; +0xce, 0x4842fe\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0xd0, 0x484300\nLDR.W           R1, [R9]; char *                                       ; +0xd4, 0x484304\nMOV             R2, R8                                                 ; +0xd8, 0x484308\nMOV             R11, R0                                                ; +0xda, 0x48430a\nMOV             R0, R6; int                                            ; +0xdc, 0x48430c\nBL              sub_776584                                             ; +0xde, 0x48430e\nMOV             R0, R5; int                                            ; +0xe2, 0x484312\nMOV             R1, R11; this                                          ; +0xe4, 0x484314\nMOV             R2, R6                                                 ; +0xe6, 0x484316\nBL              _ZN7cocos2d12CCDictionary9setObjectEPNS_8CCObjectERKSs; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const&) ; +0xe8, 0x484318\nMOV             R0, R6                                                 ; +0xec, 0x48431c\nBL              sub_774008                                             ; +0xee, 0x48431e\nCMP             R7, #0                                                 ; +0xf2, 0x484322\nBGT             loc_48432C                                             ; +0xf4, 0x484324\nB               loc_4843BA                                             ; +0xf6, 0x484326\nCMP             R7, #0                                                 ; +0xf8, 0x484328\nBLE             loc_48433A                                             ; +0xfa, 0x48432a\nMOV             R0, R4; this                                           ; +0xfc, 0x48432c\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xfe, 0x48432e\nCMP             R0, R7                                                 ; +0x102, 0x484332\nBCC             loc_48433A                                             ; +0x104, 0x484334\nMOVS            R0, #0                                                 ; +0x106, 0x484336\nB               loc_48437A                                             ; +0x108, 0x484338\nMOVS            R2, #1                                                 ; +0x10a, 0x48433a\nMOVS            R1, #0                                                 ; +0x10c, 0x48433c\nMOV             R0, R10                                                ; +0x10e, 0x48433e\nBL              _ZN11GameToolbox18particleFromStructERKN7cocos2d14ParticleStructEPNS0_20CCParticleSystemQuadEb; GameToolbox::particleFromStruct(cocos2d::ParticleStruct const&,cocos2d::CCParticleSystemQuad *,bool) ; +0x110, 0x484340\nMOVS            R1, #0                                                 ; +0x114, 0x484344\nLDR             R3, [R0]                                               ; +0x116, 0x484346\nMOV             R5, R0                                                 ; +0x118, 0x484348\nLDR             R3, [R3,#0x24]                                         ; +0x11a, 0x48434a\nBLX             R3                                                     ; +0x11c, 0x48434c\nMOV             R0, R5; this                                           ; +0x11e, 0x48434e\nBL              _ZN7cocos2d16CCParticleSystem10stopSystemEv; cocos2d::CCParticleSystem::stopSystem(void) ; +0x120, 0x484350\nLDR             R3, [R5]                                               ; +0x124, 0x484354\nMOV             R0, R5                                                 ; +0x126, 0x484356\nMOVS            R1, #0                                                 ; +0x128, 0x484358\nLDR.W           R3, [R3,#0xA4]                                         ; +0x12a, 0x48435a\nBLX             R3                                                     ; +0x12e, 0x48435e\nLDR             R3, [SP,#0x24+var_20]                                  ; +0x130, 0x484360\nCBNZ            R3, loc_484378                                         ; +0x132, 0x484362\nMOV             R0, R4; this                                           ; +0x134, 0x484364\nMOV             R1, R5; cocos2d::CCObject *                            ; +0x136, 0x484366\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x138, 0x484368\nLDR             R3, [R4]                                               ; +0x13c, 0x48436c\nMOV             R0, R4                                                 ; +0x13e, 0x48436e\nLDR             R3, [R3,#0x20]                                         ; +0x140, 0x484370\nBLX             R3                                                     ; +0x142, 0x484372\nSTR.W           R0, [R5,#0x2AC]                                        ; +0x144, 0x484374\nMOV             R0, R5                                                 ; +0x148, 0x484378\nLDR             R3, [SP,#0x24+var_18]                                  ; +0x14a, 0x48437a\nLDR             R2, [SP,#0x24+var_8]                                   ; +0x14c, 0x48437c\nLDR             R3, [R3]                                               ; +0x14e, 0x48437e\nCMP             R2, R3                                                 ; +0x150, 0x484380\nBEQ             loc_48440E                                             ; +0x152, 0x484382\nBLX             __stack_chk_fail                                       ; +0x154, 0x484384\nB               loc_48438A                                             ; +0x158, 0x484388\nMOV             R0, R6                                                 ; +0x15a, 0x48438a\nBL              sub_774008                                             ; +0x15c, 0x48438c\nBL              __cxa_end_cleanup                                      ; +0x160, 0x484390\nB               loc_48438A                                             ; +0x164, 0x484394\nMOVS            R0, #0xC; unsigned int                                 ; +0x166, 0x484396\nBL              _Znwj; operator new(uint)                              ; +0x168, 0x484398\nMOVS            R2, #0                                                 ; +0x16c, 0x48439c\nLDR             R1, [SP,#0x24+var_1C]                                  ; +0x16e, 0x48439e\nSTM.W           R0, {R2,R11}                                           ; +0x170, 0x4843a0\nMOV             R3, R0                                                 ; +0x174, 0x4843a4\nLDR             R2, =(off_AB5BA0 - 0x4843AC)                           ; +0x176, 0x4843a6\nADD             R2, PC; off_AB5BA0                                     ; +0x178, 0x4843a8\nLDR             R2, [R2]; dword_ACDD9C                                 ; +0x17a, 0x4843aa\nADDS            R2, #0xC                                               ; +0x17c, 0x4843ac\nSTR             R2, [R0,#8]                                            ; +0x17e, 0x4843ae\nMOV             R0, R8                                                 ; +0x180, 0x4843b0\nMOV             R2, R11                                                ; +0x182, 0x4843b2\nBL              _ZNSt10_HashtableIiSt4pairIKiSsESaIS2_ENSt8__detail10_Select1stESt8equal_toIiESt4hashIiENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE21_M_insert_unique_nodeEjjPNS4_10_Hash_nodeIS2_Lb0EEE; std::_Hashtable<int,std::pair<int const,std::string>,std::allocator<std::pair<int const,std::string>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>>::_M_insert_unique_node(uint,uint,std::__detail::_Hash_node<std::pair<int const,std::string>,false> *) ; +0x184, 0x4843b4\nB               loc_4842C8                                             ; +0x188, 0x4843b8\nMOVS            R2, #1                                                 ; +0x18a, 0x4843ba\nMOV             R0, R10                                                ; +0x18c, 0x4843bc\nMOVS            R1, #0                                                 ; +0x18e, 0x4843be\nBL              _ZN11GameToolbox18particleFromStructERKN7cocos2d14ParticleStructEPNS0_20CCParticleSystemQuadEb; GameToolbox::particleFromStruct(cocos2d::ParticleStruct const&,cocos2d::CCParticleSystemQuad *,bool) ; +0x190, 0x4843c0\nMOVS            R1, #0                                                 ; +0x194, 0x4843c4\nLDR             R3, [R0]                                               ; +0x196, 0x4843c6\nMOV             R5, R0                                                 ; +0x198, 0x4843c8\nLDR             R3, [R3,#0x24]                                         ; +0x19a, 0x4843ca\nBLX             R3                                                     ; +0x19c, 0x4843cc\nMOV             R0, R5; this                                           ; +0x19e, 0x4843ce\nBL              _ZN7cocos2d16CCParticleSystem10stopSystemEv; cocos2d::CCParticleSystem::stopSystem(void) ; +0x1a0, 0x4843d0\nLDR             R3, [R5]                                               ; +0x1a4, 0x4843d4\nMOV             R0, R5                                                 ; +0x1a6, 0x4843d6\nMOVS            R1, #0                                                 ; +0x1a8, 0x4843d8\nLDR.W           R3, [R3,#0xA4]                                         ; +0x1aa, 0x4843da\nBLX             R3                                                     ; +0x1ae, 0x4843de\nB               loc_484364                                             ; +0x1b0, 0x4843e0\nCMP             R7, #0                                                 ; +0x1b2, 0x4843e2\nBGT             loc_48432C                                             ; +0x1b4, 0x4843e4\nMOVS            R2, #1                                                 ; +0x1b6, 0x4843e6\nMOV             R1, R4                                                 ; +0x1b8, 0x4843e8\nMOV             R0, R10                                                ; +0x1ba, 0x4843ea\nBL              _ZN11GameToolbox18particleFromStructERKN7cocos2d14ParticleStructEPNS0_20CCParticleSystemQuadEb; GameToolbox::particleFromStruct(cocos2d::ParticleStruct const&,cocos2d::CCParticleSystemQuad *,bool) ; +0x1bc, 0x4843ec\nMOV             R1, R4                                                 ; +0x1c0, 0x4843f0\nLDR             R3, [R0]                                               ; +0x1c2, 0x4843f2\nMOV             R5, R0                                                 ; +0x1c4, 0x4843f4\nLDR             R3, [R3,#0x24]                                         ; +0x1c6, 0x4843f6\nBLX             R3                                                     ; +0x1c8, 0x4843f8\nMOV             R0, R5; this                                           ; +0x1ca, 0x4843fa\nBL              _ZN7cocos2d16CCParticleSystem10stopSystemEv; cocos2d::CCParticleSystem::stopSystem(void) ; +0x1cc, 0x4843fc\nLDR             R3, [R5]                                               ; +0x1d0, 0x484400\nMOV             R0, R5                                                 ; +0x1d2, 0x484402\nMOV             R1, R4                                                 ; +0x1d4, 0x484404\nLDR.W           R3, [R3,#0xA4]                                         ; +0x1d6, 0x484406\nBLX             R3                                                     ; +0x1da, 0x48440a\nB               loc_484378                                             ; +0x1dc, 0x48440c\nADD             SP, SP, #0x24 ; '$'                                    ; +0x1de, 0x48440e\nPOP.W           {R4-R11,PC}                                            ; +0x1e0, 0x484410", "xrefs": [], "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"}