{"type": "func", "start": 5371072640, "end": 5371073143, "name": "GJBaseGameLayer::claimCustomParticle", "pseudocode": "// \n// GJBaseGameLayer::claimCustomParticle from 0x140241080 to 0x140241277 (503 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x1405670c0\n// > <???> @ 0x1405c9ca8\n// > <???> @ 0x1406ce3f4\n// > <???> @ 0x1406ce400\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  cocos2d::CCArray *v12; // rax\n  unsigned __int8 v13; // r14\n  cocos2d::CCArray *v14; // rsi\n  cocos2d::CCParticleSystem *Object; // rbx\n  cocos2d::CCArray *v16; // rax\n  cocos2d::CCNode *v17; // rsi\n  __int64 v18; // rax\n  cocos2d::CCParticleSystem_vtbl *v19; // rdx\n  int v20; // eax\n  _BOOL8 v21; // rdx\n  unsigned __int8 v22; // [rsp+20h] [rbp-38h]\n  _BYTE v23[40]; // [rsp+30h] [rbp-28h] BYREF\n  unsigned int m_uID; // [rsp+60h] [rbp+8h] BYREF\n\n  if ( a1->m_particleCount >= 100000 )\n    return nullptr;\n  v12 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a1->m_customParticles, a2);\n  v13 = a7;\n  v14 = v12;\n  if ( v12 && cocos2d::CCArray::count(v12) && !v13 )\n    goto LABEL_9;\n  v22 = v13;\n  Object = a1->createCustomParticle(a1, a2, a3, 0, v22);\n  if ( !v14 )\n    v14 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a1->m_customParticles, a2);\n  if ( !v13 )\n  {\nLABEL_9:\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  if ( Object )\n  {\n    v17 = GJBaseGameLayer::parentForZLayer(a1, a4, 0, 4, a6);\n    v18 = (__int64)Object->getParent(Object);\n    v19 = Object->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    if ( (cocos2d::CCNode *)v18 == v17 )\n    {\n      v20 = v19->getZOrder(Object);\n      if ( v20 != a5 )\n        ((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCParticleSystem *))v17->reorderChild)(v17, Object);\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    sub_140060D70((__int64)&a1->m_customParticlesUIDs, (__int64)v23, (unsigned __int8 *)&m_uID);\n    if ( v23[8] )\n      cocos2d::CCArray::addObject(a1->m_temporaryParticles, Object);\n    cocos2d::CCParticleSystem::resetSystem(Object);\n    LOBYTE(v21) = 1;\n    Object->setVisible(Object, v21);\n    Object->setAutoRemoveOnFinish(Object, v13);\n    a1->m_particleCount += Object->getTotalParticles(Object);\n  }\n  return Object;\n}", "assembly": "; \n; GJBaseGameLayer::claimCustomParticle from 0x140241080 to 0x140241277 (503 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x1405670c0\n; > <???> @ 0x1405c9ca8\n; > <???> @ 0x1406ce3f4\n; > <???> @ 0x1406ce400\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\nmov     [rsp+arg_18], rbx                                              ; +0x0, 0x140241080\npush    rbp                                                            ; +0x5, 0x140241085\npush    rdi                                                            ; +0x6, 0x140241086\npush    r15                                                            ; +0x7, 0x140241087\nsub     rsp, 40h                                                       ; +0x9, 0x140241089\ncmp     dword ptr [rcx+30B0h], 186A0h                                  ; +0xd, 0x14024108d\nmov     r15d, r9d                                                      ; +0x17, 0x140241097\nmov     rbx, r8                                                        ; +0x1a, 0x14024109a\nmov     rbp, rdx                                                       ; +0x1d, 0x14024109d\nmov     rdi, rcx                                                       ; +0x20, 0x1402410a0\njl      short loc_1402410B5                                            ; +0x23, 0x1402410a3\nxor     eax, eax                                                       ; +0x25, 0x1402410a5\nmov     rbx, [rsp+58h+arg_18]                                          ; +0x27, 0x1402410a7\nadd     rsp, 40h                                                       ; +0x2c, 0x1402410ac\npop     r15                                                            ; +0x30, 0x1402410b0\npop     rdi                                                            ; +0x32, 0x1402410b2\npop     rbp                                                            ; +0x33, 0x1402410b3\nretn                                                                   ; +0x34, 0x1402410b4\nmov     rcx, [rcx+30C8h]                                               ; +0x35, 0x1402410b5\nmov     [rsp+58h+arg_8], rsi                                           ; +0x3c, 0x1402410bc\nmov     [rsp+58h+arg_10], r14                                          ; +0x41, 0x1402410c1\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0x46, 0x1402410c6\nmovzx   r14d, [rsp+58h+arg_30]                                         ; +0x4c, 0x1402410cc\nmov     rsi, rax                                                       ; +0x55, 0x1402410d5\ntest    rax, rax                                                       ; +0x58, 0x1402410d8\njz      short loc_1402410EF                                            ; +0x5b, 0x1402410db\nmov     rcx, rax                                                       ; +0x5d, 0x1402410dd\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x60, 0x1402410e0\ntest    eax, eax                                                       ; +0x66, 0x1402410e6\njz      short loc_1402410EF                                            ; +0x68, 0x1402410e8\ntest    r14b, r14b                                                     ; +0x6a, 0x1402410ea\njz      short loc_140241129                                            ; +0x6d, 0x1402410ed\nmov     rax, [rdi]                                                     ; +0x6f, 0x1402410ef\nxor     r9d, r9d                                                       ; +0x72, 0x1402410f2\nmov     r8, rbx                                                        ; +0x75, 0x1402410f5\nmov     [rsp+58h+var_38], r14b                                         ; +0x78, 0x1402410f8\nmov     rdx, rbp                                                       ; +0x7d, 0x1402410fd\nmov     rcx, rdi                                                       ; +0x80, 0x140241100\ncall    qword ptr [rax+510h]                                           ; +0x83, 0x140241103\nmov     rbx, rax                                                       ; +0x89, 0x140241109\ntest    rsi, rsi                                                       ; +0x8c, 0x14024110c\njnz     short loc_140241124                                            ; +0x8f, 0x14024110f\nmov     rcx, [rdi+30C8h]                                               ; +0x91, 0x140241111\nmov     rdx, rbp                                                       ; +0x98, 0x140241118\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0x9b, 0x14024111b\nmov     rsi, rax                                                       ; +0xa1, 0x140241121\ntest    r14b, r14b                                                     ; +0xa4, 0x140241124\njnz     short loc_14024115C                                            ; +0xa7, 0x140241127\nmov     rcx, rsi                                                       ; +0xa9, 0x140241129\ncall    cs:?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0xac, 0x14024112c\nmov     rcx, [rdi+3118h]                                               ; +0xb2, 0x140241132\nmov     rdx, rbp                                                       ; +0xb9, 0x140241139\nmov     rbx, rax                                                       ; +0xbc, 0x14024113c\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0xbf, 0x14024113f\nmov     rcx, rax                                                       ; +0xc5, 0x140241145\nmov     rdx, rbx                                                       ; +0xc8, 0x140241148\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xcb, 0x14024114b\nmov     dl, 1                                                          ; +0xd1, 0x140241151\nmov     rcx, rsi                                                       ; +0xd3, 0x140241153\ncall    cs:?removeLastObject@CCArray@cocos2d@@QEAAX_N@Z; cocos2d::CCArray::removeLastObject(bool) ; +0xd6, 0x140241156\ntest    rbx, rbx                                                       ; +0xdc, 0x14024115c\njz      loc_14024125C                                                  ; +0xdf, 0x14024115f\nmov     eax, [rsp+58h+arg_28]                                          ; +0xe5, 0x140241165\nmov     r9d, 4                                                         ; +0xec, 0x14024116c\nxor     r8d, r8d                                                       ; +0xf2, 0x140241172\nmov     dword ptr [rsp+58h+var_38], eax                                ; +0xf5, 0x140241175\nmov     edx, r15d                                                      ; +0xf9, 0x140241179\nmov     rcx, rdi                                                       ; +0xfc, 0x14024117c\ncall    GJBaseGameLayer__parentForZLayer                               ; +0xff, 0x14024117f\nmov     rdx, [rbx]                                                     ; +0x104, 0x140241184\nmov     rcx, rbx                                                       ; +0x107, 0x140241187\nmov     rsi, rax                                                       ; +0x10a, 0x14024118a\ncall    qword ptr [rdx+1E8h]                                           ; +0x10d, 0x14024118d\nmov     rdx, [rbx]                                                     ; +0x113, 0x140241193\nmov     rcx, rbx                                                       ; +0x116, 0x140241196\ncmp     rax, rsi                                                       ; +0x119, 0x140241199\njz      short loc_1402411D0                                            ; +0x11c, 0x14024119c\ncall    qword ptr [rdx+1E8h]                                           ; +0x11e, 0x14024119e\ntest    rax, rax                                                       ; +0x124, 0x1402411a4\njz      short loc_1402411B7                                            ; +0x127, 0x1402411a7\nmov     rax, [rbx]                                                     ; +0x129, 0x1402411a9\nxor     edx, edx                                                       ; +0x12c, 0x1402411ac\nmov     rcx, rbx                                                       ; +0x12e, 0x1402411ae\ncall    qword ptr [rax+1F8h]                                           ; +0x131, 0x1402411b1\nmov     rax, [rsi]                                                     ; +0x137, 0x1402411b7\nmov     rdx, rbx                                                       ; +0x13a, 0x1402411ba\nmov     r8d, [rsp+58h+arg_20]                                          ; +0x13d, 0x1402411bd\nmov     rcx, rsi                                                       ; +0x145, 0x1402411c5\ncall    qword ptr [rax+1B8h]                                           ; +0x148, 0x1402411c8\njmp     short loc_1402411EF                                            ; +0x14e, 0x1402411ce\ncall    qword ptr [rdx+60h]                                            ; +0x150, 0x1402411d0\nmov     r8d, [rsp+58h+arg_20]                                          ; +0x153, 0x1402411d3\ncmp     eax, r8d                                                       ; +0x15b, 0x1402411db\njz      short loc_1402411EF                                            ; +0x15e, 0x1402411de\nmov     rax, [rsi]                                                     ; +0x160, 0x1402411e0\nmov     rdx, rbx                                                       ; +0x163, 0x1402411e3\nmov     rcx, rsi                                                       ; +0x166, 0x1402411e6\ncall    qword ptr [rax+238h]                                           ; +0x169, 0x1402411e9\nmov     eax, [rbx+8]                                                   ; +0x16f, 0x1402411ef\nlea     rcx, [rdi+3128h]                                               ; +0x172, 0x1402411f2\nlea     r8, [rsp+58h+arg_0]                                            ; +0x179, 0x1402411f9\nmov     [rsp+58h+arg_0], eax                                           ; +0x17e, 0x1402411fe\nlea     rdx, [rsp+58h+var_28]                                          ; +0x182, 0x140241202\ncall    sub_140060D70                                                  ; +0x187, 0x140241207\ncmp     [rsp+58h+var_20], 0                                            ; +0x18c, 0x14024120c\njz      short loc_140241223                                            ; +0x191, 0x140241211\nmov     rcx, [rdi+3120h]                                               ; +0x193, 0x140241213\nmov     rdx, rbx                                                       ; +0x19a, 0x14024121a\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x19d, 0x14024121d\nmov     rcx, rbx                                                       ; +0x1a3, 0x140241223\ncall    cs:?resetSystem@CCParticleSystem@cocos2d@@QEAAXXZ; cocos2d::CCParticleSystem::resetSystem(void) ; +0x1a6, 0x140241226\nmov     rax, [rbx]                                                     ; +0x1ac, 0x14024122c\nmov     dl, 1                                                          ; +0x1af, 0x14024122f\nmov     rcx, rbx                                                       ; +0x1b1, 0x140241231\ncall    qword ptr [rax+140h]                                           ; +0x1b4, 0x140241234\nmov     rax, [rbx]                                                     ; +0x1ba, 0x14024123a\nmovzx   edx, r14b                                                      ; +0x1bd, 0x14024123d\nmov     rcx, rbx                                                       ; +0x1c1, 0x140241241\ncall    qword ptr [rax+5F8h]                                           ; +0x1c4, 0x140241244\nmov     rax, [rbx]                                                     ; +0x1ca, 0x14024124a\nmov     rcx, rbx                                                       ; +0x1cd, 0x14024124d\ncall    qword ptr [rax+5C0h]                                           ; +0x1d0, 0x140241250\nadd     [rdi+30B0h], eax                                               ; +0x1d6, 0x140241256\nmov     r14, [rsp+58h+arg_10]                                          ; +0x1dc, 0x14024125c\nmov     rax, rbx                                                       ; +0x1e1, 0x140241261\nmov     rbx, [rsp+58h+arg_18]                                          ; +0x1e4, 0x140241264\nmov     rsi, [rsp+58h+arg_8]                                           ; +0x1e9, 0x140241269\nadd     rsp, 40h                                                       ; +0x1ee, 0x14024126e\npop     r15                                                            ; +0x1f2, 0x140241272\npop     rdi                                                            ; +0x1f4, 0x140241274\npop     rbp                                                            ; +0x1f5, 0x140241275\nretn                                                                   ; +0x1f6, 0x140241276", "xrefs": ["<???> @ 0x1405670c0", "<???> @ 0x1405c9ca8", "<???> @ 0x1406ce3f4", "<???> @ 0x1406ce400"], "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"}