{"type": "func", "start": 9049464, "end": 9050100, "name": "GJBaseGameLayer::claimCustomParticle", "pseudocode": "// \n// GJBaseGameLayer::claimCustomParticle from 0x8a1578 to 0x8a17f4 (636 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x6cac8\n// > <???> @ 0x1148ad0\n// > <???> @ 0x11907c0\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::CCParticleSystem *__fastcall GJBaseGameLayer::claimCustomParticle(\n        GJBaseGameLayer *a1,\n        const std::string *a2,\n        const cocos2d::ParticleStruct *a3,\n        int a4,\n        int a5,\n        int a6,\n        unsigned __int8 a7)\n{\n  int v12; // w23\n  cocos2d::CCArray *v13; // x0\n  cocos2d::CCArray *v14; // x20\n  cocos2d::CCParticleSystem *Object; // x19\n  cocos2d::CCArray *v16; // x0\n  cocos2d::CCNode *v17; // x20\n  bool v18; // zf\n  cocos2d::CCParticleSystem_vtbl *v19; // x1\n  char v20; // w1\n  unsigned int m_uID; // [xsp+7Ch] [xbp+7Ch] BYREF\n  std::unordered_set<int> *p_m_customParticlesUIDs; // [xsp+80h] [xbp+80h]\n\n  v12 = a7;\n  if ( a1->m_particleCount > 99999 )\n    return nullptr;\n  v13 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a1->m_customParticles, a2);\n  v14 = v13;\n  if ( v13 )\n  {\n    if ( (unsigned int)cocos2d::CCArray::count(v13) && !v12 )\n      goto LABEL_5;\n    Object = a1->createCustomParticle(a1, a2, a3, 0, v12);\n    if ( !v12 )\n      goto LABEL_5;\n  }\n  else\n  {\n    Object = a1->createCustomParticle(a1, a2, a3, 0, v12);\n    v14 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a1->m_customParticles, a2);\n    if ( !v12 )\n    {\nLABEL_5:\n      Object = (cocos2d::CCParticleSystem *)cocos2d::CCArray::lastObject(v14);\n      v16 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a1->m_claimedParticles, a2);\n      cocos2d::CCArray::addObject(v16, Object);\n      cocos2d::CCArray::removeLastObject(v14, 1);\n    }\n  }\n  if ( !Object )\n    return nullptr;\n  v17 = GJBaseGameLayer::parentForZLayer(a1, a4, 0, 4, a6);\n  v18 = v17 == Object->getParent(Object);\n  v19 = Object->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  if ( v18 )\n  {\n    if ( a5 != v19->getZOrder(Object) )\n      v17->reorderChild(v17, Object, a5);\n  }\n  else\n  {\n    if ( v19->getParent(Object) )\n      Object->removeFromParentAndCleanup(Object, 0);\n    v17->addChild_0(v17, Object, a5);\n  }\n  m_uID = Object->m_uID;\n  p_m_customParticlesUIDs = &a1->m_customParticlesUIDs;\n  std::_Hashtable<int,int,std::allocator<int>,std::__detail::_Identity,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,true,true>>::_M_insert<int,std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<int,false>>>>(\n    &a1->m_customParticlesUIDs._M_h._M_buckets,\n    (int *)&m_uID);\n  if ( v20 )\n    cocos2d::CCArray::addObject(a1->m_temporaryParticles, Object);\n  cocos2d::CCParticleSystem::resetSystem(Object);\n  Object->setVisible(Object, 1);\n  Object->setAutoRemoveOnFinish(Object, v12);\n  a1->m_particleCount += Object->getTotalParticles(Object);\n  return Object;\n}", "assembly": "; \n; GJBaseGameLayer::claimCustomParticle from 0x8a1578 to 0x8a17f4 (636 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x6cac8\n; > <???> @ 0x1148ad0\n; > <???> @ 0x11907c0\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_90]!                                ; +0x0, 0x8a1578\nMOV             X29, SP                                                ; +0x4, 0x8a157c\nSTP             X21, X22, [SP,#0x90+var_70]                            ; +0x8, 0x8a1580\nADRP            X22, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x8a1584\nMOV             X21, X0                                                ; +0x10, 0x8a1588\nSTP             X25, X26, [SP,#0x90+var_50]                            ; +0x14, 0x8a158c\nSTP             X19, X20, [SP,#0x90+var_80]                            ; +0x18, 0x8a1590\nLDR             X0, [X22,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x8a1594\nMOV             W19, #0x869F                                           ; +0x20, 0x8a1598\nMOV             W26, W3                                                ; +0x24, 0x8a159c\nLDR             W3, [X21,#0x3120]                                      ; +0x28, 0x8a15a0\nMOVK            W19, #1,LSL#16                                         ; +0x2c, 0x8a15a4\nSTR             X27, [SP,#0x90+var_40]                                 ; +0x30, 0x8a15a8\nLDR             X0, [X0]                                               ; +0x34, 0x8a15ac\nCMP             W3, W19                                                ; +0x38, 0x8a15b0\nSTP             X23, X24, [SP,#0x90+var_60]                            ; +0x3c, 0x8a15b4\nSTR             X0, [X29,#0x90+var_8]                                  ; +0x40, 0x8a15b8\nMOV             X24, X1                                                ; +0x44, 0x8a15bc\nMOV             W25, W4                                                ; +0x48, 0x8a15c0\nMOV             W27, W5                                                ; +0x4c, 0x8a15c4\nUXTB            W23, W6                                                ; +0x50, 0x8a15c8\nB.GT            loc_8A171C                                             ; +0x54, 0x8a15cc\nLDR             X0, [X21,#0x3138]                                      ; +0x58, 0x8a15d0\nSTR             X2, [X29,#0x90+var_28]                                 ; +0x5c, 0x8a15d4\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x60, 0x8a15d8\nMOV             X20, X0                                                ; +0x64, 0x8a15dc\nLDR             X2, [X29,#0x90+var_28]                                 ; +0x68, 0x8a15e0\nCBZ             X0, loc_8A177C                                         ; +0x6c, 0x8a15e4\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x70, 0x8a15e8\nLDR             X2, [X29,#0x90+var_28]                                 ; +0x74, 0x8a15ec\nCBZ             W0, loc_8A1754                                         ; +0x78, 0x8a15f0\nCBNZ            W23, loc_8A1754                                        ; +0x7c, 0x8a15f4\nMOV             X0, X20; this                                          ; +0x80, 0x8a15f8\nBL              _ZN7cocos2d7CCArray10lastObjectEv; cocos2d::CCArray::lastObject(void) ; +0x84, 0x8a15fc\nMOV             X19, X0                                                ; +0x88, 0x8a1600\nLDR             X0, [X21,#0x3180]                                      ; +0x8c, 0x8a1604\nMOV             X1, X24                                                ; +0x90, 0x8a1608\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x94, 0x8a160c\nMOV             X1, X19; cocos2d::CCObject *                           ; +0x98, 0x8a1610\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x9c, 0x8a1614\nMOV             X0, X20; this                                          ; +0xa0, 0x8a1618\nMOV             W1, #1; bool                                           ; +0xa4, 0x8a161c\nBL              _ZN7cocos2d7CCArray16removeLastObjectEb; cocos2d::CCArray::removeLastObject(bool) ; +0xa8, 0x8a1620\nCBZ             X19, loc_8A171C                                        ; +0xac, 0x8a1624\nMOV             W1, W26; int                                           ; +0xb0, 0x8a1628\nMOV             W2, #0; bool                                           ; +0xb4, 0x8a162c\nMOV             W3, #4; int                                            ; +0xb8, 0x8a1630\nMOV             W4, W27; int                                           ; +0xbc, 0x8a1634\nMOV             X0, X21; this                                          ; +0xc0, 0x8a1638\nBL              _ZN15GJBaseGameLayer15parentForZLayerEibii; GJBaseGameLayer::parentForZLayer(int,bool,int,int) ; +0xc4, 0x8a163c\nMOV             X20, X0                                                ; +0xc8, 0x8a1640\nLDR             X1, [X19]                                              ; +0xcc, 0x8a1644\nMOV             X0, X19                                                ; +0xd0, 0x8a1648\nLDR             X1, [X1,#0x1F0]                                        ; +0xd4, 0x8a164c\nBLR             X1                                                     ; +0xd8, 0x8a1650\nCMP             X20, X0                                                ; +0xdc, 0x8a1654\nLDR             X1, [X19]                                              ; +0xe0, 0x8a1658\nMOV             X0, X19                                                ; +0xe4, 0x8a165c\nB.EQ            loc_8A17C4                                             ; +0xe8, 0x8a1660\nLDR             X1, [X1,#0x1F0]                                        ; +0xec, 0x8a1664\nBLR             X1                                                     ; +0xf0, 0x8a1668\nCBZ             X0, loc_8A1684                                         ; +0xf4, 0x8a166c\nLDR             X2, [X19]                                              ; +0xf8, 0x8a1670\nMOV             X0, X19                                                ; +0xfc, 0x8a1674\nMOV             W1, #0                                                 ; +0x100, 0x8a1678\nLDR             X2, [X2,#0x200]                                        ; +0x104, 0x8a167c\nBLR             X2                                                     ; +0x108, 0x8a1680\nLDR             X3, [X20]                                              ; +0x10c, 0x8a1684\nMOV             X0, X20                                                ; +0x110, 0x8a1688\nMOV             X1, X19                                                ; +0x114, 0x8a168c\nMOV             W2, W25                                                ; +0x118, 0x8a1690\nLDR             X3, [X3,#0x1C0]                                        ; +0x11c, 0x8a1694\nBLR             X3                                                     ; +0x120, 0x8a1698\nADD             X4, X21, #3,LSL#12                                     ; +0x124, 0x8a169c\nLDR             W5, [X19,#8]                                           ; +0x128, 0x8a16a0\nADD             X4, X4, #0x190                                         ; +0x12c, 0x8a16a4\nADD             X1, X29, #0x90+var_14                                  ; +0x130, 0x8a16a8\nADD             X2, X29, #0x90+var_10                                  ; +0x134, 0x8a16ac\nMOV             X0, X4                                                 ; +0x138, 0x8a16b0\nMOV             W3, #0                                                 ; +0x13c, 0x8a16b4\nSTR             W5, [X29,#0x90+var_14]                                 ; +0x140, 0x8a16b8\nSTR             X4, [X29,#0x90+var_10]                                 ; +0x144, 0x8a16bc\nBL              _ZNSt10_HashtableIiiSaIiENSt8__detail9_IdentityESt8equal_toIiESt4hashIiENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb0ELb1ELb1EEEE9_M_insertIiNS1_10_AllocNodeISaINS1_10_Hash_nodeIiLb0EEEEEEEESt4pairINS1_14_Node_iteratorIiLb1ELb0EEEbEOT_RKT0_St17integral_constantIbLb1EE; std::_Hashtable<int,int,std::allocator<int>,std::__detail::_Identity,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,true,true>>::_M_insert<int,std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<int,false>>>>(int &&,std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<int,false>>> const&,std::integral_constant<bool,true>) ; +0x148, 0x8a16c0\nUXTB            W1, W1                                                 ; +0x14c, 0x8a16c4\nCBNZ            W1, loc_8A17B4                                         ; +0x150, 0x8a16c8\nMOV             X0, X19; this                                          ; +0x154, 0x8a16cc\nBL              _ZN7cocos2d16CCParticleSystem11resetSystemEv; cocos2d::CCParticleSystem::resetSystem(void) ; +0x158, 0x8a16d0\nLDR             X2, [X19]                                              ; +0x15c, 0x8a16d4\nMOV             X0, X19                                                ; +0x160, 0x8a16d8\nMOV             W1, #1                                                 ; +0x164, 0x8a16dc\nLDR             X2, [X2,#0x148]                                        ; +0x168, 0x8a16e0\nBLR             X2                                                     ; +0x16c, 0x8a16e4\nLDR             X2, [X19]                                              ; +0x170, 0x8a16e8\nMOV             X0, X19                                                ; +0x174, 0x8a16ec\nMOV             W1, W23                                                ; +0x178, 0x8a16f0\nLDR             X2, [X2,#0x620]                                        ; +0x17c, 0x8a16f4\nBLR             X2                                                     ; +0x180, 0x8a16f8\nLDR             X1, [X19]                                              ; +0x184, 0x8a16fc\nMOV             X0, X19                                                ; +0x188, 0x8a1700\nLDR             X1, [X1,#0x5C8]                                        ; +0x18c, 0x8a1704\nBLR             X1                                                     ; +0x190, 0x8a1708\nLDR             W1, [X21,#0x3120]                                      ; +0x194, 0x8a170c\nADD             W0, W1, W0                                             ; +0x198, 0x8a1710\nSTR             W0, [X21,#0x3120]                                      ; +0x19c, 0x8a1714\nB               loc_8A1720                                             ; +0x1a0, 0x8a1718\nMOV             X19, #0                                                ; +0x1a4, 0x8a171c\nLDR             X22, [X22,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1a8, 0x8a1720\nMOV             X0, X19                                                ; +0x1ac, 0x8a1724\nLDR             X4, [X29,#0x90+var_8]                                  ; +0x1b0, 0x8a1728\nLDR             X1, [X22]                                              ; +0x1b4, 0x8a172c\nCMP             X4, X1                                                 ; +0x1b8, 0x8a1730\nB.NE            loc_8A17F0                                             ; +0x1bc, 0x8a1734\nLDP             X19, X20, [SP,#0x90+var_80]                            ; +0x1c0, 0x8a1738\nLDP             X21, X22, [SP,#0x90+var_70]                            ; +0x1c4, 0x8a173c\nLDP             X23, X24, [SP,#0x90+var_60]                            ; +0x1c8, 0x8a1740\nLDP             X25, X26, [SP,#0x90+var_50]                            ; +0x1cc, 0x8a1744\nLDR             X27, [SP,#0x90+var_40]                                 ; +0x1d0, 0x8a1748\nLDP             X29, X30, [SP+0x90+var_90],#0x90                       ; +0x1d4, 0x8a174c\nRET                                                                    ; +0x1d8, 0x8a1750\nLDR             X5, [X21]                                              ; +0x1dc, 0x8a1754\nMOV             X0, X21                                                ; +0x1e0, 0x8a1758\nMOV             X1, X24                                                ; +0x1e4, 0x8a175c\nMOV             W3, #0                                                 ; +0x1e8, 0x8a1760\nMOV             W4, W23                                                ; +0x1ec, 0x8a1764\nLDR             X5, [X5,#0x5A8]                                        ; +0x1f0, 0x8a1768\nBLR             X5                                                     ; +0x1f4, 0x8a176c\nMOV             X19, X0                                                ; +0x1f8, 0x8a1770\nCBNZ            W23, loc_8A1624                                        ; +0x1fc, 0x8a1774\nB               loc_8A15F8                                             ; +0x200, 0x8a1778\nLDR             X5, [X21]                                              ; +0x204, 0x8a177c\nMOV             X1, X24                                                ; +0x208, 0x8a1780\nMOV             W3, #0                                                 ; +0x20c, 0x8a1784\nMOV             W4, W23                                                ; +0x210, 0x8a1788\nMOV             X0, X21                                                ; +0x214, 0x8a178c\nLDR             X5, [X5,#0x5A8]                                        ; +0x218, 0x8a1790\nBLR             X5                                                     ; +0x21c, 0x8a1794\nMOV             X19, X0                                                ; +0x220, 0x8a1798\nLDR             X0, [X21,#0x3138]                                      ; +0x224, 0x8a179c\nMOV             X1, X24                                                ; +0x228, 0x8a17a0\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x22c, 0x8a17a4\nMOV             X20, X0                                                ; +0x230, 0x8a17a8\nCBNZ            W23, loc_8A1624                                        ; +0x234, 0x8a17ac\nB               loc_8A15F8                                             ; +0x238, 0x8a17b0\nLDR             X0, [X21,#0x3188]; this                                ; +0x23c, 0x8a17b4\nMOV             X1, X19; cocos2d::CCObject *                           ; +0x240, 0x8a17b8\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x244, 0x8a17bc\nB               loc_8A16CC                                             ; +0x248, 0x8a17c0\nLDR             X1, [X1,#0x68]                                         ; +0x24c, 0x8a17c4\nBLR             X1                                                     ; +0x250, 0x8a17c8\nCMP             W25, W0                                                ; +0x254, 0x8a17cc\nB.EQ            loc_8A169C                                             ; +0x258, 0x8a17d0\nLDR             X3, [X20]                                              ; +0x25c, 0x8a17d4\nMOV             X0, X20                                                ; +0x260, 0x8a17d8\nMOV             X1, X19                                                ; +0x264, 0x8a17dc\nMOV             W2, W25                                                ; +0x268, 0x8a17e0\nLDR             X3, [X3,#0x240]                                        ; +0x26c, 0x8a17e4\nBLR             X3                                                     ; +0x270, 0x8a17e8\nB               loc_8A169C                                             ; +0x274, 0x8a17ec\nBL              .__stack_chk_fail                                      ; +0x278, 0x8a17f0", "xrefs": ["<???> @ 0x6cac8", "<???> @ 0x1148ad0", "<???> @ 0x11907c0"], "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"}