{"type": "func", "start": 6442819200, "end": 6442819403, "name": "sub_180059E80", "pseudocode": "// \n// sub_180059E80 from 0x180059e80 to 0x180059f4b (203 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1800f7268\n// > <???> @ 0x1801b2c1c\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=1\ncocos2d::CCNodeRGBA *__fastcall sub_180059E80(cocos2d::CCNodeRGBA *this, char a2)\n{\n  struct cocos2d::CCScriptEngineManager *v5; // rax\n\n  if ( (a2 & 2) != 0 )\n  {\n    `eh vector destructor iterator'(\n      this,\n      0x178u,\n      *((_QWORD *)this - 1),\n      (void (*)(void *))cocos2d::CCMenuItem::~CCMenuItem);\n    if ( (a2 & 1) != 0 )\n      j_j_j_free_0((char *)this - 8);\n    return (cocos2d::CCNodeRGBA *)((char *)this - 8);\n  }\n  else\n  {\n    this->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (cocos2d::CCNodeRGBA_vtbl *)&cocos2d::CCMenuItem::`vftable'{for `cocos2d::CCNode'};\n    this->cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&cocos2d::CCMenuItem::`vftable'{for `cocos2d::CCRGBAProtocol'};\n    if ( *((_DWORD *)this + 92) )\n    {\n      v5 = cocos2d::CCScriptEngineManager::sharedManager();\n      (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)v5 + 24LL))(*(_QWORD *)v5, *((unsigned int *)this + 92));\n      *((_DWORD *)this + 92) = 0;\n    }\n    cocos2d::CCNodeRGBA::~CCNodeRGBA(this);\n    if ( (a2 & 1) != 0 )\n      j_j_free_0(this);\n    return this;\n  }\n}", "assembly": "; \n; sub_180059E80 from 0x180059e80 to 0x180059f4b (203 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1800f7268\n; > <???> @ 0x1801b2c1c\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_0], rbx                                               ; +0x0, 0x180059e80\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x180059e85\npush    rdi                                                            ; +0xa, 0x180059e8a\nsub     rsp, 20h                                                       ; +0xb, 0x180059e8b\nmov     esi, edx                                                       ; +0xf, 0x180059e8f\nmov     rbx, rcx                                                       ; +0x11, 0x180059e91\ntest    dl, 2                                                          ; +0x14, 0x180059e94\njz      short loc_180059EDD                                            ; +0x17, 0x180059e97\nlea     r9, ??1CCMenuItem@cocos2d@@UEAA@XZ; void (*)(void *)           ; +0x19, 0x180059e99\nmov     r8, [rcx-8]; unsigned __int64                                  ; +0x20, 0x180059ea0\nmov     edx, 178h; unsigned __int64                                    ; +0x24, 0x180059ea4\ncall    ??_M@YAXPEAX_K1P6AX0@Z@Z; `eh vector destructor iterator'(void *,unsigned __int64,unsigned __int64,void (*)(void *)) ; +0x29, 0x180059ea9\ntest    sil, 1                                                         ; +0x2e, 0x180059eae\njz      short loc_180059EC9                                            ; +0x32, 0x180059eb2\nimul    rdx, [rbx-8], 178h                                             ; +0x34, 0x180059eb4\nadd     rdx, 8                                                         ; +0x3c, 0x180059ebc\nlea     rcx, [rbx-8]; Block                                            ; +0x40, 0x180059ec0\ncall    j_j_j_free_0                                                   ; +0x44, 0x180059ec4\nlea     rax, [rbx-8]                                                   ; +0x49, 0x180059ec9\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x4d, 0x180059ecd\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x52, 0x180059ed2\nadd     rsp, 20h                                                       ; +0x57, 0x180059ed7\npop     rdi                                                            ; +0x5b, 0x180059edb\nretn                                                                   ; +0x5c, 0x180059edc\nlea     rax, ??_7CCMenuItem@cocos2d@@6BCCNode@1@@; const cocos2d::CCMenuItem::`vftable'{for `cocos2d::CCNode'} ; +0x5d, 0x180059edd\nmov     [rcx], rax                                                     ; +0x64, 0x180059ee4\nlea     rax, ??_7CCMenuItem@cocos2d@@6BCCRGBAProtocol@1@@; const cocos2d::CCMenuItem::`vftable'{for `cocos2d::CCRGBAProtocol'} ; +0x67, 0x180059ee7\nmov     [rcx+140h], rax                                                ; +0x6e, 0x180059eee\ncmp     dword ptr [rcx+170h], 0                                        ; +0x75, 0x180059ef5\njz      short loc_180059F1C                                            ; +0x7c, 0x180059efc\ncall    ?sharedManager@CCScriptEngineManager@cocos2d@@SAPEAV12@XZ; cocos2d::CCScriptEngineManager::sharedManager(void) ; +0x7e, 0x180059efe\nmov     rcx, [rax]                                                     ; +0x83, 0x180059f03\nmov     rax, [rcx]                                                     ; +0x86, 0x180059f06\nmov     edx, [rbx+170h]                                                ; +0x89, 0x180059f09\ncall    qword ptr [rax+18h]                                            ; +0x8f, 0x180059f0f\nmov     dword ptr [rbx+170h], 0                                        ; +0x92, 0x180059f12\nmov     rcx, rbx; this                                                 ; +0x9c, 0x180059f1c\ncall    ??1CCNodeRGBA@cocos2d@@UEAA@XZ; cocos2d::CCNodeRGBA::~CCNodeRGBA(void) ; +0x9f, 0x180059f1f\nnop                                                                    ; +0xa4, 0x180059f24\ntest    sil, 1                                                         ; +0xa5, 0x180059f25\njz      short loc_180059F38                                            ; +0xa9, 0x180059f29\nmov     edx, 178h                                                      ; +0xab, 0x180059f2b\nmov     rcx, rbx; Block                                                ; +0xb0, 0x180059f30\ncall    j_j_free_0                                                     ; +0xb3, 0x180059f33\nmov     rax, rbx                                                       ; +0xb8, 0x180059f38\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xbb, 0x180059f3b\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xc0, 0x180059f40\nadd     rsp, 20h                                                       ; +0xc5, 0x180059f45\npop     rdi                                                            ; +0xc9, 0x180059f49\nretn                                                                   ; +0xca, 0x180059f4a", "xrefs": ["<???> @ 0x1800f7268", "<???> @ 0x1801b2c1c"], "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"}