{"type": "func", "start": 5372505648, "end": 5372506364, "name": "PlayerObject::toggleGhostEffect", "pseudocode": "// \n// PlayerObject::toggleGhostEffect from 0x14039ee30 to 0x14039f0fc (716 bytes)\n// \n// 13 xrefs:\n// > PlayerObject::playCompleteEffect @ 0x1403840e5\n// > PlayerObject::resetObject @ 0x140397418\n// > PlayerObject::playerDestroyed @ 0x140397ddc\n// > PlayerObject::loadFromCheckpoint @ 0x1403a2a6d\n// > PlayLayer::playEndAnimationToPos @ 0x1403abccd\n// > PlayLayer::playPlatformerEndAnimationToPos @ 0x1403ac56c\n// > PlayLayer::removeAllObjects @ 0x1403bae6b\n// > PlayLayer::removeAllObjects @ 0x1403baefc\n// > EffectGameObject::triggerObject @ 0x1404a61e3\n// > EffectGameObject::triggerObject @ 0x1404a61fe\n// > EffectGameObject::triggerObject @ 0x1404a6262\n// > EffectGameObject::triggerObject @ 0x1404a627d\n// > <???> @ 0x1406d67c4\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\n// Hidden C++ exception states: #wind=4\nvoid PlayerObject::toggleGhostEffect(PlayerObject *a1, GhostType a2)\n{\n  GhostTrailEffect *m_ghostTrail; // rdi\n  void (__fastcall ***m_delegate)(_QWORD, GhostTrailEffect *); // rcx\n  const cocos2d::ccColor3B *v5; // rax\n  GhostTrailEffect *v6; // rax\n  GhostTrailEffect *v7; // rcx\n  GhostTrailEffect *v8; // rcx\n  __int64 v9; // rdx\n  GhostTrailEffect *v10; // rax\n  GhostTrailEffect *v11; // rcx\n  GhostTrailEffect *v12; // rcx\n  __int64 *v13; // rax\n  __int64 v14; // rdx\n  void *v15; // [rsp+30h] [rbp+8h]\n\n  if ( a1->m_ghostType != a2 )\n  {\n    a1->m_ghostType = a2;\n    m_ghostTrail = a1->m_ghostTrail;\n    if ( m_ghostTrail )\n    {\n      m_delegate = (void (__fastcall ***)(_QWORD, GhostTrailEffect *))m_ghostTrail->m_delegate;\n      if ( m_delegate )\n        (**m_delegate)(m_delegate, m_ghostTrail);\n      cocos2d::CCNode::unscheduleAllSelectors(m_ghostTrail);\n      cocos2d::CCNode::stopAllActions(m_ghostTrail);\n      m_ghostTrail->removeMeAndCleanup(m_ghostTrail);\n      a1->m_ghostTrail = nullptr;\n    }\n    if ( a1->m_ghostType == Enabled )\n    {\n      v5 = a1->m_iconSprite->getColor(&a1->m_iconSprite->cocos2d::CCRGBAProtocol);\n      if ( *(_WORD *)&v5->r || v5->b )\n      {\n        v10 = GhostTrailEffect::create();\n        a1->m_ghostTrail = v10;\n        v10->m_playerObject = a1;\n        a1->m_ghostTrail->m_blendFunc = (cocos2d::ccBlendFunc)0x100000302LL;\n        a1->m_ghostTrail->m_playerScale = a1->m_vehicleSize;\n        a1->m_ghostTrail->m_opacity = 200.0;\n        v11 = a1->m_ghostTrail;\n        *(_WORD *)&v11->m_color.r = *(_WORD *)&a1->m_playerColor1.r;\n        v11->m_color.b = a1->m_playerColor1.b;\n        v12 = a1->m_ghostTrail;\n        v12->m_iconSprite = a1->m_iconSprite;\n        v12->m_snapshotInterval = 0.050000001;\n        v12->m_fadeInterval = 0.40000001;\n        v12->m_ghostScale = 0.60000002;\n        v12->m_scaleTwice = 0;\n        cocos2d::CCNode::schedule(v12, GhostTrailEffect::trailSnapshot);\n        v9 = qword_1406C2ED8;\n        if ( !qword_1406C2ED8 )\n        {\nLABEL_12:\n          v15 = operator new(0x668u);\n          v13 = (__int64 *)sub_14017AB00((__int64)v15);\n          v14 = *v13;\n          qword_1406C2ED8 = (__int64)v13;\n          (*(void (__fastcall **)(__int64 *))(v14 + 72))(v13);\n          v9 = qword_1406C2ED8;\n        }\n      }\n      else\n      {\n        v6 = GhostTrailEffect::create();\n        a1->m_ghostTrail = v6;\n        v6->m_playerObject = a1;\n        a1->m_ghostTrail->m_playerScale = a1->m_vehicleSize;\n        a1->m_ghostTrail->m_opacity = 200.0;\n        v7 = a1->m_ghostTrail;\n        *(_WORD *)&v7->m_color.r = 0;\n        v7->m_color.b = 0;\n        v8 = a1->m_ghostTrail;\n        v8->m_iconSprite = a1->m_iconSprite;\n        v8->m_snapshotInterval = 0.050000001;\n        v8->m_fadeInterval = 0.40000001;\n        v8->m_ghostScale = 0.60000002;\n        v8->m_scaleTwice = 0;\n        cocos2d::CCNode::schedule(v8, GhostTrailEffect::trailSnapshot);\n        v9 = qword_1406C2ED8;\n        if ( !qword_1406C2ED8 )\n          goto LABEL_12;\n      }\n      a1->m_ghostTrail->m_objectLayer = *(cocos2d::CCLayer **)(*(_QWORD *)(v9 + 520) + 4072LL);\n      (*(void (__fastcall **)(_QWORD, GhostTrailEffect *))(**(_QWORD **)(*(_QWORD *)(v9 + 520) + 4072LL) + 448LL))(\n        *(_QWORD *)(*(_QWORD *)(v9 + 520) + 4072LL),\n        a1->m_ghostTrail);\n    }\n  }\n}", "assembly": "; \n; PlayerObject::toggleGhostEffect from 0x14039ee30 to 0x14039f0fc (716 bytes)\n; \n; 13 xrefs:\n; > PlayerObject::playCompleteEffect @ 0x1403840e5\n; > PlayerObject::resetObject @ 0x140397418\n; > PlayerObject::playerDestroyed @ 0x140397ddc\n; > PlayerObject::loadFromCheckpoint @ 0x1403a2a6d\n; > PlayLayer::playEndAnimationToPos @ 0x1403abccd\n; > PlayLayer::playPlatformerEndAnimationToPos @ 0x1403ac56c\n; > PlayLayer::removeAllObjects @ 0x1403bae6b\n; > PlayLayer::removeAllObjects @ 0x1403baefc\n; > EffectGameObject::triggerObject @ 0x1404a61e3\n; > EffectGameObject::triggerObject @ 0x1404a61fe\n; > EffectGameObject::triggerObject @ 0x1404a6262\n; > EffectGameObject::triggerObject @ 0x1404a627d\n; > <???> @ 0x1406d67c4\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_10], rbx                                              ; +0x0, 0x14039ee30\npush    rdi                                                            ; +0x5, 0x14039ee35\nsub     rsp, 20h                                                       ; +0x6, 0x14039ee36\nmov     rbx, rcx                                                       ; +0xa, 0x14039ee3a\ncmp     [rcx+72Ch], edx                                                ; +0xd, 0x14039ee3d\njz      loc_14039F0F1                                                  ; +0x13, 0x14039ee43\nmov     [rcx+72Ch], edx                                                ; +0x19, 0x14039ee49\nmov     rdi, [rcx+730h]                                                ; +0x1f, 0x14039ee4f\ntest    rdi, rdi                                                       ; +0x26, 0x14039ee56\njz      short loc_14039EE98                                            ; +0x29, 0x14039ee59\nmov     rcx, [rdi+180h]                                                ; +0x2b, 0x14039ee5b\ntest    rcx, rcx                                                       ; +0x32, 0x14039ee62\njz      short loc_14039EE6F                                            ; +0x35, 0x14039ee65\nmov     rax, [rcx]                                                     ; +0x37, 0x14039ee67\nmov     rdx, rdi                                                       ; +0x3a, 0x14039ee6a\ncall    qword ptr [rax]                                                ; +0x3d, 0x14039ee6d\nmov     rcx, rdi                                                       ; +0x3f, 0x14039ee6f\ncall    cs:?unscheduleAllSelectors@CCNode@cocos2d@@QEAAXXZ; cocos2d::CCNode::unscheduleAllSelectors(void) ; +0x42, 0x14039ee72\nmov     rcx, rdi                                                       ; +0x48, 0x14039ee78\ncall    cs:?stopAllActions@CCNode@cocos2d@@QEAAXXZ; cocos2d::CCNode::stopAllActions(void) ; +0x4b, 0x14039ee7b\nmov     rax, [rdi]                                                     ; +0x51, 0x14039ee81\nmov     rcx, rdi                                                       ; +0x54, 0x14039ee84\ncall    qword ptr [rax+200h]                                           ; +0x57, 0x14039ee87\nmov     qword ptr [rbx+730h], 0                                        ; +0x5d, 0x14039ee8d\ncmp     dword ptr [rbx+72Ch], 1                                        ; +0x68, 0x14039ee98\njnz     loc_14039F0F1                                                  ; +0x6f, 0x14039ee9f\nmov     rcx, [rbx+738h]                                                ; +0x75, 0x14039eea5\nadd     rcx, 140h                                                      ; +0x7c, 0x14039eeac\nmov     rax, [rcx]                                                     ; +0x83, 0x14039eeb3\ncall    qword ptr [rax+8]                                              ; +0x86, 0x14039eeb6\nmovzx   ecx, word ptr [rax]                                            ; +0x89, 0x14039eeb9\nmov     [rsp+28h+arg_8], cx                                            ; +0x8c, 0x14039eebc\ntest    cl, cl                                                         ; +0x91, 0x14039eec1\njnz     loc_14039EFB1                                                  ; +0x93, 0x14039eec3\ncmp     byte ptr [rsp+28h+arg_8+1], cl                                 ; +0x99, 0x14039eec9\njnz     loc_14039EFB1                                                  ; +0x9d, 0x14039eecd\ncmp     [rax+2], cl                                                    ; +0xa3, 0x14039eed3\njnz     loc_14039EFB1                                                  ; +0xa6, 0x14039eed6\ncall    GhostTrailEffect__create                                       ; +0xac, 0x14039eedc\nmov     [rbx+730h], rax                                                ; +0xb1, 0x14039eee1\nmov     [rax+168h], rbx                                                ; +0xb8, 0x14039eee8\nmov     rcx, [rbx+730h]                                                ; +0xbf, 0x14039eeef\nmov     eax, [rbx+9F0h]                                                ; +0xc6, 0x14039eef6\nmov     [rcx+150h], eax                                                ; +0xcc, 0x14039eefc\nmov     rax, [rbx+730h]                                                ; +0xd2, 0x14039ef02\nmov     dword ptr [rax+178h], 43480000h                                ; +0xd9, 0x14039ef09\nmov     rcx, [rbx+730h]                                                ; +0xe3, 0x14039ef13\nmovzx   eax, cs:word_140529BA8                                         ; +0xea, 0x14039ef1a\nmov     [rcx+188h], ax                                                 ; +0xf1, 0x14039ef21\nmovzx   eax, cs:byte_140529BAA                                         ; +0xf8, 0x14039ef28\nmov     [rcx+18Ah], al                                                 ; +0xff, 0x14039ef2f\nmov     rax, [rbx+738h]                                                ; +0x105, 0x14039ef35\nmov     rcx, [rbx+730h]                                                ; +0x10c, 0x14039ef3c\nmov     [rcx+160h], rax                                                ; +0x113, 0x14039ef43\nmov     dword ptr [rcx+140h], 3D4CCCCDh                                ; +0x11a, 0x14039ef4a\nmov     dword ptr [rcx+144h], 3ECCCCCDh                                ; +0x124, 0x14039ef54\nmov     dword ptr [rcx+148h], 3F19999Ah                                ; +0x12e, 0x14039ef5e\nmov     byte ptr [rcx+14Ch], 0                                         ; +0x138, 0x14039ef68\nmovss   xmm2, cs:dword_1406229EC                                       ; +0x13f, 0x14039ef6f\nlea     rdx, GhostTrailEffect__trailSnapshot                           ; +0x147, 0x14039ef77\ncall    cs:?schedule@CCNode@cocos2d@@QEAAXP8CCObject@2@EAAXM@ZM@Z; cocos2d::CCNode::schedule(void (cocos2d::CCObject::*)(float),float) ; +0x14e, 0x14039ef7e\nmov     rdx, cs:qword_1406C2ED8                                        ; +0x154, 0x14039ef84\ntest    rdx, rdx                                                       ; +0x15b, 0x14039ef8b\njnz     loc_14039F0B7                                                  ; +0x15e, 0x14039ef8e\nmov     ecx, 668h; Size                                                ; +0x164, 0x14039ef94\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x169, 0x14039ef99\nmov     [rsp+28h+arg_0], rax                                           ; +0x16e, 0x14039ef9e\nmov     rcx, rax                                                       ; +0x173, 0x14039efa3\ncall    sub_14017AB00                                                  ; +0x176, 0x14039efa6\nnop                                                                    ; +0x17b, 0x14039efab\njmp     loc_14039F0A0                                                  ; +0x17c, 0x14039efac\ncall    GhostTrailEffect__create                                       ; +0x181, 0x14039efb1\nmov     [rbx+730h], rax                                                ; +0x186, 0x14039efb6\nmov     [rax+168h], rbx                                                ; +0x18d, 0x14039efbd\nmov     rcx, [rbx+730h]                                                ; +0x194, 0x14039efc4\nmov     dword ptr [rsp+28h+arg_0], 302h                                ; +0x19b, 0x14039efcb\nmov     dword ptr [rsp+28h+arg_0+4], 1                                 ; +0x1a3, 0x14039efd3\nmov     rax, [rsp+28h+arg_0]                                           ; +0x1ab, 0x14039efdb\nmov     [rcx+154h], rax                                                ; +0x1b0, 0x14039efe0\nmov     rcx, [rbx+730h]                                                ; +0x1b7, 0x14039efe7\nmov     eax, [rbx+9F0h]                                                ; +0x1be, 0x14039efee\nmov     [rcx+150h], eax                                                ; +0x1c4, 0x14039eff4\nmov     rax, [rbx+730h]                                                ; +0x1ca, 0x14039effa\nmov     dword ptr [rax+178h], 43480000h                                ; +0x1d1, 0x14039f001\nmov     rcx, [rbx+730h]                                                ; +0x1db, 0x14039f00b\nmovzx   eax, word ptr [rbx+0A8Ah]                                      ; +0x1e2, 0x14039f012\nmov     [rcx+188h], ax                                                 ; +0x1e9, 0x14039f019\nmovzx   eax, byte ptr [rbx+0A8Ch]                                      ; +0x1f0, 0x14039f020\nmov     [rcx+18Ah], al                                                 ; +0x1f7, 0x14039f027\nmov     rax, [rbx+738h]                                                ; +0x1fd, 0x14039f02d\nmov     rcx, [rbx+730h]                                                ; +0x204, 0x14039f034\nmov     [rcx+160h], rax                                                ; +0x20b, 0x14039f03b\nmov     dword ptr [rcx+140h], 3D4CCCCDh                                ; +0x212, 0x14039f042\nmov     dword ptr [rcx+144h], 3ECCCCCDh                                ; +0x21c, 0x14039f04c\nmov     dword ptr [rcx+148h], 3F19999Ah                                ; +0x226, 0x14039f056\nmov     byte ptr [rcx+14Ch], 0                                         ; +0x230, 0x14039f060\nmovss   xmm2, cs:dword_1406229EC                                       ; +0x237, 0x14039f067\nlea     rdx, GhostTrailEffect__trailSnapshot                           ; +0x23f, 0x14039f06f\ncall    cs:?schedule@CCNode@cocos2d@@QEAAXP8CCObject@2@EAAXM@ZM@Z; cocos2d::CCNode::schedule(void (cocos2d::CCObject::*)(float),float) ; +0x246, 0x14039f076\nmov     rdx, cs:qword_1406C2ED8                                        ; +0x24c, 0x14039f07c\ntest    rdx, rdx                                                       ; +0x253, 0x14039f083\njnz     short loc_14039F0B7                                            ; +0x256, 0x14039f086\nmov     ecx, 668h; Size                                                ; +0x258, 0x14039f088\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x25d, 0x14039f08d\nmov     [rsp+28h+arg_0], rax                                           ; +0x262, 0x14039f092\nmov     rcx, rax                                                       ; +0x267, 0x14039f097\ncall    sub_14017AB00                                                  ; +0x26a, 0x14039f09a\nnop                                                                    ; +0x26f, 0x14039f09f\nmov     rdx, [rax]                                                     ; +0x270, 0x14039f0a0\nmov     cs:qword_1406C2ED8, rax                                        ; +0x273, 0x14039f0a3\nmov     rcx, rax                                                       ; +0x27a, 0x14039f0aa\ncall    qword ptr [rdx+48h]                                            ; +0x27d, 0x14039f0ad\nmov     rdx, cs:qword_1406C2ED8                                        ; +0x280, 0x14039f0b0\nmov     rax, [rdx+208h]                                                ; +0x287, 0x14039f0b7\nmov     rcx, [rbx+730h]                                                ; +0x28e, 0x14039f0be\nmov     rax, [rax+0FE8h]                                               ; +0x295, 0x14039f0c5\nmov     [rcx+170h], rax                                                ; +0x29c, 0x14039f0cc\nmov     rax, [rdx+208h]                                                ; +0x2a3, 0x14039f0d3\nmov     rcx, [rax+0FE8h]                                               ; +0x2aa, 0x14039f0da\nmov     rax, [rcx]                                                     ; +0x2b1, 0x14039f0e1\nmov     rdx, [rbx+730h]                                                ; +0x2b4, 0x14039f0e4\ncall    qword ptr [rax+1C0h]                                           ; +0x2bb, 0x14039f0eb\nmov     rbx, [rsp+28h+arg_10]                                          ; +0x2c1, 0x14039f0f1\nadd     rsp, 20h                                                       ; +0x2c6, 0x14039f0f6\npop     rdi                                                            ; +0x2ca, 0x14039f0fa\nretn                                                                   ; +0x2cb, 0x14039f0fb", "xrefs": ["PlayerObject::playCompleteEffect @ 0x1403840e5", "PlayerObject::resetObject @ 0x140397418", "PlayerObject::playerDestroyed @ 0x140397ddc", "PlayerObject::loadFromCheckpoint @ 0x1403a2a6d", "PlayLayer::playEndAnimationToPos @ 0x1403abccd", "PlayLayer::playPlatformerEndAnimationToPos @ 0x1403ac56c", "PlayLayer::removeAllObjects @ 0x1403bae6b", "PlayLayer::removeAllObjects @ 0x1403baefc", "EffectGameObject::triggerObject @ 0x1404a61e3", "EffectGameObject::triggerObject @ 0x1404a61fe", "EffectGameObject::triggerObject @ 0x1404a6262", "EffectGameObject::triggerObject @ 0x1404a627d", "<???> @ 0x1406d67c4"], "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"}