{"type": "func", "start": 6442824352, "end": 6442824486, "name": "cocos2d::CCMenuItemToggle::initWithTarget", "pseudocode": "// \n// cocos2d::CCMenuItemToggle::initWithTarget from 0x18005b2a0 to 0x18005b326 (134 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x180138fc8\n// > <???> @ 0x180138fd8\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b2db4\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\nchar __fastcall cocos2d::CCMenuItemToggle::initWithTarget(\n        __int64 a1,\n        __int64 a2,\n        __int64 a3,\n        struct cocos2d::CCObject *a4,\n        __int64 a5)\n{\n  struct cocos2d::CCArray *v7; // rax\n  __int64 v8; // rbx\n  __int64 v9; // rax\n\n  cocos2d::CCMenuItem::initWithTarget((__int64 *)a1, a2, a3);\n  v7 = cocos2d::CCArray::create();\n  *(_QWORD *)(a1 + 384) = v7;\n  cocos2d::CCObject::retain(v7);\n  if ( a4 )\n  {\n    v8 = a5 - 8;\n    do\n    {\n      cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 384), a4);\n      a4 = *(struct cocos2d::CCObject **)(v8 + 8);\n      v8 += 8;\n    }\n    while ( a4 );\n  }\n  v9 = *(_QWORD *)a1;\n  *(_DWORD *)(a1 + 376) = -1;\n  (*(void (__fastcall **)(__int64, _QWORD))(v9 + 944))(a1, 0);\n  return 1;\n}", "assembly": "; \n; cocos2d::CCMenuItemToggle::initWithTarget from 0x18005b2a0 to 0x18005b326 (134 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x180138fc8\n; > <???> @ 0x180138fd8\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b2db4\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_8], rsi                                               ; +0x0, 0x18005b2a0\npush    rdi                                                            ; +0x5, 0x18005b2a5\nsub     rsp, 20h                                                       ; +0x6, 0x18005b2a6\nmov     rdi, r9                                                        ; +0xa, 0x18005b2aa\nmov     rsi, rcx                                                       ; +0xd, 0x18005b2ad\ncall    ?initWithTarget@CCMenuItem@cocos2d@@QEAA_NPEAVCCObject@2@P832@EAAX0@Z@Z; cocos2d::CCMenuItem::initWithTarget(cocos2d::CCObject *,void (cocos2d::CCObject::*)(cocos2d::CCObject *)) ; +0x10, 0x18005b2b0\ncall    ?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x15, 0x18005b2b5\nmov     rcx, rax; this                                                 ; +0x1a, 0x18005b2ba\nmov     [rsi+180h], rax                                                ; +0x1d, 0x18005b2bd\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x24, 0x18005b2c4\ntest    rdi, rdi                                                       ; +0x29, 0x18005b2c9\njz      short loc_18005B301                                            ; +0x2c, 0x18005b2cc\nmov     [rsp+28h+arg_0], rbx                                           ; +0x2e, 0x18005b2ce\nmov     rbx, [rsp+28h+arg_20]                                          ; +0x33, 0x18005b2d3\nadd     rbx, 0FFFFFFFFFFFFFFF8h                                        ; +0x38, 0x18005b2d8\nnop     dword ptr [rax+00h]                                            ; +0x3c, 0x18005b2dc\nmov     rcx, [rsi+180h]; this                                          ; +0x40, 0x18005b2e0\nmov     rdx, rdi; struct cocos2d::CCObject *                           ; +0x47, 0x18005b2e7\ncall    ?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x4a, 0x18005b2ea\nmov     rdi, [rbx+8]                                                   ; +0x4f, 0x18005b2ef\nlea     rbx, [rbx+8]                                                   ; +0x53, 0x18005b2f3\ntest    rdi, rdi                                                       ; +0x57, 0x18005b2f7\njnz     short loc_18005B2E0                                            ; +0x5a, 0x18005b2fa\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x5c, 0x18005b2fc\nmov     rax, [rsi]                                                     ; +0x61, 0x18005b301\nxor     edx, edx                                                       ; +0x64, 0x18005b304\nmov     rcx, rsi                                                       ; +0x66, 0x18005b306\nmov     dword ptr [rsi+178h], 0FFFFFFFFh                               ; +0x69, 0x18005b309\ncall    qword ptr [rax+3B0h]                                           ; +0x73, 0x18005b313\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x79, 0x18005b319\nmov     al, 1                                                          ; +0x7e, 0x18005b31e\nadd     rsp, 20h                                                       ; +0x80, 0x18005b320\npop     rdi                                                            ; +0x84, 0x18005b324\nretn                                                                   ; +0x85, 0x18005b325", "xrefs": ["<???> @ 0x180138fc8", "<???> @ 0x180138fd8", "<???> @ 0x1801438a8", "<???> @ 0x1801b2db4"], "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"}