{"type": "func", "start": 5373727008, "end": 5373727608, "name": "SupportLayer::createToggleButton", "pseudocode": "// \n// SupportLayer::createToggleButton from 0x1404c9120 to 0x1404c9378 (600 bytes)\n// \n// 2 xrefs:\n// > SupportLayer::customSetup @ 0x1404c8a65\n// > <???> @ 0x1406dd2e0\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 SupportLayer::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; // r15\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 v23[3]; // [rsp+20h] [rbp-68h] BYREF\n\n  v23[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 *)SupportLayer::onLowDetail);\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, v23);\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  v14 = a2;\n  if ( *((_QWORD *)a2 + 3) > 0xFu )\n    v14 = *(const char **)a2;\n  v15 = cocos2d::CCLabelBMFont::create(v14, &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) + 8.0);\n  cocos2d::CCPoint::operator+(a6, v23);\n  v15->setPosition_0(v15, v23);\n  if ( v15->getContentSize(v15)->width > 120.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  v15->getScale(v15);\n  ((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v15->setScale_0)(v15);\n  sub_14003A830((__int64)a2);\n  return v11;\n}", "assembly": "; \n; SupportLayer::createToggleButton from 0x1404c9120 to 0x1404c9378 (600 bytes)\n; \n; 2 xrefs:\n; > SupportLayer::customSetup @ 0x1404c8a65\n; > <???> @ 0x1406dd2e0\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, 0x1404c9120\npush    rbp                                                            ; +0x5, 0x1404c9125\npush    rsi                                                            ; +0x6, 0x1404c9126\npush    rdi                                                            ; +0x7, 0x1404c9127\npush    r12                                                            ; +0x8, 0x1404c9128\npush    r13                                                            ; +0xa, 0x1404c912a\npush    r14                                                            ; +0xc, 0x1404c912c\npush    r15                                                            ; +0xe, 0x1404c912e\nsub     rsp, 50h                                                       ; +0x10, 0x1404c9130\nmovaps  [rsp+88h+var_48], xmm6                                         ; +0x14, 0x1404c9134\nmov     rax, cs:__security_cookie                                      ; +0x19, 0x1404c9139\nxor     rax, rsp                                                       ; +0x20, 0x1404c9140\nmov     [rsp+88h+var_50], rax                                          ; +0x23, 0x1404c9143\nmovzx   edi, r9b                                                       ; +0x28, 0x1404c9148\nmov     r14, rdx                                                       ; +0x2c, 0x1404c914c\nmov     r13, rcx                                                       ; +0x2f, 0x1404c914f\nmov     [rsp+88h+var_58], rdx                                          ; +0x32, 0x1404c9152\nmov     rsi, [rsp+88h+arg_20]                                          ; +0x37, 0x1404c9157\nmov     r12, [rsp+88h+arg_28]                                          ; +0x3f, 0x1404c915f\nlea     rcx, aGjCheckon001Pn; \"GJ_checkOn_001.png\"                     ; +0x47, 0x1404c9167\ncall    cs:?createWithSpriteFrameName@CCSprite@cocos2d@@SAPEAV12@PEBD@Z; cocos2d::CCSprite::createWithSpriteFrameName(char const *) ; +0x4e, 0x1404c916e\nmov     rbp, rax                                                       ; +0x54, 0x1404c9174\nlea     rcx, aGjCheckoff001P; \"GJ_checkOff_001.png\"                    ; +0x57, 0x1404c9177\ncall    cs:?createWithSpriteFrameName@CCSprite@cocos2d@@SAPEAV12@PEBD@Z; cocos2d::CCSprite::createWithSpriteFrameName(char const *) ; +0x5e, 0x1404c917e\nmov     rbx, rax                                                       ; +0x64, 0x1404c9184\nmov     r8, [rbp+0]                                                    ; +0x67, 0x1404c9187\nmovss   xmm1, cs:dword_140622BA4                                       ; +0x6b, 0x1404c918b\nmov     rcx, rbp                                                       ; +0x73, 0x1404c9193\ncall    qword ptr [r8+0A0h]                                            ; +0x76, 0x1404c9196\nmov     r8, [rbx]                                                      ; +0x7d, 0x1404c919d\nmovss   xmm1, cs:dword_140622BA4                                       ; +0x80, 0x1404c91a0\nmov     rcx, rbx                                                       ; +0x88, 0x1404c91a8\ncall    qword ptr [r8+0A0h]                                            ; +0x8b, 0x1404c91ab\nlea     r9, SupportLayer__onLowDetail                                  ; +0x92, 0x1404c91b2\nmov     r8, r13                                                        ; +0x99, 0x1404c91b9\nmov     rdx, rbx                                                       ; +0x9c, 0x1404c91bc\nmov     rcx, rbp                                                       ; +0x9f, 0x1404c91bf\ncall    CCMenuItemToggler__create                                      ; +0xa2, 0x1404c91c2\nmov     r15, rax                                                       ; +0xa7, 0x1404c91c7\nmovzx   edx, dil                                                       ; +0xaa, 0x1404c91ca\nmov     rcx, rax                                                       ; +0xae, 0x1404c91ce\ncall    CCMenuItemToggler__toggle                                      ; +0xb1, 0x1404c91d1\nmov     r8, [rsi]                                                      ; +0xb6, 0x1404c91d6\nmov     rdx, r15                                                       ; +0xb9, 0x1404c91d9\nmov     rcx, rsi                                                       ; +0xbc, 0x1404c91dc\ncall    qword ptr [r8+1C0h]                                            ; +0xbf, 0x1404c91df\nmov     rbx, [r15]                                                     ; +0xc6, 0x1404c91e6\nmov     r8, r12                                                        ; +0xc9, 0x1404c91e9\nlea     rdx, [rsp+88h+var_68]                                          ; +0xcc, 0x1404c91ec\nmov     rcx, rsi                                                       ; +0xd1, 0x1404c91f1\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0xd4, 0x1404c91f4\nmov     rdx, rax                                                       ; +0xda, 0x1404c91fa\nmov     rcx, r15                                                       ; +0xdd, 0x1404c91fd\ncall    qword ptr [rbx+0B8h]                                           ; +0xe0, 0x1404c9200\nmov     rax, [r15+178h]                                                ; +0xe6, 0x1404c9206\nmov     dword ptr [rax+174h], 3FC00000h                                ; +0xed, 0x1404c920d\nmov     rax, [r15+180h]                                                ; +0xf7, 0x1404c9217\nmov     dword ptr [rax+174h], 3FC00000h                                ; +0xfe, 0x1404c921e\nmovzx   edx, byte ptr [r15+188h]                                       ; +0x108, 0x1404c9228\nmov     rcx, r15                                                       ; +0x110, 0x1404c9230\ncall    CCMenuItemToggler__toggle                                      ; +0x113, 0x1404c9233\nmov     rcx, r14                                                       ; +0x118, 0x1404c9238\ncmp     qword ptr [r14+18h], 0Fh                                       ; +0x11b, 0x1404c923b\njbe     short loc_1404C9245                                            ; +0x120, 0x1404c9240\nmov     rcx, [r14]                                                     ; +0x122, 0x1404c9242\nlea     rdx, qword_14052A4D8                                           ; +0x125, 0x1404c9245\ncall    cs:?create@CCLabelBMFont@cocos2d@@SAPEAV12@PEBD0@Z; cocos2d::CCLabelBMFont::create(char const *,char const *) ; +0x12c, 0x1404c924c\nmov     rdi, rax                                                       ; +0x132, 0x1404c9252\nmov     rcx, [r13+240h]                                                ; +0x135, 0x1404c9255\nmov     r8, [rcx]                                                      ; +0x13c, 0x1404c925c\nmov     rdx, rax                                                       ; +0x13f, 0x1404c925f\ncall    qword ptr [r8+1C0h]                                            ; +0x142, 0x1404c9262\nmov     rbx, [rdi]                                                     ; +0x149, 0x1404c9269\nmovss   xmm6, cs:dword_140622B08                                       ; +0x14c, 0x1404c926c\nmovaps  xmm2, xmm6                                                     ; +0x154, 0x1404c9274\nxorps   xmm1, xmm1                                                     ; +0x157, 0x1404c9277\nlea     rcx, [rsp+88h+var_68]                                          ; +0x15a, 0x1404c927a\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x15f, 0x1404c927f\nmov     rdx, rax                                                       ; +0x165, 0x1404c9285\nmov     rcx, rdi                                                       ; +0x168, 0x1404c9288\ncall    qword ptr [rbx+110h]                                           ; +0x16b, 0x1404c928b\nmov     rax, [rbp+0]                                                   ; +0x171, 0x1404c9291\nmov     rcx, rbp                                                       ; +0x175, 0x1404c9295\ncall    qword ptr [rax+130h]                                           ; +0x178, 0x1404c9298\nmovss   xmm1, dword ptr [rax]                                          ; +0x17e, 0x1404c929e\nmulss   xmm1, xmm6                                                     ; +0x182, 0x1404c92a2\nmulss   xmm1, cs:dword_140622BA4                                       ; +0x186, 0x1404c92a6\naddss   xmm1, cs:dword_140623068                                       ; +0x18e, 0x1404c92ae\nxorps   xmm2, xmm2                                                     ; +0x196, 0x1404c92b6\nlea     rcx, [rsp+88h+var_60]                                          ; +0x199, 0x1404c92b9\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x19e, 0x1404c92be\nmov     r8, rax                                                        ; +0x1a4, 0x1404c92c4\nlea     rdx, [rsp+88h+var_68]                                          ; +0x1a7, 0x1404c92c7\nmov     rcx, r12                                                       ; +0x1ac, 0x1404c92cc\ncall    cs:??HCCPoint@cocos2d@@QEBA?AV01@AEBV01@@Z; cocos2d::CCPoint::operator+(cocos2d::CCPoint const &) ; +0x1af, 0x1404c92cf\nmov     rax, [rdi]                                                     ; +0x1b5, 0x1404c92d5\nlea     rdx, [rsp+88h+var_68]                                          ; +0x1b8, 0x1404c92d8\nmov     rcx, rdi                                                       ; +0x1bd, 0x1404c92dd\ncall    qword ptr [rax+0B8h]                                           ; +0x1c0, 0x1404c92e0\nmov     rax, [rdi]                                                     ; +0x1c6, 0x1404c92e6\nmov     rcx, rdi                                                       ; +0x1c9, 0x1404c92e9\ncall    qword ptr [rax+130h]                                           ; +0x1cc, 0x1404c92ec\nmovss   xmm0, dword ptr [rax]                                          ; +0x1d2, 0x1404c92f2\nmovss   xmm6, cs:dword_1406232FC                                       ; +0x1d6, 0x1404c92f6\ncomiss  xmm0, xmm6                                                     ; +0x1de, 0x1404c92fe\njbe     short loc_1404C931F                                            ; +0x1e1, 0x1404c9301\nmov     rbx, [rdi]                                                     ; +0x1e3, 0x1404c9303\nmov     rcx, rdi                                                       ; +0x1e6, 0x1404c9306\ncall    qword ptr [rbx+130h]                                           ; +0x1e9, 0x1404c9309\ndivss   xmm6, dword ptr [rax]                                          ; +0x1ef, 0x1404c930f\nmovaps  xmm1, xmm6                                                     ; +0x1f3, 0x1404c9313\nmov     rcx, rdi                                                       ; +0x1f6, 0x1404c9316\ncall    qword ptr [rbx+0A0h]                                           ; +0x1f9, 0x1404c9319\nmov     rax, [rdi]                                                     ; +0x1ff, 0x1404c931f\nmov     rcx, rdi                                                       ; +0x202, 0x1404c9322\ncall    qword ptr [rax+0A8h]                                           ; +0x205, 0x1404c9325\nminss   xmm0, cs:dword_140622ABC                                       ; +0x20b, 0x1404c932b\nmov     rax, [rdi]                                                     ; +0x213, 0x1404c9333\nmovaps  xmm1, xmm0                                                     ; +0x216, 0x1404c9336\nmov     rcx, rdi                                                       ; +0x219, 0x1404c9339\ncall    qword ptr [rax+0A0h]                                           ; +0x21c, 0x1404c933c\nnop                                                                    ; +0x222, 0x1404c9342\nmov     rcx, r14                                                       ; +0x223, 0x1404c9343\ncall    sub_14003A830                                                  ; +0x226, 0x1404c9346\nmov     rax, r15                                                       ; +0x22b, 0x1404c934b\nmov     rcx, [rsp+88h+var_50]                                          ; +0x22e, 0x1404c934e\nxor     rcx, rsp; StackCookie                                          ; +0x233, 0x1404c9353\ncall    __security_check_cookie                                        ; +0x236, 0x1404c9356\nmov     rbx, [rsp+88h+arg_10]                                          ; +0x23b, 0x1404c935b\nmovaps  xmm6, [rsp+88h+var_48]                                         ; +0x243, 0x1404c9363\nadd     rsp, 50h                                                       ; +0x248, 0x1404c9368\npop     r15                                                            ; +0x24c, 0x1404c936c\npop     r14                                                            ; +0x24e, 0x1404c936e\npop     r13                                                            ; +0x250, 0x1404c9370\npop     r12                                                            ; +0x252, 0x1404c9372\npop     rdi                                                            ; +0x254, 0x1404c9374\npop     rsi                                                            ; +0x255, 0x1404c9375\npop     rbp                                                            ; +0x256, 0x1404c9376\nretn                                                                   ; +0x257, 0x1404c9377", "xrefs": ["SupportLayer::customSetup @ 0x1404c8a65", "<???> @ 0x1406dd2e0"], "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"}