{"type": "func", "start": 6442827376, "end": 6442827579, "name": "sub_18005BE70", "pseudocode": "// \n// sub_18005BE70 from 0x18005be70 to 0x18005bf3b (203 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1800fd6d0\n// > <???> @ 0x1801bcebc\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:21:49 +0000\n// \n\n// Hidden C++ exception states: #wind=1\ncocos2d::CCNodeRGBA *__fastcall sub_18005BE70(cocos2d::CCNodeRGBA *this, char a2)\n{\n  struct cocos2d::CCScriptEngineManager *v5; // rax\n\n  if ( (a2 & 2) != 0 )\n  {\n    sub_1800E49F8(this, 376, *((_QWORD *)this - 1), 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    *(_QWORD *)this = &cocos2d::CCMenuItem::`vftable'{for `cocos2d::CCNode'};\n    *((_QWORD *)this + 40) = &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_18005BE70 from 0x18005be70 to 0x18005bf3b (203 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1800fd6d0\n; > <???> @ 0x1801bcebc\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:21:49 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x18005be70\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x18005be75\npush    rdi                                                            ; +0xa, 0x18005be7a\nsub     rsp, 20h                                                       ; +0xb, 0x18005be7b\nmov     esi, edx                                                       ; +0xf, 0x18005be7f\nmov     rbx, rcx                                                       ; +0x11, 0x18005be81\ntest    dl, 2                                                          ; +0x14, 0x18005be84\njz      short loc_18005BECD                                            ; +0x17, 0x18005be87\nlea     r9, ??1CCMenuItem@cocos2d@@UEAA@XZ; cocos2d::CCMenuItem::~CCMenuItem(void) ; +0x19, 0x18005be89\nmov     r8, [rcx-8]                                                    ; +0x20, 0x18005be90\nmov     edx, 178h                                                      ; +0x24, 0x18005be94\ncall    sub_1800E49F8                                                  ; +0x29, 0x18005be99\ntest    sil, 1                                                         ; +0x2e, 0x18005be9e\njz      short loc_18005BEB9                                            ; +0x32, 0x18005bea2\nimul    rdx, [rbx-8], 178h                                             ; +0x34, 0x18005bea4\nadd     rdx, 8                                                         ; +0x3c, 0x18005beac\nlea     rcx, [rbx-8]; Block                                            ; +0x40, 0x18005beb0\ncall    j_j_j_free_0                                                   ; +0x44, 0x18005beb4\nlea     rax, [rbx-8]                                                   ; +0x49, 0x18005beb9\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x4d, 0x18005bebd\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x52, 0x18005bec2\nadd     rsp, 20h                                                       ; +0x57, 0x18005bec7\npop     rdi                                                            ; +0x5b, 0x18005becb\nretn                                                                   ; +0x5c, 0x18005becc\nlea     rax, ??_7CCMenuItem@cocos2d@@6BCCNode@1@@; const cocos2d::CCMenuItem::`vftable'{for `cocos2d::CCNode'} ; +0x5d, 0x18005becd\nmov     [rcx], rax                                                     ; +0x64, 0x18005bed4\nlea     rax, ??_7CCMenuItem@cocos2d@@6BCCRGBAProtocol@1@@; const cocos2d::CCMenuItem::`vftable'{for `cocos2d::CCRGBAProtocol'} ; +0x67, 0x18005bed7\nmov     [rcx+140h], rax                                                ; +0x6e, 0x18005bede\ncmp     dword ptr [rcx+170h], 0                                        ; +0x75, 0x18005bee5\njz      short loc_18005BF0C                                            ; +0x7c, 0x18005beec\ncall    ?sharedManager@CCScriptEngineManager@cocos2d@@SAPEAV12@XZ; cocos2d::CCScriptEngineManager::sharedManager(void) ; +0x7e, 0x18005beee\nmov     rcx, [rax]                                                     ; +0x83, 0x18005bef3\nmov     rax, [rcx]                                                     ; +0x86, 0x18005bef6\nmov     edx, [rbx+170h]                                                ; +0x89, 0x18005bef9\ncall    qword ptr [rax+18h]                                            ; +0x8f, 0x18005beff\nmov     dword ptr [rbx+170h], 0                                        ; +0x92, 0x18005bf02\nmov     rcx, rbx; this                                                 ; +0x9c, 0x18005bf0c\ncall    ??1CCNodeRGBA@cocos2d@@UEAA@XZ; cocos2d::CCNodeRGBA::~CCNodeRGBA(void) ; +0x9f, 0x18005bf0f\nnop                                                                    ; +0xa4, 0x18005bf14\ntest    sil, 1                                                         ; +0xa5, 0x18005bf15\njz      short loc_18005BF28                                            ; +0xa9, 0x18005bf19\nmov     edx, 178h                                                      ; +0xab, 0x18005bf1b\nmov     rcx, rbx; Block                                                ; +0xb0, 0x18005bf20\ncall    j_j_free_0                                                     ; +0xb3, 0x18005bf23\nmov     rax, rbx                                                       ; +0xb8, 0x18005bf28\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xbb, 0x18005bf2b\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xc0, 0x18005bf30\nadd     rsp, 20h                                                       ; +0xc5, 0x18005bf35\npop     rdi                                                            ; +0xc9, 0x18005bf39\nretn                                                                   ; +0xca, 0x18005bf3a", "xrefs": ["<???> @ 0x1800fd6d0", "<???> @ 0x1801bcebc"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}