{"type": "func", "start": 5371411168, "end": 5371411683, "name": "GJAccountSettingsLayer::createToggleButton", "pseudocode": "// \n// GJAccountSettingsLayer::createToggleButton from 0x140293ae0 to 0x140293ce3 (515 bytes)\n// \n// 9 xrefs:\n// > GJAccountSettingsLayer::init @ 0x140292884\n// > GJAccountSettingsLayer::init @ 0x14029293f\n// > GJAccountSettingsLayer::init @ 0x1402929eb\n// > GJAccountSettingsLayer::init @ 0x140292c11\n// > GJAccountSettingsLayer::init @ 0x140292cb0\n// > GJAccountSettingsLayer::init @ 0x140292eba\n// > GJAccountSettingsLayer::init @ 0x140292f6d\n// > GJAccountSettingsLayer::init @ 0x140293011\n// > <???> @ 0x1406d1a00\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 *__fastcall GJAccountSettingsLayer::createToggleButton(\n        __int64 a1,\n        const char *a2,\n        cocos2d::SEL_MenuHandler *a3,\n        __int64 a4,\n        cocos2d::CCNode *a5,\n        __int64 a6,\n        float a7,\n        float a8)\n{\n  struct cocos2d::CCSprite *v11; // rbp\n  struct cocos2d::CCSprite *v12; // rbx\n  CCMenuItemToggler *v13; // r15\n  CCMenuItemToggler_vtbl *v14; // rbx\n  struct cocos2d::CCPoint v15; // rax\n  const char *v16; // rcx\n  cocos2d::CCLabelBMFont *v17; // rdi\n  float v18; // xmm0_4\n  cocos2d::CCLabelBMFont_vtbl *v19; // rbx\n  double v20; // xmm0_8\n  const cocos2d::CCPoint *v21; // rax\n  float *v22; // rax\n  struct cocos2d::CCPoint v24[3]; // [rsp+20h] [rbp-68h] BYREF\n\n  v24[2] = (struct cocos2d::CCPoint)a2;\n  v11 = cocos2d::CCSprite::createWithSpriteFrameName(\"GJ_checkOn_001.png\");\n  v12 = cocos2d::CCSprite::createWithSpriteFrameName(\"GJ_checkOff_001.png\");\n  ((void (__fastcall *)(struct cocos2d::CCSprite *))v11->setScale_0)(v11);\n  ((void (__fastcall *)(struct cocos2d::CCSprite *))v12->setScale_0)(v12);\n  v13 = CCMenuItemToggler::create(v11, v12, (cocos2d::CCObject *)a1, a3);\n  CCMenuItemToggler::toggle(v13, 1);\n  a5->addChild_1(a5, v13);\n  v14 = v13->cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  v15 = cocos2d::CCNode::convertToNodeSpace(a5, v24);\n  ((void (__fastcall *)(CCMenuItemToggler *, struct cocos2d::CCPoint))v14->setPosition_0)(v13, v15);\n  *(_DWORD *)(*(_QWORD *)&v13->m_nScriptTapHandler + 372LL) = 1069547520;\n  HIDWORD(v13->m_offButton->m_pfnSelector.adj) = 1069547520;\n  CCMenuItemToggler::toggle(v13, (bool)v13->m_onButton);\n  v16 = a2;\n  if ( *((_QWORD *)a2 + 3) > 0xFu )\n    v16 = *(const char **)a2;\n  v17 = cocos2d::CCLabelBMFont::create(v16, (const char *)&qword_14052A4D8);\n  v18 = (*(float (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 576) + 448LL))(\n          *(_QWORD *)(a1 + 576),\n          v17);\n  v19 = v17->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  v20 = cocos2d::CCPoint::CCPoint(v18, 0.0);\n  v19->setAnchorPoint(v17, v21);\n  v22 = (float *)v11->getContentSize(v11);\n  cocos2d::CCPoint::CCPoint(*(float *)&v20, (float)((float)(*v22 * 0.5) * 0.5) + 4.0);\n  cocos2d::CCPoint::operator+(a6, v24);\n  v17->setPosition_0(v17, v24);\n  cocos2d::CCLabelBMFont::limitLabelWidth(v17, a7, a8, 0.0);\n  sub_14003A830((__int64)a2);\n  return v13;\n}", "assembly": "; \n; GJAccountSettingsLayer::createToggleButton from 0x140293ae0 to 0x140293ce3 (515 bytes)\n; \n; 9 xrefs:\n; > GJAccountSettingsLayer::init @ 0x140292884\n; > GJAccountSettingsLayer::init @ 0x14029293f\n; > GJAccountSettingsLayer::init @ 0x1402929eb\n; > GJAccountSettingsLayer::init @ 0x140292c11\n; > GJAccountSettingsLayer::init @ 0x140292cb0\n; > GJAccountSettingsLayer::init @ 0x140292eba\n; > GJAccountSettingsLayer::init @ 0x140292f6d\n; > GJAccountSettingsLayer::init @ 0x140293011\n; > <???> @ 0x1406d1a00\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_18], rbx                                              ; +0x0, 0x140293ae0\npush    rbp                                                            ; +0x5, 0x140293ae5\npush    rsi                                                            ; +0x6, 0x140293ae6\npush    rdi                                                            ; +0x7, 0x140293ae7\npush    r12                                                            ; +0x8, 0x140293ae8\npush    r13                                                            ; +0xa, 0x140293aea\npush    r14                                                            ; +0xc, 0x140293aec\npush    r15                                                            ; +0xe, 0x140293aee\nsub     rsp, 50h                                                       ; +0x10, 0x140293af0\nmovaps  [rsp+88h+var_48], xmm6                                         ; +0x14, 0x140293af4\nmov     rax, cs:__security_cookie                                      ; +0x19, 0x140293af9\nxor     rax, rsp                                                       ; +0x20, 0x140293b00\nmov     [rsp+88h+var_50], rax                                          ; +0x23, 0x140293b03\nmov     rdi, r8                                                        ; +0x28, 0x140293b08\nmov     r14, rdx                                                       ; +0x2b, 0x140293b0b\nmov     r13, rcx                                                       ; +0x2e, 0x140293b0e\nmov     [rsp+88h+var_58], rdx                                          ; +0x31, 0x140293b11\nmov     rsi, [rsp+88h+arg_20]                                          ; +0x36, 0x140293b16\nmov     r12, [rsp+88h+arg_28]                                          ; +0x3e, 0x140293b1e\nlea     rcx, aGjCheckon001Pn; \"GJ_checkOn_001.png\"                     ; +0x46, 0x140293b26\ncall    cs:?createWithSpriteFrameName@CCSprite@cocos2d@@SAPEAV12@PEBD@Z; cocos2d::CCSprite::createWithSpriteFrameName(char const *) ; +0x4d, 0x140293b2d\nmov     rbp, rax                                                       ; +0x53, 0x140293b33\nlea     rcx, aGjCheckoff001P; \"GJ_checkOff_001.png\"                    ; +0x56, 0x140293b36\ncall    cs:?createWithSpriteFrameName@CCSprite@cocos2d@@SAPEAV12@PEBD@Z; cocos2d::CCSprite::createWithSpriteFrameName(char const *) ; +0x5d, 0x140293b3d\nmov     rbx, rax                                                       ; +0x63, 0x140293b43\nmov     rdx, [rbp+0]                                                   ; +0x66, 0x140293b46\nmovss   xmm6, cs:dword_140622B08                                       ; +0x6a, 0x140293b4a\nmovaps  xmm1, xmm6                                                     ; +0x72, 0x140293b52\nmov     rcx, rbp                                                       ; +0x75, 0x140293b55\ncall    qword ptr [rdx+0A0h]                                           ; +0x78, 0x140293b58\nmov     rdx, [rbx]                                                     ; +0x7e, 0x140293b5e\nmovaps  xmm1, xmm6                                                     ; +0x81, 0x140293b61\nmov     rcx, rbx                                                       ; +0x84, 0x140293b64\ncall    qword ptr [rdx+0A0h]                                           ; +0x87, 0x140293b67\nmov     r9, rdi                                                        ; +0x8d, 0x140293b6d\nmov     r8, r13                                                        ; +0x90, 0x140293b70\nmov     rdx, rbx                                                       ; +0x93, 0x140293b73\nmov     rcx, rbp                                                       ; +0x96, 0x140293b76\ncall    CCMenuItemToggler__create                                      ; +0x99, 0x140293b79\nmov     r15, rax                                                       ; +0x9e, 0x140293b7e\nmov     dl, 1                                                          ; +0xa1, 0x140293b81\nmov     rcx, rax                                                       ; +0xa3, 0x140293b83\ncall    CCMenuItemToggler__toggle                                      ; +0xa6, 0x140293b86\nmov     r8, [rsi]                                                      ; +0xab, 0x140293b8b\nmov     rdx, r15                                                       ; +0xae, 0x140293b8e\nmov     rcx, rsi                                                       ; +0xb1, 0x140293b91\ncall    qword ptr [r8+1C0h]                                            ; +0xb4, 0x140293b94\nmov     rbx, [r15]                                                     ; +0xbb, 0x140293b9b\nmov     r8, r12                                                        ; +0xbe, 0x140293b9e\nlea     rdx, [rsp+88h+var_68]                                          ; +0xc1, 0x140293ba1\nmov     rcx, rsi                                                       ; +0xc6, 0x140293ba6\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0xc9, 0x140293ba9\nmov     rdx, rax                                                       ; +0xcf, 0x140293baf\nmov     rcx, r15                                                       ; +0xd2, 0x140293bb2\ncall    qword ptr [rbx+0B8h]                                           ; +0xd5, 0x140293bb5\nmov     rax, [r15+178h]                                                ; +0xdb, 0x140293bbb\nmov     dword ptr [rax+174h], 3FC00000h                                ; +0xe2, 0x140293bc2\nmov     rax, [r15+180h]                                                ; +0xec, 0x140293bcc\nmov     dword ptr [rax+174h], 3FC00000h                                ; +0xf3, 0x140293bd3\nmovzx   edx, byte ptr [r15+188h]                                       ; +0xfd, 0x140293bdd\nmov     rcx, r15                                                       ; +0x105, 0x140293be5\ncall    CCMenuItemToggler__toggle                                      ; +0x108, 0x140293be8\nmov     rcx, r14                                                       ; +0x10d, 0x140293bed\ncmp     qword ptr [r14+18h], 0Fh                                       ; +0x110, 0x140293bf0\njbe     short loc_140293BFA                                            ; +0x115, 0x140293bf5\nmov     rcx, [r14]                                                     ; +0x117, 0x140293bf7\nlea     rdx, qword_14052A4D8                                           ; +0x11a, 0x140293bfa\ncall    cs:?create@CCLabelBMFont@cocos2d@@SAPEAV12@PEBD0@Z; cocos2d::CCLabelBMFont::create(char const *,char const *) ; +0x121, 0x140293c01\nmov     rdi, rax                                                       ; +0x127, 0x140293c07\nmov     rcx, [r13+240h]                                                ; +0x12a, 0x140293c0a\nmov     r8, [rcx]                                                      ; +0x131, 0x140293c11\nmov     rdx, rax                                                       ; +0x134, 0x140293c14\ncall    qword ptr [r8+1C0h]                                            ; +0x137, 0x140293c17\nmov     rbx, [rdi]                                                     ; +0x13e, 0x140293c1e\nmovaps  xmm2, xmm6                                                     ; +0x141, 0x140293c21\nxorps   xmm1, xmm1                                                     ; +0x144, 0x140293c24\nlea     rcx, [rsp+88h+var_68]                                          ; +0x147, 0x140293c27\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x14c, 0x140293c2c\nmov     rdx, rax                                                       ; +0x152, 0x140293c32\nmov     rcx, rdi                                                       ; +0x155, 0x140293c35\ncall    qword ptr [rbx+110h]                                           ; +0x158, 0x140293c38\nmov     rax, [rbp+0]                                                   ; +0x15e, 0x140293c3e\nmov     rcx, rbp                                                       ; +0x162, 0x140293c42\ncall    qword ptr [rax+130h]                                           ; +0x165, 0x140293c45\nmovss   xmm1, dword ptr [rax]                                          ; +0x16b, 0x140293c4b\nmulss   xmm1, xmm6                                                     ; +0x16f, 0x140293c4f\nmulss   xmm1, xmm6                                                     ; +0x173, 0x140293c53\naddss   xmm1, cs:dword_140622FF0                                       ; +0x177, 0x140293c57\nxorps   xmm2, xmm2                                                     ; +0x17f, 0x140293c5f\nlea     rcx, [rsp+88h+var_60]                                          ; +0x182, 0x140293c62\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x187, 0x140293c67\nmov     r8, rax                                                        ; +0x18d, 0x140293c6d\nlea     rdx, [rsp+88h+var_68]                                          ; +0x190, 0x140293c70\nmov     rcx, r12                                                       ; +0x195, 0x140293c75\ncall    cs:??HCCPoint@cocos2d@@QEBA?AV01@AEBV01@@Z; cocos2d::CCPoint::operator+(cocos2d::CCPoint const &) ; +0x198, 0x140293c78\nmov     rax, [rdi]                                                     ; +0x19e, 0x140293c7e\nlea     rdx, [rsp+88h+var_68]                                          ; +0x1a1, 0x140293c81\nmov     rcx, rdi                                                       ; +0x1a6, 0x140293c86\ncall    qword ptr [rax+0B8h]                                           ; +0x1a9, 0x140293c89\nxorps   xmm3, xmm3                                                     ; +0x1af, 0x140293c8f\nmovss   xmm2, [rsp+88h+arg_38]                                         ; +0x1b2, 0x140293c92\nmovss   xmm1, [rsp+88h+arg_30]                                         ; +0x1bb, 0x140293c9b\nmov     rcx, rdi                                                       ; +0x1c4, 0x140293ca4\ncall    cs:?limitLabelWidth@CCLabelBMFont@cocos2d@@QEAAXMMM@Z; cocos2d::CCLabelBMFont::limitLabelWidth(float,float,float) ; +0x1c7, 0x140293ca7\nnop                                                                    ; +0x1cd, 0x140293cad\nmov     rcx, r14                                                       ; +0x1ce, 0x140293cae\ncall    sub_14003A830                                                  ; +0x1d1, 0x140293cb1\nmov     rax, r15                                                       ; +0x1d6, 0x140293cb6\nmov     rcx, [rsp+88h+var_50]                                          ; +0x1d9, 0x140293cb9\nxor     rcx, rsp; StackCookie                                          ; +0x1de, 0x140293cbe\ncall    __security_check_cookie                                        ; +0x1e1, 0x140293cc1\nmov     rbx, [rsp+88h+arg_18]                                          ; +0x1e6, 0x140293cc6\nmovaps  xmm6, [rsp+88h+var_48]                                         ; +0x1ee, 0x140293cce\nadd     rsp, 50h                                                       ; +0x1f3, 0x140293cd3\npop     r15                                                            ; +0x1f7, 0x140293cd7\npop     r14                                                            ; +0x1f9, 0x140293cd9\npop     r13                                                            ; +0x1fb, 0x140293cdb\npop     r12                                                            ; +0x1fd, 0x140293cdd\npop     rdi                                                            ; +0x1ff, 0x140293cdf\npop     rsi                                                            ; +0x200, 0x140293ce0\npop     rbp                                                            ; +0x201, 0x140293ce1\nretn                                                                   ; +0x202, 0x140293ce2", "xrefs": ["GJAccountSettingsLayer::init @ 0x140292884", "GJAccountSettingsLayer::init @ 0x14029293f", "GJAccountSettingsLayer::init @ 0x1402929eb", "GJAccountSettingsLayer::init @ 0x140292c11", "GJAccountSettingsLayer::init @ 0x140292cb0", "GJAccountSettingsLayer::init @ 0x140292eba", "GJAccountSettingsLayer::init @ 0x140292f6d", "GJAccountSettingsLayer::init @ 0x140293011", "<???> @ 0x1406d1a00"], "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"}