{"type": "func", "start": 4297620272, "end": 4297620574, "name": "GJOptionsLayer::onToggle", "pseudocode": "// \n// GJOptionsLayer::onToggle from 0x100287b30 to 0x100287c5e (302 bytes)\n// \n// 2 xrefs:\n// > sub_100287300 @ 0x100287494\n// > GameOptionsLayer::setupOptions @ 0x10029e828\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 12:27:45 +0000\n// \n\nvoid __fastcall GJOptionsLayer::onToggle(_QWORD *a1, __int64 a2)\n{\n  __int64 v4; // r15\n  __int64 v5; // rsi\n  __int64 v6; // rdi\n  __int64 v7; // rax\n  __int64 v8; // rdx\n  __int64 v9; // r15\n  double v10; // xmm0_8\n  __int64 v11; // rax\n  __int64 v12; // r14\n  __int64 CString; // rax\n  const char *v14; // r15\n  size_t v15; // rax\n  size_t v16; // r14\n  char *v17; // r12\n  unsigned int v18; // eax\n  size_t v19; // r13\n  _QWORD __dst[2]; // [rsp+0h] [rbp-40h] BYREF\n  void *__p; // [rsp+10h] [rbp-30h]\n\n  v4 = a1[131];\n  v5 = (*(int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);\n  v6 = v4;\n  v7 = cocos2d::CCDictionary::objectForKey_1(v4);\n  if ( !v7 )\n  {\n    v18 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a2 + 64LL))(a2, v5);\n    (*(void (__fastcall **)(_QWORD *, _QWORD))(*a1 + 1520LL))(a1, v18);\n    return;\n  }\n  v9 = v7;\n  *(_QWORD *)&v10 = GameManager::sharedState(v6, v5, v8).u64[0];\n  v12 = v11;\n  CString = cocos2d::CCString::getCString(v9);\n  GameManager::toggleGameVariable(v12, CString);\n  v14 = (const char *)cocos2d::CCString::getCString(v9);\n  v15 = strlen(v14);\n  if ( v15 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100003630();\n  v16 = v15;\n  if ( v15 >= 0x17 )\n  {\n    v19 = 26;\n    if ( (v15 | 7) != 0x17 )\n      v19 = (v15 | 7) + 1;\n    v17 = (char *)operator new(v19);\n    __p = v17;\n    __dst[0] = v19 + 1;\n    __dst[1] = v16;\n    goto LABEL_10;\n  }\n  LOBYTE(__dst[0]) = 2 * v15;\n  v17 = (char *)__dst + 1;\n  if ( v15 )\nLABEL_10:\n    memmove(v17, v14, v16);\n  v17[v16] = 0;\n  (*(void (__fastcall **)(_QWORD *, _QWORD *, double))(*a1 + 1512LL))(a1, __dst, v10);\n  if ( (__dst[0] & 1) != 0 )\n    operator delete(__p);\n}", "assembly": "; \n; GJOptionsLayer::onToggle from 0x100287b30 to 0x100287c5e (302 bytes)\n; \n; 2 xrefs:\n; > sub_100287300 @ 0x100287494\n; > GameOptionsLayer::setupOptions @ 0x10029e828\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 12:27:45 +0000\n; \npush    rbp                                                            ; +0x0, 0x100287b30\nmov     rbp, rsp                                                       ; +0x1, 0x100287b31\npush    r15                                                            ; +0x4, 0x100287b34\npush    r14                                                            ; +0x6, 0x100287b36\npush    r13                                                            ; +0x8, 0x100287b38\npush    r12                                                            ; +0xa, 0x100287b3a\npush    rbx                                                            ; +0xc, 0x100287b3c\nsub     rsp, 18h                                                       ; +0xd, 0x100287b3d\nmov     r14, rsi                                                       ; +0x11, 0x100287b41\nmov     rbx, rdi                                                       ; +0x14, 0x100287b44\nmov     r15, [rdi+418h]                                                ; +0x17, 0x100287b47\nmov     rax, [rsi]                                                     ; +0x1e, 0x100287b4e\nmov     rdi, rsi                                                       ; +0x21, 0x100287b51\ncall    qword ptr [rax+40h]                                            ; +0x24, 0x100287b54\nmovsxd  rsi, eax                                                       ; +0x27, 0x100287b57\nmov     rdi, r15                                                       ; +0x2a, 0x100287b5a\ncall    cocos2d__CCDictionary__objectForKey_1                          ; +0x2d, 0x100287b5d\ntest    rax, rax                                                       ; +0x32, 0x100287b62\njz      short loc_100287BBD                                            ; +0x35, 0x100287b65\nmov     r15, rax                                                       ; +0x37, 0x100287b67\ncall    GameManager__sharedState                                       ; +0x3a, 0x100287b6a\nmov     r14, rax                                                       ; +0x3f, 0x100287b6f\nmov     rdi, r15                                                       ; +0x42, 0x100287b72\ncall    cocos2d__CCString__getCString                                  ; +0x45, 0x100287b75\nmov     rdi, r14                                                       ; +0x4a, 0x100287b7a\nmov     rsi, rax                                                       ; +0x4d, 0x100287b7d\ncall    GameManager__toggleGameVariable                                ; +0x50, 0x100287b80\nmov     rdi, r15                                                       ; +0x55, 0x100287b85\ncall    cocos2d__CCString__getCString                                  ; +0x58, 0x100287b88\nmov     r15, rax                                                       ; +0x5d, 0x100287b8d\nmov     rdi, rax; __s                                                  ; +0x60, 0x100287b90\ncall    _strlen                                                        ; +0x63, 0x100287b93\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x68, 0x100287b98\njnb     loc_100287C59                                                  ; +0x6c, 0x100287b9c\nmov     r14, rax                                                       ; +0x72, 0x100287ba2\ncmp     rax, 17h                                                       ; +0x75, 0x100287ba5\njnb     short loc_100287BE5                                            ; +0x79, 0x100287ba9\nlea     eax, [r14+r14]                                                 ; +0x7b, 0x100287bab\nmov     byte ptr [rbp+__dst], al                                       ; +0x7f, 0x100287baf\nlea     r12, [rbp+__dst+1]                                             ; +0x82, 0x100287bb2\ntest    r14, r14                                                       ; +0x86, 0x100287bb6\njnz     short loc_100287C18                                            ; +0x89, 0x100287bb9\njmp     short loc_100287C26                                            ; +0x8b, 0x100287bbb\nmov     rax, [r14]                                                     ; +0x8d, 0x100287bbd\nmov     rdi, r14                                                       ; +0x90, 0x100287bc0\ncall    qword ptr [rax+40h]                                            ; +0x93, 0x100287bc3\nmov     rcx, [rbx]                                                     ; +0x96, 0x100287bc6\nmov     rcx, [rcx+5F0h]                                                ; +0x99, 0x100287bc9\nmov     rdi, rbx                                                       ; +0xa0, 0x100287bd0\nmov     esi, eax                                                       ; +0xa3, 0x100287bd3\nadd     rsp, 18h                                                       ; +0xa5, 0x100287bd5\npop     rbx                                                            ; +0xa9, 0x100287bd9\npop     r12                                                            ; +0xaa, 0x100287bda\npop     r13                                                            ; +0xac, 0x100287bdc\npop     r14                                                            ; +0xae, 0x100287bde\npop     r15                                                            ; +0xb0, 0x100287be0\npop     rbp                                                            ; +0xb2, 0x100287be2\njmp     rcx                                                            ; +0xb3, 0x100287be3\nmov     rax, r14                                                       ; +0xb5, 0x100287be5\nor      rax, 7                                                         ; +0xb8, 0x100287be8\nlea     rcx, [rax+1]                                                   ; +0xbc, 0x100287bec\ncmp     rax, 17h                                                       ; +0xc0, 0x100287bf0\nmov     r13d, 1Ah                                                      ; +0xc4, 0x100287bf4\ncmovnz  r13, rcx                                                       ; +0xca, 0x100287bfa\nmov     rdi, r13; __sz                                                 ; +0xce, 0x100287bfe\ncall    __Znwm; operator new(ulong)                                    ; +0xd1, 0x100287c01\nmov     r12, rax                                                       ; +0xd6, 0x100287c06\nmov     [rbp+__p], rax                                                 ; +0xd9, 0x100287c09\ninc     r13                                                            ; +0xdd, 0x100287c0d\nmov     [rbp+__dst], r13                                               ; +0xe0, 0x100287c10\nmov     [rbp+var_38], r14                                              ; +0xe4, 0x100287c14\nmov     rdi, r12; __dst                                                ; +0xe8, 0x100287c18\nmov     rsi, r15; __src                                                ; +0xeb, 0x100287c1b\nmov     rdx, r14; __len                                                ; +0xee, 0x100287c1e\ncall    _memmove                                                       ; +0xf1, 0x100287c21\nmov     byte ptr [r12+r14], 0                                          ; +0xf6, 0x100287c26\nmov     rax, [rbx]                                                     ; +0xfb, 0x100287c2b\nlea     rsi, [rbp+__dst]                                               ; +0xfe, 0x100287c2e\nmov     rdi, rbx                                                       ; +0x102, 0x100287c32\ncall    qword ptr [rax+5E8h]                                           ; +0x105, 0x100287c35\ntest    byte ptr [rbp+__dst], 1                                        ; +0x10b, 0x100287c3b\njz      short loc_100287C4A                                            ; +0x10f, 0x100287c3f\nmov     rdi, [rbp+__p]; __p                                            ; +0x111, 0x100287c41\ncall    __ZdlPv; operator delete(void *)                               ; +0x115, 0x100287c45\nadd     rsp, 18h                                                       ; +0x11a, 0x100287c4a\npop     rbx                                                            ; +0x11e, 0x100287c4e\npop     r12                                                            ; +0x11f, 0x100287c4f\npop     r13                                                            ; +0x121, 0x100287c51\npop     r14                                                            ; +0x123, 0x100287c53\npop     r15                                                            ; +0x125, 0x100287c55\npop     rbp                                                            ; +0x127, 0x100287c57\nretn                                                                   ; +0x128, 0x100287c58\ncall    sub_100003630                                                  ; +0x129, 0x100287c59", "xrefs": ["sub_100287300 @ 0x100287494", "GameOptionsLayer::setupOptions @ 0x10029e828"], "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"}