{"type": "func", "start": 5368992336, "end": 5368992884, "name": "CCMenuItemToggler::create", "pseudocode": "// \n// CCMenuItemToggler::create from 0x140045250 to 0x140045474 (548 bytes)\n// \n// 34 xrefs:\n// > GameToolbox::createToggleButton @ 0x14006478d\n// > CharacterColorPage::init @ 0x140088aba\n// > ColorSelectPopup::init @ 0x14008ef5c\n// > LevelCell::loadFromLevel @ 0x1400ae13a\n// > GJRequestCell::loadFromScore @ 0x1400bc9e3\n// > GJMessageCell::loadFromMessage @ 0x1400bdbe9\n// > EditorUI::setupCreateMenu @ 0x14010db86\n// > FRequestProfilePage::init @ 0x14013e0e8\n// > GJGarageLayer::setupIconSelect @ 0x1402753fc\n// > GJGarageLayer::setupIconSelect @ 0x14027548e\n// > GJGarageLayer::setupIconSelect @ 0x140275523\n// > GJGarageLayer::setupIconSelect @ 0x1402755b8\n// > GJGarageLayer::setupIconSelect @ 0x14027564d\n// > GJGarageLayer::setupIconSelect @ 0x1402756e2\n// > GJGarageLayer::setupIconSelect @ 0x140275777\n// > GJGarageLayer::setupIconSelect @ 0x14027580c\n// > GJGarageLayer::setupIconSelect @ 0x1402758a1\n// > GJGarageLayer::setupIconSelect @ 0x140275936\n// > GJGarageLayer::setupIconSelect @ 0x1402759cb\n// > GJAccountSettingsLayer::createToggleButton @ 0x140293b79\n// > LeaderboardsLayer::setupTabs @ 0x1402c273c\n// > LeaderboardsLayer::setupTabs @ 0x1402c283d\n// > LeaderboardsLayer::setupTabs @ 0x1402c293e\n// > LeaderboardsLayer::setupTabs @ 0x1402c2a3f\n// > LevelBrowserLayer::init @ 0x1402c9942\n// > MoreSearchLayer::createToggleButton @ 0x140317383\n// > LevelSettingsLayer::createToggleButton @ 0x140321402\n// > MessagesProfilePage::init @ 0x140336ce5\n// > VideoOptionsLayer::createToggleButton @ 0x140378a8f\n// > ShareCommentLayer::init @ 0x14048d729\n// > ShareLevelSettingsLayer::init @ 0x1404915cd\n// > ShareLevelSettingsLayer::init @ 0x14049181b\n// > SupportLayer::createToggleButton @ 0x1404c91c2\n// > <???> @ 0x1406c46f8\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\nCCMenuItemToggler *CCMenuItemToggler::create(\n        cocos2d::CCNode *a1,\n        cocos2d::CCNode *a2,\n        cocos2d::CCObject *a3,\n        cocos2d::SEL_MenuHandler *a4)\n{\n  void *v8; // rsi\n  __int64 *v9; // rbx\n  __int64 v10; // rdi\n  __int64 v11; // rax\n  __int64 *v12; // rbx\n  __int64 v13; // rdi\n  __int64 v14; // rax\n  __int64 *v15; // rbx\n  __int64 v16; // rdi\n  struct cocos2d::CCPoint v17; // rax\n  __int64 *v18; // rbx\n  __int64 v19; // rdi\n  struct cocos2d::CCPoint v20; // rax\n  cocos2d::CCPoint v22; // [rsp+20h] [rbp-38h] BYREF\n  cocos2d::CCPoint v23; // [rsp+28h] [rbp-30h] BYREF\n  struct cocos2d::CCPoint v24; // [rsp+30h] [rbp-28h] BYREF\n  struct cocos2d::CCPoint v25; // [rsp+38h] [rbp-20h] BYREF\n\n  v8 = operator new(0x190u);\n  v22 = (cocos2d::CCPoint)v8;\n  cocos2d::CCMenuItem::CCMenuItem((cocos2d::CCMenuItem *)v8);\n  *(_QWORD *)v8 = &CCMenuItemToggler::`vftable';\n  *((_QWORD *)v8 + 40) = &CCMenuItemToggler::`vftable';\n  *((_QWORD *)v8 + 47) = 0;\n  *((_QWORD *)v8 + 48) = 0;\n  *((_WORD *)v8 + 196) = 0;\n  if ( (unsigned __int8)cocos2d::CCMenuItem::initWithTarget(v8, a3, a4) )\n  {\n    *((_QWORD *)v8 + 47) = CCMenuItemSpriteExtra::create(\n                             a1,\n                             nullptr,\n                             (cocos2d::CCObject *)v8,\n                             (cocos2d::SEL_MenuHandler *)CCMenuItemToggler::normalTouch);\n    *((_QWORD *)v8 + 48) = CCMenuItemSpriteExtra::create(\n                             a2,\n                             nullptr,\n                             (cocos2d::CCObject *)v8,\n                             (cocos2d::SEL_MenuHandler *)CCMenuItemToggler::selectedTouch);\n    (*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v8 + 448LL))(v8, *((_QWORD *)v8 + 47));\n    (*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v8 + 448LL))(v8, *((_QWORD *)v8 + 48));\n    v9 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 47) + 936LL))(*((_QWORD *)v8 + 47));\n    v10 = *v9;\n    cocos2d::CCPoint::CCPoint(&v22, 0.5, 0.5);\n    (*(void (__fastcall **)(__int64 *, __int64))(v10 + 272))(v9, v11);\n    v12 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 48) + 936LL))(*((_QWORD *)v8 + 48));\n    v13 = *v12;\n    cocos2d::CCPoint::CCPoint(&v23, 0.5, 0.5);\n    (*(void (__fastcall **)(__int64 *, __int64))(v13 + 272))(v12, v14);\n    v15 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 47) + 936LL))(*((_QWORD *)v8 + 47));\n    v16 = *v15;\n    v17 = cocos2d::CCNode::convertToNodeSpace(*((cocos2d::CCNode **)v8 + 47), &v24);\n    (*(void (__fastcall **)(__int64 *, struct cocos2d::CCPoint))(v16 + 184))(v15, v17);\n    v18 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 48) + 936LL))(*((_QWORD *)v8 + 48));\n    v19 = *v18;\n    v20 = cocos2d::CCNode::convertToNodeSpace(*((cocos2d::CCNode **)v8 + 48), &v25);\n    (*(void (__fastcall **)(__int64 *, struct cocos2d::CCPoint))(v19 + 184))(v18, v20);\n    *((_BYTE *)v8 + 393) = 0;\n    CCMenuItemToggler::toggle((CCMenuItemToggler *)v8, 0);\n    cocos2d::CCObject::autorelease((cocos2d::CCObject *)v8);\n    return (CCMenuItemToggler *)v8;\n  }\n  else\n  {\n    (*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v8 + 8LL))(v8, 1);\n    return nullptr;\n  }\n}", "assembly": "; \n; CCMenuItemToggler::create from 0x140045250 to 0x140045474 (548 bytes)\n; \n; 34 xrefs:\n; > GameToolbox::createToggleButton @ 0x14006478d\n; > CharacterColorPage::init @ 0x140088aba\n; > ColorSelectPopup::init @ 0x14008ef5c\n; > LevelCell::loadFromLevel @ 0x1400ae13a\n; > GJRequestCell::loadFromScore @ 0x1400bc9e3\n; > GJMessageCell::loadFromMessage @ 0x1400bdbe9\n; > EditorUI::setupCreateMenu @ 0x14010db86\n; > FRequestProfilePage::init @ 0x14013e0e8\n; > GJGarageLayer::setupIconSelect @ 0x1402753fc\n; > GJGarageLayer::setupIconSelect @ 0x14027548e\n; > GJGarageLayer::setupIconSelect @ 0x140275523\n; > GJGarageLayer::setupIconSelect @ 0x1402755b8\n; > GJGarageLayer::setupIconSelect @ 0x14027564d\n; > GJGarageLayer::setupIconSelect @ 0x1402756e2\n; > GJGarageLayer::setupIconSelect @ 0x140275777\n; > GJGarageLayer::setupIconSelect @ 0x14027580c\n; > GJGarageLayer::setupIconSelect @ 0x1402758a1\n; > GJGarageLayer::setupIconSelect @ 0x140275936\n; > GJGarageLayer::setupIconSelect @ 0x1402759cb\n; > GJAccountSettingsLayer::createToggleButton @ 0x140293b79\n; > LeaderboardsLayer::setupTabs @ 0x1402c273c\n; > LeaderboardsLayer::setupTabs @ 0x1402c283d\n; > LeaderboardsLayer::setupTabs @ 0x1402c293e\n; > LeaderboardsLayer::setupTabs @ 0x1402c2a3f\n; > LevelBrowserLayer::init @ 0x1402c9942\n; > MoreSearchLayer::createToggleButton @ 0x140317383\n; > LevelSettingsLayer::createToggleButton @ 0x140321402\n; > MessagesProfilePage::init @ 0x140336ce5\n; > VideoOptionsLayer::createToggleButton @ 0x140378a8f\n; > ShareCommentLayer::init @ 0x14048d729\n; > ShareLevelSettingsLayer::init @ 0x1404915cd\n; > ShareLevelSettingsLayer::init @ 0x14049181b\n; > SupportLayer::createToggleButton @ 0x1404c91c2\n; > <???> @ 0x1406c46f8\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, 0x140045250\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x140045255\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x14004525a\nmov     [rsp+arg_18], rdi                                              ; +0xf, 0x14004525f\npush    r14                                                            ; +0x14, 0x140045264\nsub     rsp, 50h                                                       ; +0x16, 0x140045266\nmovaps  [rsp+58h+var_18], xmm6                                         ; +0x1a, 0x14004526a\nmov     rbx, r9                                                        ; +0x1f, 0x14004526f\nmov     rdi, r8                                                        ; +0x22, 0x140045272\nmov     rbp, rdx                                                       ; +0x25, 0x140045275\nmov     r14, rcx                                                       ; +0x28, 0x140045278\nmov     ecx, 190h; Size                                                ; +0x2b, 0x14004527b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x30, 0x140045280\nmov     rsi, rax                                                       ; +0x35, 0x140045285\nmov     [rsp+58h+var_38], rax                                          ; +0x38, 0x140045288\nmov     rcx, rax                                                       ; +0x3d, 0x14004528d\ncall    cs:??0CCMenuItem@cocos2d@@QEAA@XZ; cocos2d::CCMenuItem::CCMenuItem(void) ; +0x40, 0x140045290\nlea     rax, ??_7CCMenuItemToggler@@6B@; const CCMenuItemToggler::`vftable' ; +0x46, 0x140045296\nmov     [rsi], rax                                                     ; +0x4d, 0x14004529d\nlea     rax, ??_7CCMenuItemToggler@@6B@_0; const CCMenuItemToggler::`vftable' ; +0x50, 0x1400452a0\nmov     [rsi+140h], rax                                                ; +0x57, 0x1400452a7\nmov     qword ptr [rsi+178h], 0                                        ; +0x5e, 0x1400452ae\nmov     qword ptr [rsi+180h], 0                                        ; +0x69, 0x1400452b9\nmov     word ptr [rsi+188h], 0                                         ; +0x74, 0x1400452c4\nmov     r8, rbx                                                        ; +0x7d, 0x1400452cd\nmov     rdx, rdi                                                       ; +0x80, 0x1400452d0\nmov     rcx, rsi                                                       ; +0x83, 0x1400452d3\ncall    cs:?initWithTarget@CCMenuItem@cocos2d@@QEAA_NPEAVCCObject@2@P832@EAAX0@Z@Z; cocos2d::CCMenuItem::initWithTarget(cocos2d::CCObject *,void (cocos2d::CCObject::*)(cocos2d::CCObject *)) ; +0x86, 0x1400452d6\ntest    al, al                                                         ; +0x8c, 0x1400452dc\njz      loc_140045443                                                  ; +0x8e, 0x1400452de\nlea     r9, CCMenuItemToggler__normalTouch                             ; +0x94, 0x1400452e4\nmov     r8, rsi                                                        ; +0x9b, 0x1400452eb\nxor     edx, edx                                                       ; +0x9e, 0x1400452ee\nmov     rcx, r14                                                       ; +0xa0, 0x1400452f0\ncall    CCMenuItemSpriteExtra__create                                  ; +0xa3, 0x1400452f3\nmov     [rsi+178h], rax                                                ; +0xa8, 0x1400452f8\nlea     r9, CCMenuItemToggler__selectedTouch                           ; +0xaf, 0x1400452ff\nmov     r8, rsi                                                        ; +0xb6, 0x140045306\nxor     edx, edx                                                       ; +0xb9, 0x140045309\nmov     rcx, rbp                                                       ; +0xbb, 0x14004530b\ncall    CCMenuItemSpriteExtra__create                                  ; +0xbe, 0x14004530e\nmov     [rsi+180h], rax                                                ; +0xc3, 0x140045313\nmov     rax, [rsi]                                                     ; +0xca, 0x14004531a\nmov     rdx, [rsi+178h]                                                ; +0xcd, 0x14004531d\nmov     rcx, rsi                                                       ; +0xd4, 0x140045324\ncall    qword ptr [rax+1C0h]                                           ; +0xd7, 0x140045327\nmov     rax, [rsi]                                                     ; +0xdd, 0x14004532d\nmov     rdx, [rsi+180h]                                                ; +0xe0, 0x140045330\nmov     rcx, rsi                                                       ; +0xe7, 0x140045337\ncall    qword ptr [rax+1C0h]                                           ; +0xea, 0x14004533a\nmov     rcx, [rsi+178h]                                                ; +0xf0, 0x140045340\nmov     rax, [rcx]                                                     ; +0xf7, 0x140045347\ncall    qword ptr [rax+3A8h]                                           ; +0xfa, 0x14004534a\nmov     rbx, rax                                                       ; +0x100, 0x140045350\nmov     rdi, [rax]                                                     ; +0x103, 0x140045353\nmovss   xmm6, cs:dword_140622B08                                       ; +0x106, 0x140045356\nmovaps  xmm2, xmm6                                                     ; +0x10e, 0x14004535e\nmovaps  xmm1, xmm6                                                     ; +0x111, 0x140045361\nlea     rcx, [rsp+58h+var_38]                                          ; +0x114, 0x140045364\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x119, 0x140045369\nmov     rdx, rax                                                       ; +0x11f, 0x14004536f\nmov     rcx, rbx                                                       ; +0x122, 0x140045372\ncall    qword ptr [rdi+110h]                                           ; +0x125, 0x140045375\nmov     rcx, [rsi+180h]                                                ; +0x12b, 0x14004537b\nmov     rax, [rcx]                                                     ; +0x132, 0x140045382\ncall    qword ptr [rax+3A8h]                                           ; +0x135, 0x140045385\nmov     rbx, rax                                                       ; +0x13b, 0x14004538b\nmov     rdi, [rax]                                                     ; +0x13e, 0x14004538e\nmovaps  xmm2, xmm6                                                     ; +0x141, 0x140045391\nmovaps  xmm1, xmm6                                                     ; +0x144, 0x140045394\nlea     rcx, [rsp+58h+var_30]                                          ; +0x147, 0x140045397\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x14c, 0x14004539c\nmov     rdx, rax                                                       ; +0x152, 0x1400453a2\nmov     rcx, rbx                                                       ; +0x155, 0x1400453a5\ncall    qword ptr [rdi+110h]                                           ; +0x158, 0x1400453a8\nmov     rcx, [rsi+178h]                                                ; +0x15e, 0x1400453ae\nmov     rax, [rcx]                                                     ; +0x165, 0x1400453b5\ncall    qword ptr [rax+3A8h]                                           ; +0x168, 0x1400453b8\nmov     rbx, rax                                                       ; +0x16e, 0x1400453be\nmov     rdi, [rax]                                                     ; +0x171, 0x1400453c1\nlea     r8, stru_1406C1348                                             ; +0x174, 0x1400453c4\nlea     rdx, [rsp+58h+var_28]                                          ; +0x17b, 0x1400453cb\nmov     rcx, [rsi+178h]                                                ; +0x180, 0x1400453d0\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0x187, 0x1400453d7\nmov     rdx, rax                                                       ; +0x18d, 0x1400453dd\nmov     rcx, rbx                                                       ; +0x190, 0x1400453e0\ncall    qword ptr [rdi+0B8h]                                           ; +0x193, 0x1400453e3\nmov     rcx, [rsi+180h]                                                ; +0x199, 0x1400453e9\nmov     rax, [rcx]                                                     ; +0x1a0, 0x1400453f0\ncall    qword ptr [rax+3A8h]                                           ; +0x1a3, 0x1400453f3\nmov     rbx, rax                                                       ; +0x1a9, 0x1400453f9\nmov     rdi, [rax]                                                     ; +0x1ac, 0x1400453fc\nlea     r8, stru_1406C1348                                             ; +0x1af, 0x1400453ff\nlea     rdx, [rsp+58h+var_20]                                          ; +0x1b6, 0x140045406\nmov     rcx, [rsi+180h]                                                ; +0x1bb, 0x14004540b\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0x1c2, 0x140045412\nmov     rdx, rax                                                       ; +0x1c8, 0x140045418\nmov     rcx, rbx                                                       ; +0x1cb, 0x14004541b\ncall    qword ptr [rdi+0B8h]                                           ; +0x1ce, 0x14004541e\nmov     byte ptr [rsi+189h], 0                                         ; +0x1d4, 0x140045424\nxor     edx, edx                                                       ; +0x1db, 0x14004542b\nmov     rcx, rsi                                                       ; +0x1dd, 0x14004542d\ncall    CCMenuItemToggler__toggle                                      ; +0x1e0, 0x140045430\nmov     rcx, rsi                                                       ; +0x1e5, 0x140045435\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x1e8, 0x140045438\nmov     rax, rsi                                                       ; +0x1ee, 0x14004543e\njmp     short loc_140045454                                            ; +0x1f1, 0x140045441\nmov     r8, [rsi]                                                      ; +0x1f3, 0x140045443\nmov     edx, 1                                                         ; +0x1f6, 0x140045446\nmov     rcx, rsi                                                       ; +0x1fb, 0x14004544b\ncall    qword ptr [r8+8]                                               ; +0x1fe, 0x14004544e\nxor     eax, eax                                                       ; +0x202, 0x140045452\nmov     rbx, [rsp+58h+arg_0]                                           ; +0x204, 0x140045454\nmov     rbp, [rsp+58h+arg_8]                                           ; +0x209, 0x140045459\nmov     rsi, [rsp+58h+arg_10]                                          ; +0x20e, 0x14004545e\nmov     rdi, [rsp+58h+arg_18]                                          ; +0x213, 0x140045463\nmovaps  xmm6, [rsp+58h+var_18]                                         ; +0x218, 0x140045468\nadd     rsp, 50h                                                       ; +0x21d, 0x14004546d\npop     r14                                                            ; +0x221, 0x140045471\nretn                                                                   ; +0x223, 0x140045473", "xrefs": ["GameToolbox::createToggleButton @ 0x14006478d", "CharacterColorPage::init @ 0x140088aba", "ColorSelectPopup::init @ 0x14008ef5c", "LevelCell::loadFromLevel @ 0x1400ae13a", "GJRequestCell::loadFromScore @ 0x1400bc9e3", "GJMessageCell::loadFromMessage @ 0x1400bdbe9", "EditorUI::setupCreateMenu @ 0x14010db86", "FRequestProfilePage::init @ 0x14013e0e8", "GJGarageLayer::setupIconSelect @ 0x1402753fc", "GJGarageLayer::setupIconSelect @ 0x14027548e", "GJGarageLayer::setupIconSelect @ 0x140275523", "GJGarageLayer::setupIconSelect @ 0x1402755b8", "GJGarageLayer::setupIconSelect @ 0x14027564d", "GJGarageLayer::setupIconSelect @ 0x1402756e2", "GJGarageLayer::setupIconSelect @ 0x140275777", "GJGarageLayer::setupIconSelect @ 0x14027580c", "GJGarageLayer::setupIconSelect @ 0x1402758a1", "GJGarageLayer::setupIconSelect @ 0x140275936", "GJGarageLayer::setupIconSelect @ 0x1402759cb", "GJAccountSettingsLayer::createToggleButton @ 0x140293b79", "LeaderboardsLayer::setupTabs @ 0x1402c273c", "LeaderboardsLayer::setupTabs @ 0x1402c283d", "LeaderboardsLayer::setupTabs @ 0x1402c293e", "LeaderboardsLayer::setupTabs @ 0x1402c2a3f", "LevelBrowserLayer::init @ 0x1402c9942", "MoreSearchLayer::createToggleButton @ 0x140317383", "LevelSettingsLayer::createToggleButton @ 0x140321402", "MessagesProfilePage::init @ 0x140336ce5", "VideoOptionsLayer::createToggleButton @ 0x140378a8f", "ShareCommentLayer::init @ 0x14048d729", "ShareLevelSettingsLayer::init @ 0x1404915cd", "ShareLevelSettingsLayer::init @ 0x14049181b", "SupportLayer::createToggleButton @ 0x1404c91c2", "<???> @ 0x1406c46f8"], "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"}