{"type": "func", "start": 5371399504, "end": 5371399762, "name": "GJOptionsLayer::onToggle", "pseudocode": "// \n// GJOptionsLayer::onToggle from 0x140290d50 to 0x140290e52 (258 bytes)\n// \n// 3 xrefs:\n// > GJOptionsLayer::addToggleInternal @ 0x140290048\n// > GameOptionsLayer::setupOptions @ 0x14029f7a9\n// > <???> @ 0x1406d1988\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 GJOptionsLayer::onToggle(GJOptionsLayer *a1, cocos2d::CCObject *a2)\n{\n  int v4; // eax\n  cocos2d::CCString *v5; // rbx\n  const char *CString; // rax\n  GameManager *v7; // rcx\n  const char *v8; // rax\n  size_t v9; // r8\n  GJOptionsLayer_vtbl *v10; // rbx\n  unsigned int v11; // eax\n  __int128 v12; // [rsp+20h] [rbp-28h] BYREF\n  __int64 v13; // [rsp+30h] [rbp-18h]\n  __int64 v14; // [rsp+38h] [rbp-10h]\n  void *v15; // [rsp+50h] [rbp+8h]\n\n  v4 = a2->getTag(a2);\n  v5 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(a1->m_variables, v4);\n  if ( v5 )\n  {\n    if ( !qword_1406C2ED8 )\n    {\n      v15 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v15);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    }\n    CString = cocos2d::CCString::getCString(v5);\n    GameManager::toggleGameVariable(v7, CString);\n    v8 = cocos2d::CCString::getCString(v5);\n    v12 = 0;\n    v13 = 0;\n    v14 = 0;\n    v9 = -1;\n    do\n      ++v9;\n    while ( v8[v9] );\n    sub_14003A930(&v12, v8, v9);\n    a1->didToggleGV(a1, (std::string *)&v12);\n  }\n  else\n  {\n    v10 = a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    v11 = a2->getTag(a2);\n    v10->didToggle(a1, v11);\n  }\n}", "assembly": "; \n; GJOptionsLayer::onToggle from 0x140290d50 to 0x140290e52 (258 bytes)\n; \n; 3 xrefs:\n; > GJOptionsLayer::addToggleInternal @ 0x140290048\n; > GameOptionsLayer::setupOptions @ 0x14029f7a9\n; > <???> @ 0x1406d1988\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], rbx                                               ; +0x0, 0x140290d50\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x140290d55\npush    rdi                                                            ; +0xa, 0x140290d5a\nsub     rsp, 40h                                                       ; +0xb, 0x140290d5b\nmov     rsi, rdx                                                       ; +0xf, 0x140290d5f\nmov     rdi, rcx                                                       ; +0x12, 0x140290d62\nmov     rax, [rdx]                                                     ; +0x15, 0x140290d65\nmov     rcx, rdx                                                       ; +0x18, 0x140290d68\ncall    qword ptr [rax+38h]                                            ; +0x1b, 0x140290d6b\nmovsxd  rdx, eax                                                       ; +0x1e, 0x140290d6e\nmov     rcx, [rdi+3D0h]                                                ; +0x21, 0x140290d71\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::objectForKey(__int64) ; +0x28, 0x140290d78\nmov     rbx, rax                                                       ; +0x2e, 0x140290d7e\ntest    rax, rax                                                       ; +0x31, 0x140290d81\njz      loc_140290E28                                                  ; +0x34, 0x140290d84\ncmp     cs:qword_1406C2ED8, 0                                          ; +0x3a, 0x140290d8a\njnz     short loc_140290DBC                                            ; +0x42, 0x140290d92\nmov     ecx, 668h; Size                                                ; +0x44, 0x140290d94\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x49, 0x140290d99\nmov     [rsp+48h+arg_0], rax                                           ; +0x4e, 0x140290d9e\nmov     rcx, rax                                                       ; +0x53, 0x140290da3\ncall    sub_14017AB00                                                  ; +0x56, 0x140290da6\nnop                                                                    ; +0x5b, 0x140290dab\nmov     cs:qword_1406C2ED8, rax                                        ; +0x5c, 0x140290dac\nmov     rdx, [rax]                                                     ; +0x63, 0x140290db3\nmov     rcx, rax                                                       ; +0x66, 0x140290db6\ncall    qword ptr [rdx+48h]                                            ; +0x69, 0x140290db9\nmov     rcx, rbx                                                       ; +0x6c, 0x140290dbc\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x6f, 0x140290dbf\nmov     rdx, rax                                                       ; +0x75, 0x140290dc5\ncall    GameManager__toggleGameVariable                                ; +0x78, 0x140290dc8\nmov     rcx, rbx                                                       ; +0x7d, 0x140290dcd\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x80, 0x140290dd0\nxorps   xmm0, xmm0                                                     ; +0x86, 0x140290dd6\nmovups  [rsp+48h+var_28], xmm0                                         ; +0x89, 0x140290dd9\nxor     ecx, ecx                                                       ; +0x8e, 0x140290dde\nmov     [rsp+48h+var_18], rcx                                          ; +0x90, 0x140290de0\nmov     [rsp+48h+var_10], rcx                                          ; +0x95, 0x140290de5\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x9a, 0x140290dea\ninc     r8                                                             ; +0xa1, 0x140290df1\ncmp     [rax+r8], cl                                                   ; +0xa4, 0x140290df4\njnz     short loc_140290DF1                                            ; +0xa8, 0x140290df8\nmov     rdx, rax                                                       ; +0xaa, 0x140290dfa\nlea     rcx, [rsp+48h+var_28]                                          ; +0xad, 0x140290dfd\ncall    sub_14003A930                                                  ; +0xb2, 0x140290e02\nmov     rax, [rdi]                                                     ; +0xb7, 0x140290e07\nlea     rdx, [rsp+48h+var_28]                                          ; +0xba, 0x140290e0a\nmov     rcx, rdi                                                       ; +0xbf, 0x140290e0f\ncall    qword ptr [rax+498h]                                           ; +0xc2, 0x140290e12\nmov     rbx, [rsp+48h+arg_8]                                           ; +0xc8, 0x140290e18\nmov     rsi, [rsp+48h+arg_10]                                          ; +0xcd, 0x140290e1d\nadd     rsp, 40h                                                       ; +0xd2, 0x140290e22\npop     rdi                                                            ; +0xd6, 0x140290e26\nretn                                                                   ; +0xd7, 0x140290e27\nmov     rbx, [rdi]                                                     ; +0xd8, 0x140290e28\nmov     rax, [rsi]                                                     ; +0xdb, 0x140290e2b\nmov     rcx, rsi                                                       ; +0xde, 0x140290e2e\ncall    qword ptr [rax+38h]                                            ; +0xe1, 0x140290e31\nmov     edx, eax                                                       ; +0xe4, 0x140290e34\nmov     rcx, rdi                                                       ; +0xe6, 0x140290e36\nmov     rax, [rbx+4A0h]                                                ; +0xe9, 0x140290e39\nmov     rbx, [rsp+48h+arg_8]                                           ; +0xf0, 0x140290e40\nmov     rsi, [rsp+48h+arg_10]                                          ; +0xf5, 0x140290e45\nadd     rsp, 40h                                                       ; +0xfa, 0x140290e4a\npop     rdi                                                            ; +0xfe, 0x140290e4e\njmp     rax                                                            ; +0xff, 0x140290e4f", "xrefs": ["GJOptionsLayer::addToggleInternal @ 0x140290048", "GameOptionsLayer::setupOptions @ 0x14029f7a9", "<???> @ 0x1406d1988"], "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"}