{"type": "func", "start": 6442830720, "end": 6442830917, "name": "cocos2d::CCMenuItemToggle::createWithTarget", "pseudocode": "// \n// cocos2d::CCMenuItemToggle::createWithTarget from 0x18005cb80 to 0x18005cc45 (197 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801bcff4\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::CCMenuItemToggle *__fastcall cocos2d::CCMenuItemToggle::createWithTarget(\n        __int64 a1,\n        __int64 a2,\n        cocos2d::CCArray *a3)\n{\n  cocos2d::CCMenuItemToggle *v6; // rax\n  unsigned int v7; // ebx\n  cocos2d::CCMenuItemToggle *v8; // rdi\n  struct cocos2d::CCArray *v9; // rax\n  struct cocos2d::CCObject *v10; // rax\n\n  v6 = (cocos2d::CCMenuItemToggle *)sub_1800E4AC0(0x188u);\n  v7 = 0;\n  if ( v6 )\n    v8 = cocos2d::CCMenuItemToggle::CCMenuItemToggle(v6);\n  else\n    v8 = nullptr;\n  cocos2d::CCMenuItem::initWithTarget(v8, a1, a2);\n  v9 = cocos2d::CCArray::create();\n  *((_QWORD *)v8 + 48) = v9;\n  cocos2d::CCObject::retain(v9);\n  if ( (unsigned int)cocos2d::CCArray::count(a3) )\n  {\n    do\n    {\n      v10 = cocos2d::CCArray::stringAtIndex(a3, v7);\n      cocos2d::CCArray::addObject(*((cocos2d::CCArray **)v8 + 48), v10);\n      ++v7;\n    }\n    while ( v7 < (unsigned int)cocos2d::CCArray::count(a3) );\n  }\n  *((_DWORD *)v8 + 94) = -1;\n  (*(void (__fastcall **)(cocos2d::CCMenuItemToggle *, _QWORD))(*(_QWORD *)v8 + 960LL))(v8, 0);\n  return v8;\n}", "assembly": "; \n; cocos2d::CCMenuItemToggle::createWithTarget from 0x18005cb80 to 0x18005cc45 (197 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801bcff4\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, 0x18005cb80\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x18005cb85\npush    rsi                                                            ; +0xa, 0x18005cb8a\npush    rdi                                                            ; +0xb, 0x18005cb8b\npush    r14                                                            ; +0xc, 0x18005cb8c\nsub     rsp, 20h                                                       ; +0xe, 0x18005cb8e\nmov     rsi, r8                                                        ; +0x12, 0x18005cb92\nmov     rbp, rdx                                                       ; +0x15, 0x18005cb95\nmov     r14, rcx                                                       ; +0x18, 0x18005cb98\nmov     ecx, 188h; Size                                                ; +0x1b, 0x18005cb9b\ncall    sub_1800E4AC0                                                  ; +0x20, 0x18005cba0\nmov     [rsp+38h+arg_18], rax                                          ; +0x25, 0x18005cba5\nxor     ebx, ebx                                                       ; +0x2a, 0x18005cbaa\ntest    rax, rax                                                       ; +0x2c, 0x18005cbac\njz      short loc_18005CBBE                                            ; +0x2f, 0x18005cbaf\nmov     rcx, rax; this                                                 ; +0x31, 0x18005cbb1\ncall    ??0CCMenuItemToggle@cocos2d@@QEAA@XZ; cocos2d::CCMenuItemToggle::CCMenuItemToggle(void) ; +0x34, 0x18005cbb4\nmov     rdi, rax                                                       ; +0x39, 0x18005cbb9\njmp     short loc_18005CBC1                                            ; +0x3c, 0x18005cbbc\nmov     rdi, rbx                                                       ; +0x3e, 0x18005cbbe\nmov     r8, rbp                                                        ; +0x41, 0x18005cbc1\nmov     rdx, r14                                                       ; +0x44, 0x18005cbc4\nmov     rcx, rdi                                                       ; +0x47, 0x18005cbc7\ncall    ?initWithTarget@CCMenuItem@cocos2d@@QEAA_NPEAVCCObject@2@P832@EAAX0@Z@Z; cocos2d::CCMenuItem::initWithTarget(cocos2d::CCObject *,void (cocos2d::CCObject::*)(cocos2d::CCObject *)) ; +0x4a, 0x18005cbca\ncall    ?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x4f, 0x18005cbcf\nmov     [rdi+180h], rax                                                ; +0x54, 0x18005cbd4\nmov     rcx, rax; this                                                 ; +0x5b, 0x18005cbdb\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x5e, 0x18005cbde\nmov     rcx, rsi; this                                                 ; +0x63, 0x18005cbe3\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x66, 0x18005cbe6\ntest    eax, eax                                                       ; +0x6b, 0x18005cbeb\njz      short loc_18005CC17                                            ; +0x6d, 0x18005cbed\nnop                                                                    ; +0x6f, 0x18005cbef\nmov     edx, ebx; unsigned int                                         ; +0x70, 0x18005cbf0\nmov     rcx, rsi; this                                                 ; +0x72, 0x18005cbf2\ncall    ?stringAtIndex@CCArray@cocos2d@@QEAAPEAVCCString@2@I@Z; cocos2d::CCArray::stringAtIndex(uint) ; +0x75, 0x18005cbf5\nmov     rdx, rax; struct cocos2d::CCObject *                           ; +0x7a, 0x18005cbfa\nmov     rcx, [rdi+180h]; this                                          ; +0x7d, 0x18005cbfd\ncall    ?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x84, 0x18005cc04\ninc     ebx                                                            ; +0x89, 0x18005cc09\nmov     rcx, rsi; this                                                 ; +0x8b, 0x18005cc0b\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x8e, 0x18005cc0e\ncmp     ebx, eax                                                       ; +0x93, 0x18005cc13\njb      short loc_18005CBF0                                            ; +0x95, 0x18005cc15\nmov     dword ptr [rdi+178h], 0FFFFFFFFh                               ; +0x97, 0x18005cc17\nmov     rax, [rdi]                                                     ; +0xa1, 0x18005cc21\nxor     edx, edx                                                       ; +0xa4, 0x18005cc24\nmov     rcx, rdi                                                       ; +0xa6, 0x18005cc26\ncall    qword ptr [rax+3C0h]                                           ; +0xa9, 0x18005cc29\nmov     rax, rdi                                                       ; +0xaf, 0x18005cc2f\nmov     rbx, [rsp+38h+arg_0]                                           ; +0xb2, 0x18005cc32\nmov     rbp, [rsp+38h+arg_8]                                           ; +0xb7, 0x18005cc37\nadd     rsp, 20h                                                       ; +0xbc, 0x18005cc3c\npop     r14                                                            ; +0xc0, 0x18005cc40\npop     rdi                                                            ; +0xc2, 0x18005cc42\npop     rsi                                                            ; +0xc3, 0x18005cc43\nretn                                                                   ; +0xc4, 0x18005cc44", "xrefs": ["<???> @ 0x18014cf68", "<???> @ 0x1801bcff4"], "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"}