{"type": "func", "start": 6442819408, "end": 6442819611, "name": "sub_180059F50", "pseudocode": "// \n// sub_180059F50 from 0x180059f50 to 0x18005a01b (203 bytes)\n// \n// 13 xrefs:\n// > cocos2d::CCMenuItemImage::create @ 0x18005a618\n// > cocos2d::CCMenuItemImage::create @ 0x18005a731\n// > cocos2d::CCMenuItemImage::create @ 0x18005a829\n// > cocos2d::CCMenuItemImage::create @ 0x18005a902\n// > cocos2d::CCMenuItemImage::create @ 0x18005a607\n// > cocos2d::CCMenuItemImage::create @ 0x18005a720\n// > cocos2d::CCMenuItemImage::create @ 0x18005a818\n// > cocos2d::CCMenuItemImage::create @ 0x18005a8f1\n// > <???> @ 0x1800f7690\n// > <???> @ 0x1800f7ad8\n// > <???> @ 0x1800f8368\n// > <???> @ 0x1800f87c8\n// > <???> @ 0x1801b2c28\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::CCNodeRGBA *__fastcall sub_180059F50(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      0x190u,\n      *((_QWORD *)this - 1),\n      (void (*)(void *))cocos2d::CCMenuItemSprite::~CCMenuItemSprite);\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_180059F50 from 0x180059f50 to 0x18005a01b (203 bytes)\n; \n; 13 xrefs:\n; > cocos2d::CCMenuItemImage::create @ 0x18005a618\n; > cocos2d::CCMenuItemImage::create @ 0x18005a731\n; > cocos2d::CCMenuItemImage::create @ 0x18005a829\n; > cocos2d::CCMenuItemImage::create @ 0x18005a902\n; > cocos2d::CCMenuItemImage::create @ 0x18005a607\n; > cocos2d::CCMenuItemImage::create @ 0x18005a720\n; > cocos2d::CCMenuItemImage::create @ 0x18005a818\n; > cocos2d::CCMenuItemImage::create @ 0x18005a8f1\n; > <???> @ 0x1800f7690\n; > <???> @ 0x1800f7ad8\n; > <???> @ 0x1800f8368\n; > <???> @ 0x1800f87c8\n; > <???> @ 0x1801b2c28\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, 0x180059f50\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x180059f55\npush    rdi                                                            ; +0xa, 0x180059f5a\nsub     rsp, 20h                                                       ; +0xb, 0x180059f5b\nmov     esi, edx                                                       ; +0xf, 0x180059f5f\nmov     rbx, rcx                                                       ; +0x11, 0x180059f61\ntest    dl, 2                                                          ; +0x14, 0x180059f64\njz      short loc_180059FAD                                            ; +0x17, 0x180059f67\nlea     r9, ??1CCMenuItemSprite@cocos2d@@UEAA@XZ; void (*)(void *)     ; +0x19, 0x180059f69\nmov     r8, [rcx-8]; unsigned __int64                                  ; +0x20, 0x180059f70\nmov     edx, 190h; unsigned __int64                                    ; +0x24, 0x180059f74\ncall    ??_M@YAXPEAX_K1P6AX0@Z@Z; `eh vector destructor iterator'(void *,unsigned __int64,unsigned __int64,void (*)(void *)) ; +0x29, 0x180059f79\ntest    sil, 1                                                         ; +0x2e, 0x180059f7e\njz      short loc_180059F99                                            ; +0x32, 0x180059f82\nimul    rdx, [rbx-8], 190h                                             ; +0x34, 0x180059f84\nadd     rdx, 8                                                         ; +0x3c, 0x180059f8c\nlea     rcx, [rbx-8]; Block                                            ; +0x40, 0x180059f90\ncall    j_j_j_free_0                                                   ; +0x44, 0x180059f94\nlea     rax, [rbx-8]                                                   ; +0x49, 0x180059f99\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x4d, 0x180059f9d\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x52, 0x180059fa2\nadd     rsp, 20h                                                       ; +0x57, 0x180059fa7\npop     rdi                                                            ; +0x5b, 0x180059fab\nretn                                                                   ; +0x5c, 0x180059fac\nlea     rax, ??_7CCMenuItem@cocos2d@@6BCCNode@1@@; const cocos2d::CCMenuItem::`vftable'{for `cocos2d::CCNode'} ; +0x5d, 0x180059fad\nmov     [rcx], rax                                                     ; +0x64, 0x180059fb4\nlea     rax, ??_7CCMenuItem@cocos2d@@6BCCRGBAProtocol@1@@; const cocos2d::CCMenuItem::`vftable'{for `cocos2d::CCRGBAProtocol'} ; +0x67, 0x180059fb7\nmov     [rcx+140h], rax                                                ; +0x6e, 0x180059fbe\ncmp     dword ptr [rcx+170h], 0                                        ; +0x75, 0x180059fc5\njz      short loc_180059FEC                                            ; +0x7c, 0x180059fcc\ncall    ?sharedManager@CCScriptEngineManager@cocos2d@@SAPEAV12@XZ; cocos2d::CCScriptEngineManager::sharedManager(void) ; +0x7e, 0x180059fce\nmov     rcx, [rax]                                                     ; +0x83, 0x180059fd3\nmov     rax, [rcx]                                                     ; +0x86, 0x180059fd6\nmov     edx, [rbx+170h]                                                ; +0x89, 0x180059fd9\ncall    qword ptr [rax+18h]                                            ; +0x8f, 0x180059fdf\nmov     dword ptr [rbx+170h], 0                                        ; +0x92, 0x180059fe2\nmov     rcx, rbx; this                                                 ; +0x9c, 0x180059fec\ncall    ??1CCNodeRGBA@cocos2d@@UEAA@XZ; cocos2d::CCNodeRGBA::~CCNodeRGBA(void) ; +0x9f, 0x180059fef\nnop                                                                    ; +0xa4, 0x180059ff4\ntest    sil, 1                                                         ; +0xa5, 0x180059ff5\njz      short loc_18005A008                                            ; +0xa9, 0x180059ff9\nmov     edx, 190h                                                      ; +0xab, 0x180059ffb\nmov     rcx, rbx; Block                                                ; +0xb0, 0x18005a000\ncall    j_j_free_0                                                     ; +0xb3, 0x18005a003\nmov     rax, rbx                                                       ; +0xb8, 0x18005a008\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xbb, 0x18005a00b\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xc0, 0x18005a010\nadd     rsp, 20h                                                       ; +0xc5, 0x18005a015\npop     rdi                                                            ; +0xc9, 0x18005a019\nretn                                                                   ; +0xca, 0x18005a01a", "xrefs": ["cocos2d::CCMenuItemImage::create @ 0x18005a618", "cocos2d::CCMenuItemImage::create @ 0x18005a731", "cocos2d::CCMenuItemImage::create @ 0x18005a829", "cocos2d::CCMenuItemImage::create @ 0x18005a902", "cocos2d::CCMenuItemImage::create @ 0x18005a607", "cocos2d::CCMenuItemImage::create @ 0x18005a720", "cocos2d::CCMenuItemImage::create @ 0x18005a818", "cocos2d::CCMenuItemImage::create @ 0x18005a8f1", "<???> @ 0x1800f7690", "<???> @ 0x1800f7ad8", "<???> @ 0x1800f8368", "<???> @ 0x1800f87c8", "<???> @ 0x1801b2c28"], "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"}