{"type": "func", "start": 5372494192, "end": 5372494453, "name": "GJOptionsLayer::onToggle", "pseudocode": "// \n// GJOptionsLayer::onToggle from 0x14039c170 to 0x14039c275 (261 bytes)\n// \n// 2 xrefs:\n// > GJOptionsLayer::addToggleInternal @ 0x14039b314\n// > <???> @ 0x14092336c\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:31:15 +0000\n// \n\n// Hidden C++ exception states: #wind=1\n__int64 __fastcall GJOptionsLayer::onToggle(cocos2d::CCDictionary **a1, __int64 a2)\n{\n  int v4; // eax\n  cocos2d::CCString *v5; // rbx\n  char *CString; // rax\n  __int64 v7; // rcx\n  const char *v8; // rax\n  size_t v9; // r8\n  cocos2d::CCDictionary *v11; // rbx\n  unsigned int v12; // eax\n  __int128 v13; // [rsp+20h] [rbp-28h] BYREF\n  __int64 v14; // [rsp+30h] [rbp-18h]\n  __int64 v15; // [rsp+38h] [rbp-10h]\n  void *v16; // [rsp+50h] [rbp+8h]\n\n  v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);\n  v5 = cocos2d::CCDictionary::objectForKey(a1[130], v4);\n  if ( v5 )\n  {\n    if ( !qword_14090BFD0 )\n    {\n      v16 = operator new(0x6E8u);\n      qword_14090BFD0 = GameManager::GameManager((__int64)v16);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    }\n    CString = (char *)cocos2d::CCString::getCString(v5);\n    GameManager::toggleGameVariable(v7, CString);\n    v8 = cocos2d::CCString::getCString(v5);\n    v13 = 0;\n    v14 = 0;\n    v15 = 0;\n    v9 = -1;\n    do\n      ++v9;\n    while ( v8[v9] );\n    sub_14003D230(&v13, v8, v9);\n    return (*((__int64 (__fastcall **)(cocos2d::CCDictionary **, __int128 *))*a1 + 151))(a1, &v13);\n  }\n  else\n  {\n    v11 = *a1;\n    v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);\n    return (*((__int64 (__fastcall **)(cocos2d::CCDictionary **, _QWORD))v11 + 152))(a1, v12);\n  }\n}", "assembly": "; \n; GJOptionsLayer::onToggle from 0x14039c170 to 0x14039c275 (261 bytes)\n; \n; 2 xrefs:\n; > GJOptionsLayer::addToggleInternal @ 0x14039b314\n; > <???> @ 0x14092336c\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:31:15 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x14039c170\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x14039c175\npush    rdi                                                            ; +0xa, 0x14039c17a\nsub     rsp, 40h                                                       ; +0xb, 0x14039c17b\nmov     rsi, rdx                                                       ; +0xf, 0x14039c17f\nmov     rdi, rcx                                                       ; +0x12, 0x14039c182\nmov     rax, [rdx]                                                     ; +0x15, 0x14039c185\nmov     rcx, rdx                                                       ; +0x18, 0x14039c188\ncall    qword ptr [rax+38h]                                            ; +0x1b, 0x14039c18b\nmovsxd  rdx, eax                                                       ; +0x1e, 0x14039c18e\nmov     rcx, [rdi+410h]                                                ; +0x21, 0x14039c191\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::objectForKey(__int64) ; +0x28, 0x14039c198\nmov     rbx, rax                                                       ; +0x2e, 0x14039c19e\ntest    rax, rax                                                       ; +0x31, 0x14039c1a1\njz      loc_14039C24B                                                  ; +0x34, 0x14039c1a4\ncmp     cs:qword_14090BFD0, 0                                          ; +0x3a, 0x14039c1aa\njnz     short loc_14039C1DF                                            ; +0x42, 0x14039c1b2\nmov     ecx, 6E8h; Size                                                ; +0x44, 0x14039c1b4\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x49, 0x14039c1b9\nmov     [rsp+48h+arg_0], rax                                           ; +0x4e, 0x14039c1be\nmov     rcx, rax                                                       ; +0x53, 0x14039c1c3\ncall    GameManager__GameManager                                       ; +0x56, 0x14039c1c6\nnop                                                                    ; +0x5b, 0x14039c1cb\nmov     cs:qword_14090BFD0, rax                                        ; +0x5c, 0x14039c1cc\nmov     rcx, [rax]                                                     ; +0x63, 0x14039c1d3\nmov     rdx, [rcx+48h]                                                 ; +0x66, 0x14039c1d6\nmov     rcx, rax                                                       ; +0x6a, 0x14039c1da\ncall    rdx                                                            ; +0x6d, 0x14039c1dd\nmov     rcx, rbx                                                       ; +0x6f, 0x14039c1df\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x72, 0x14039c1e2\nmov     rdx, rax                                                       ; +0x78, 0x14039c1e8\ncall    GameManager__toggleGameVariable                                ; +0x7b, 0x14039c1eb\nmov     rcx, rbx                                                       ; +0x80, 0x14039c1f0\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x83, 0x14039c1f3\nxorps   xmm0, xmm0                                                     ; +0x89, 0x14039c1f9\nmovups  [rsp+48h+var_28], xmm0                                         ; +0x8c, 0x14039c1fc\nxor     ecx, ecx                                                       ; +0x91, 0x14039c201\nmov     [rsp+48h+var_18], rcx                                          ; +0x93, 0x14039c203\nmov     [rsp+48h+var_10], rcx                                          ; +0x98, 0x14039c208\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x9d, 0x14039c20d\ninc     r8                                                             ; +0xa4, 0x14039c214\ncmp     [rax+r8], cl                                                   ; +0xa7, 0x14039c217\njnz     short loc_14039C214                                            ; +0xab, 0x14039c21b\nmov     rdx, rax                                                       ; +0xad, 0x14039c21d\nlea     rcx, [rsp+48h+var_28]                                          ; +0xb0, 0x14039c220\ncall    sub_14003D230                                                  ; +0xb5, 0x14039c225\nmov     rax, [rdi]                                                     ; +0xba, 0x14039c22a\nlea     rdx, [rsp+48h+var_28]                                          ; +0xbd, 0x14039c22d\nmov     rcx, rdi                                                       ; +0xc2, 0x14039c232\ncall    qword ptr [rax+4B8h]                                           ; +0xc5, 0x14039c235\nmov     rbx, [rsp+48h+arg_8]                                           ; +0xcb, 0x14039c23b\nmov     rsi, [rsp+48h+arg_10]                                          ; +0xd0, 0x14039c240\nadd     rsp, 40h                                                       ; +0xd5, 0x14039c245\npop     rdi                                                            ; +0xd9, 0x14039c249\nretn                                                                   ; +0xda, 0x14039c24a\nmov     rbx, [rdi]                                                     ; +0xdb, 0x14039c24b\nmov     rax, [rsi]                                                     ; +0xde, 0x14039c24e\nmov     rcx, rsi                                                       ; +0xe1, 0x14039c251\ncall    qword ptr [rax+38h]                                            ; +0xe4, 0x14039c254\nmov     edx, eax                                                       ; +0xe7, 0x14039c257\nmov     rcx, rdi                                                       ; +0xe9, 0x14039c259\nmov     rax, [rbx+4C0h]                                                ; +0xec, 0x14039c25c\nmov     rbx, [rsp+48h+arg_8]                                           ; +0xf3, 0x14039c263\nmov     rsi, [rsp+48h+arg_10]                                          ; +0xf8, 0x14039c268\nadd     rsp, 40h                                                       ; +0xfd, 0x14039c26d\npop     rdi                                                            ; +0x101, 0x14039c271\njmp     rax                                                            ; +0x102, 0x14039c272", "xrefs": ["GJOptionsLayer::addToggleInternal @ 0x14039b314", "<???> @ 0x14092336c"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}