{"type": "func", "start": 5371990880, "end": 5371991472, "name": "LevelSettingsLayer::createToggleButton", "pseudocode": "// \n// LevelSettingsLayer::createToggleButton from 0x140321360 to 0x1403215b0 (592 bytes)\n// \n// 2 xrefs:\n// > LevelSettingsLayer::init @ 0x1403202f8\n// > <???> @ 0x1406d4c28\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\nvoid __fastcall LevelSettingsLayer::createToggleButton(\n        __int64 a1,\n        const char *a2,\n        __int64 a3,\n        bool a4,\n        cocos2d::CCNode *a5,\n        __int64 a6)\n{\n  struct cocos2d::CCSprite *v9; // rbp\n  struct cocos2d::CCSprite *v10; // rbx\n  CCMenuItemToggler *v11; // rdi\n  CCMenuItemToggler_vtbl *v12; // rbx\n  struct cocos2d::CCPoint v13; // rax\n  const char *v14; // rcx\n  struct cocos2d::CCLabelBMFont *v15; // rdi\n  float v16; // xmm0_4\n  cocos2d::CCLabelBMFont_vtbl *v17; // rbx\n  double v18; // xmm0_8\n  const cocos2d::CCPoint *v19; // rax\n  float *v20; // rax\n  cocos2d::CCLabelBMFont_vtbl *v21; // rbx\n  struct cocos2d::CCPoint v22[3]; // [rsp+20h] [rbp-68h] BYREF\n\n  v22[2] = (struct cocos2d::CCPoint)a2;\n  v9 = cocos2d::CCSprite::createWithSpriteFrameName(\"GJ_checkOn_001.png\");\n  v10 = cocos2d::CCSprite::createWithSpriteFrameName(\"GJ_checkOff_001.png\");\n  ((void (__fastcall *)(struct cocos2d::CCSprite *))v9->setScale_0)(v9);\n  ((void (__fastcall *)(struct cocos2d::CCSprite *))v10->setScale_0)(v10);\n  v11 = CCMenuItemToggler::create(\n          v9,\n          v10,\n          (cocos2d::CCObject *)a1,\n          (cocos2d::SEL_MenuHandler *)LevelSettingsLayer::onDisable);\n  CCMenuItemToggler::toggle(v11, a4);\n  a5->addChild_1(a5, v11);\n  v12 = v11->cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  v13 = cocos2d::CCNode::convertToNodeSpace(a5, v22);\n  ((void (__fastcall *)(CCMenuItemToggler *, struct cocos2d::CCPoint))v12->setPosition_0)(v11, v13);\n  *(_DWORD *)(*(_QWORD *)&v11->m_nScriptTapHandler + 372LL) = 1069547520;\n  HIDWORD(v11->m_offButton->m_pfnSelector.adj) = 1069547520;\n  CCMenuItemToggler::toggle(v11, (bool)v11->m_onButton);\n  if ( *((_QWORD *)a2 + 2) )\n  {\n    v14 = a2;\n    if ( *((_QWORD *)a2 + 3) > 0xFu )\n      v14 = *(const char **)a2;\n    v15 = cocos2d::CCLabelBMFont::create(v14, (const char *)&qword_14052A4D8);\n    v16 = (*(float (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 576) + 448LL))(\n            *(_QWORD *)(a1 + 576),\n            v15);\n    v17 = v15->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    v18 = cocos2d::CCPoint::CCPoint(v16, 0.0);\n    v17->setAnchorPoint(v15, v19);\n    v20 = (float *)v9->getContentSize(v9);\n    cocos2d::CCPoint::CCPoint(*(float *)&v18, (float)((float)(*v20 * 0.5) * 0.80000001) + 6.0);\n    cocos2d::CCPoint::operator+(a6, v22);\n    v15->setPosition_0(v15, v22);\n    if ( v15->getContentSize(v15)->width > 110.0 )\n    {\n      v21 = v15->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n      v15->getContentSize(v15);\n      ((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v21->setScale_0)(v15);\n    }\n    ((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v15->setScale_0)(v15);\n  }\n  sub_14003A830((__int64)a2);\n}", "assembly": "; \n; LevelSettingsLayer::createToggleButton from 0x140321360 to 0x1403215b0 (592 bytes)\n; \n; 2 xrefs:\n; > LevelSettingsLayer::init @ 0x1403202f8\n; > <???> @ 0x1406d4c28\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_10], rbx                                              ; +0x0, 0x140321360\npush    rbp                                                            ; +0x5, 0x140321365\npush    rsi                                                            ; +0x6, 0x140321366\npush    rdi                                                            ; +0x7, 0x140321367\npush    r12                                                            ; +0x8, 0x140321368\npush    r13                                                            ; +0xa, 0x14032136a\npush    r14                                                            ; +0xc, 0x14032136c\npush    r15                                                            ; +0xe, 0x14032136e\nsub     rsp, 50h                                                       ; +0x10, 0x140321370\nmovaps  [rsp+88h+var_48], xmm6                                         ; +0x14, 0x140321374\nmov     rax, cs:__security_cookie                                      ; +0x19, 0x140321379\nxor     rax, rsp                                                       ; +0x20, 0x140321380\nmov     [rsp+88h+var_50], rax                                          ; +0x23, 0x140321383\nmovzx   esi, r9b                                                       ; +0x28, 0x140321388\nmov     r15, rdx                                                       ; +0x2c, 0x14032138c\nmov     r13, rcx                                                       ; +0x2f, 0x14032138f\nmov     [rsp+88h+var_58], rdx                                          ; +0x32, 0x140321392\nmov     r14, [rsp+88h+arg_20]                                          ; +0x37, 0x140321397\nmov     r12, [rsp+88h+arg_28]                                          ; +0x3f, 0x14032139f\nlea     rcx, aGjCheckon001Pn; \"GJ_checkOn_001.png\"                     ; +0x47, 0x1403213a7\ncall    cs:?createWithSpriteFrameName@CCSprite@cocos2d@@SAPEAV12@PEBD@Z; cocos2d::CCSprite::createWithSpriteFrameName(char const *) ; +0x4e, 0x1403213ae\nmov     rbp, rax                                                       ; +0x54, 0x1403213b4\nlea     rcx, aGjCheckoff001P; \"GJ_checkOff_001.png\"                    ; +0x57, 0x1403213b7\ncall    cs:?createWithSpriteFrameName@CCSprite@cocos2d@@SAPEAV12@PEBD@Z; cocos2d::CCSprite::createWithSpriteFrameName(char const *) ; +0x5e, 0x1403213be\nmov     rbx, rax                                                       ; +0x64, 0x1403213c4\nmov     r8, [rbp+0]                                                    ; +0x67, 0x1403213c7\nmovss   xmm1, cs:dword_140622BA4                                       ; +0x6b, 0x1403213cb\nmov     rcx, rbp                                                       ; +0x73, 0x1403213d3\ncall    qword ptr [r8+0A0h]                                            ; +0x76, 0x1403213d6\nmov     r8, [rbx]                                                      ; +0x7d, 0x1403213dd\nmovss   xmm1, cs:dword_140622BA4                                       ; +0x80, 0x1403213e0\nmov     rcx, rbx                                                       ; +0x88, 0x1403213e8\ncall    qword ptr [r8+0A0h]                                            ; +0x8b, 0x1403213eb\nlea     r9, LevelSettingsLayer__onDisable                              ; +0x92, 0x1403213f2\nmov     r8, r13                                                        ; +0x99, 0x1403213f9\nmov     rdx, rbx                                                       ; +0x9c, 0x1403213fc\nmov     rcx, rbp                                                       ; +0x9f, 0x1403213ff\ncall    CCMenuItemToggler__create                                      ; +0xa2, 0x140321402\nmov     rdi, rax                                                       ; +0xa7, 0x140321407\nmovzx   edx, sil                                                       ; +0xaa, 0x14032140a\nmov     rcx, rax                                                       ; +0xae, 0x14032140e\ncall    CCMenuItemToggler__toggle                                      ; +0xb1, 0x140321411\nmov     r8, [r14]                                                      ; +0xb6, 0x140321416\nmov     rdx, rdi                                                       ; +0xb9, 0x140321419\nmov     rcx, r14                                                       ; +0xbc, 0x14032141c\ncall    qword ptr [r8+1C0h]                                            ; +0xbf, 0x14032141f\nmov     rbx, [rdi]                                                     ; +0xc6, 0x140321426\nmov     r8, r12                                                        ; +0xc9, 0x140321429\nlea     rdx, [rsp+88h+var_68]                                          ; +0xcc, 0x14032142c\nmov     rcx, r14                                                       ; +0xd1, 0x140321431\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0xd4, 0x140321434\nmov     rdx, rax                                                       ; +0xda, 0x14032143a\nmov     rcx, rdi                                                       ; +0xdd, 0x14032143d\ncall    qword ptr [rbx+0B8h]                                           ; +0xe0, 0x140321440\nmov     rax, [rdi+178h]                                                ; +0xe6, 0x140321446\nmov     dword ptr [rax+174h], 3FC00000h                                ; +0xed, 0x14032144d\nmov     rax, [rdi+180h]                                                ; +0xf7, 0x140321457\nmov     dword ptr [rax+174h], 3FC00000h                                ; +0xfe, 0x14032145e\nmovzx   edx, byte ptr [rdi+188h]                                       ; +0x108, 0x140321468\nmov     rcx, rdi                                                       ; +0x10f, 0x14032146f\ncall    CCMenuItemToggler__toggle                                      ; +0x112, 0x140321472\ncmp     qword ptr [r15+10h], 0                                         ; +0x117, 0x140321477\njz      loc_14032157E                                                  ; +0x11c, 0x14032147c\nmov     rcx, r15                                                       ; +0x122, 0x140321482\ncmp     qword ptr [r15+18h], 0Fh                                       ; +0x125, 0x140321485\njbe     short loc_14032148F                                            ; +0x12a, 0x14032148a\nmov     rcx, [r15]                                                     ; +0x12c, 0x14032148c\nlea     rdx, qword_14052A4D8                                           ; +0x12f, 0x14032148f\ncall    cs:?create@CCLabelBMFont@cocos2d@@SAPEAV12@PEBD0@Z; cocos2d::CCLabelBMFont::create(char const *,char const *) ; +0x136, 0x140321496\nmov     rdi, rax                                                       ; +0x13c, 0x14032149c\nmov     rcx, [r13+240h]                                                ; +0x13f, 0x14032149f\nmov     r8, [rcx]                                                      ; +0x146, 0x1403214a6\nmov     rdx, rax                                                       ; +0x149, 0x1403214a9\ncall    qword ptr [r8+1C0h]                                            ; +0x14c, 0x1403214ac\nmov     rbx, [rdi]                                                     ; +0x153, 0x1403214b3\nmovss   xmm6, cs:dword_140622B08                                       ; +0x156, 0x1403214b6\nmovaps  xmm2, xmm6                                                     ; +0x15e, 0x1403214be\nxorps   xmm1, xmm1                                                     ; +0x161, 0x1403214c1\nlea     rcx, [rsp+88h+var_68]                                          ; +0x164, 0x1403214c4\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x169, 0x1403214c9\nmov     rdx, rax                                                       ; +0x16f, 0x1403214cf\nmov     rcx, rdi                                                       ; +0x172, 0x1403214d2\ncall    qword ptr [rbx+110h]                                           ; +0x175, 0x1403214d5\nmov     rax, [rbp+0]                                                   ; +0x17b, 0x1403214db\nmov     rcx, rbp                                                       ; +0x17f, 0x1403214df\ncall    qword ptr [rax+130h]                                           ; +0x182, 0x1403214e2\nmovss   xmm1, dword ptr [rax]                                          ; +0x188, 0x1403214e8\nmulss   xmm1, xmm6                                                     ; +0x18c, 0x1403214ec\nmulss   xmm1, cs:dword_140622BA4                                       ; +0x190, 0x1403214f0\naddss   xmm1, cs:flt_140623028                                         ; +0x198, 0x1403214f8\nxorps   xmm2, xmm2                                                     ; +0x1a0, 0x140321500\nlea     rcx, [rsp+88h+var_60]                                          ; +0x1a3, 0x140321503\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x1a8, 0x140321508\nmov     r8, rax                                                        ; +0x1ae, 0x14032150e\nlea     rdx, [rsp+88h+var_68]                                          ; +0x1b1, 0x140321511\nmov     rcx, r12                                                       ; +0x1b6, 0x140321516\ncall    cs:??HCCPoint@cocos2d@@QEBA?AV01@AEBV01@@Z; cocos2d::CCPoint::operator+(cocos2d::CCPoint const &) ; +0x1b9, 0x140321519\nmov     rax, [rdi]                                                     ; +0x1bf, 0x14032151f\nlea     rdx, [rsp+88h+var_68]                                          ; +0x1c2, 0x140321522\nmov     rcx, rdi                                                       ; +0x1c7, 0x140321527\ncall    qword ptr [rax+0B8h]                                           ; +0x1ca, 0x14032152a\nmov     rax, [rdi]                                                     ; +0x1d0, 0x140321530\nmov     rcx, rdi                                                       ; +0x1d3, 0x140321533\ncall    qword ptr [rax+130h]                                           ; +0x1d6, 0x140321536\nmovss   xmm0, dword ptr [rax]                                          ; +0x1dc, 0x14032153c\nmovss   xmm6, cs:dword_1406232D8                                       ; +0x1e0, 0x140321540\ncomiss  xmm0, xmm6                                                     ; +0x1e8, 0x140321548\njbe     short loc_140321569                                            ; +0x1eb, 0x14032154b\nmov     rbx, [rdi]                                                     ; +0x1ed, 0x14032154d\nmov     rcx, rdi                                                       ; +0x1f0, 0x140321550\ncall    qword ptr [rbx+130h]                                           ; +0x1f3, 0x140321553\ndivss   xmm6, dword ptr [rax]                                          ; +0x1f9, 0x140321559\nmovaps  xmm1, xmm6                                                     ; +0x1fd, 0x14032155d\nmov     rcx, rdi                                                       ; +0x200, 0x140321560\ncall    qword ptr [rbx+0A0h]                                           ; +0x203, 0x140321563\nmov     rax, [rdi]                                                     ; +0x209, 0x140321569\nmovss   xmm1, cs:dword_140622ABC                                       ; +0x20c, 0x14032156c\nmov     rcx, rdi                                                       ; +0x214, 0x140321574\ncall    qword ptr [rax+0A0h]                                           ; +0x217, 0x140321577\nnop                                                                    ; +0x21d, 0x14032157d\nmov     rcx, r15                                                       ; +0x21e, 0x14032157e\ncall    sub_14003A830                                                  ; +0x221, 0x140321581\nmov     rcx, [rsp+88h+var_50]                                          ; +0x226, 0x140321586\nxor     rcx, rsp; StackCookie                                          ; +0x22b, 0x14032158b\ncall    __security_check_cookie                                        ; +0x22e, 0x14032158e\nmov     rbx, [rsp+88h+arg_10]                                          ; +0x233, 0x140321593\nmovaps  xmm6, [rsp+88h+var_48]                                         ; +0x23b, 0x14032159b\nadd     rsp, 50h                                                       ; +0x240, 0x1403215a0\npop     r15                                                            ; +0x244, 0x1403215a4\npop     r14                                                            ; +0x246, 0x1403215a6\npop     r13                                                            ; +0x248, 0x1403215a8\npop     r12                                                            ; +0x24a, 0x1403215aa\npop     rdi                                                            ; +0x24c, 0x1403215ac\npop     rsi                                                            ; +0x24d, 0x1403215ad\npop     rbp                                                            ; +0x24e, 0x1403215ae\nretn                                                                   ; +0x24f, 0x1403215af", "xrefs": ["LevelSettingsLayer::init @ 0x1403202f8", "<???> @ 0x1406d4c28"], "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"}