{"type": "func", "start": 5372489792, "end": 5372490131, "name": "GJOptionsLayer::addGVToggle", "pseudocode": "// \n// GJOptionsLayer::addGVToggle from 0x14039b040 to 0x14039b193 (339 bytes)\n// \n// 3 xrefs:\n// > FindObjectOptionsLayer::setupOptions @ 0x140180c75\n// > SFXSettingsPopup::setupOptions @ 0x14061f6d5\n// > <???> @ 0x14092330c\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:14 +0000\n// \n\n// Hidden C++ exception states: #wind=2\n__int64 __fastcall GJOptionsLayer::addGVToggle(__int64 a1, int a2, char *a3, __int64 a4)\n{\n  __int64 v8; // rbp\n  __int64 v9; // rcx\n  bool GameVariable; // al\n  __int64 v11; // rsi\n  size_t v12; // r8\n  cocos2d::CCDictionary *v13; // rdi\n  struct cocos2d::CCObject *v14; // rax\n  void *v15; // rcx\n  void *v17; // [rsp+30h] [rbp-58h]\n  void *Block[2]; // [rsp+38h] [rbp-50h] BYREF\n  __int64 v19; // [rsp+48h] [rbp-40h]\n  unsigned __int64 v20; // [rsp+50h] [rbp-38h]\n\n  v8 = atoi(a3);\n  v9 = qword_14090BFD0;\n  if ( !qword_14090BFD0 )\n  {\n    v17 = operator new(0x6E8u);\n    qword_14090BFD0 = GameManager::GameManager((__int64)v17);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    v9 = qword_14090BFD0;\n  }\n  GameVariable = GameManager::getGameVariable(v9, a3);\n  v11 = GJOptionsLayer::addToggleInternal(a1, a2, v8, GameVariable, a4);\n  *(_OWORD *)Block = 0;\n  v19 = 0;\n  v20 = 0;\n  v12 = -1;\n  do\n    ++v12;\n  while ( a3[v12] );\n  sub_14003D230(Block, a3, v12);\n  v13 = *(cocos2d::CCDictionary **)(a1 + 1040);\n  v14 = (struct cocos2d::CCObject *)cocos2d::CCString::create(Block);\n  cocos2d::CCDictionary::setObject(v13, v14, v8);\n  if ( v20 > 0xF )\n  {\n    v15 = Block[0];\n    if ( v20 + 1 >= 0x1000 )\n    {\n      v15 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v15 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v15);\n  }\n  return v11;\n}", "assembly": "; \n; GJOptionsLayer::addGVToggle from 0x14039b040 to 0x14039b193 (339 bytes)\n; \n; 3 xrefs:\n; > FindObjectOptionsLayer::setupOptions @ 0x140180c75\n; > SFXSettingsPopup::setupOptions @ 0x14061f6d5\n; > <???> @ 0x14092330c\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:14 +0000\n; \npush    rbx                                                            ; +0x0, 0x14039b040\npush    rbp                                                            ; +0x2, 0x14039b042\npush    rsi                                                            ; +0x3, 0x14039b043\npush    rdi                                                            ; +0x4, 0x14039b044\npush    r14                                                            ; +0x5, 0x14039b045\nsub     rsp, 60h                                                       ; +0x7, 0x14039b047\nmov     rax, cs:__security_cookie                                      ; +0xb, 0x14039b04b\nxor     rax, rsp                                                       ; +0x12, 0x14039b052\nmov     [rsp+88h+var_30], rax                                          ; +0x15, 0x14039b055\nmov     r14, r9                                                        ; +0x1a, 0x14039b05a\nmov     rbx, r8                                                        ; +0x1d, 0x14039b05d\nmov     rsi, rdx                                                       ; +0x20, 0x14039b060\nmov     rdi, rcx                                                       ; +0x23, 0x14039b063\nmov     rcx, r8; String                                                ; +0x26, 0x14039b066\ncall    cs:atoi                                                        ; +0x29, 0x14039b069\nmovsxd  rbp, eax                                                       ; +0x2f, 0x14039b06f\nmov     rcx, cs:qword_14090BFD0                                        ; +0x32, 0x14039b072\ntest    rcx, rcx                                                       ; +0x39, 0x14039b079\njnz     short loc_14039B0B1                                            ; +0x3c, 0x14039b07c\nmov     ecx, 6E8h; Size                                                ; +0x3e, 0x14039b07e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x43, 0x14039b083\nmov     [rsp+88h+var_58], rax                                          ; +0x48, 0x14039b088\nmov     rcx, rax                                                       ; +0x4d, 0x14039b08d\ncall    GameManager__GameManager                                       ; +0x50, 0x14039b090\nnop                                                                    ; +0x55, 0x14039b095\nmov     cs:qword_14090BFD0, rax                                        ; +0x56, 0x14039b096\nmov     rcx, [rax]                                                     ; +0x5d, 0x14039b09d\nmov     r8, [rcx+48h]                                                  ; +0x60, 0x14039b0a0\nmov     rcx, rax                                                       ; +0x64, 0x14039b0a4\ncall    r8                                                             ; +0x67, 0x14039b0a7\nmov     rcx, cs:qword_14090BFD0                                        ; +0x6a, 0x14039b0aa\nmov     rdx, rbx                                                       ; +0x71, 0x14039b0b1\ncall    GameManager__getGameVariable                                   ; +0x74, 0x14039b0b4\nmov     [rsp+88h+Reserved], r14                                        ; +0x79, 0x14039b0b9\nmovzx   r9d, al                                                        ; +0x7e, 0x14039b0be\nmov     r8d, ebp                                                       ; +0x82, 0x14039b0c2\nmov     rdx, rsi                                                       ; +0x85, 0x14039b0c5\nmov     rcx, rdi                                                       ; +0x88, 0x14039b0c8\ncall    GJOptionsLayer__addToggleInternal                              ; +0x8b, 0x14039b0cb\nmov     rsi, rax                                                       ; +0x90, 0x14039b0d0\nxorps   xmm0, xmm0                                                     ; +0x93, 0x14039b0d3\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0x96, 0x14039b0d6\nxor     r14d, r14d                                                     ; +0x9b, 0x14039b0db\nmov     [rsp+88h+var_40], r14                                          ; +0x9e, 0x14039b0de\nmov     [rsp+88h+var_38], r14                                          ; +0xa3, 0x14039b0e3\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xa8, 0x14039b0e8\nnop                                                                    ; +0xaf, 0x14039b0ef\ninc     r8                                                             ; +0xb0, 0x14039b0f0\ncmp     [rbx+r8], r14b                                                 ; +0xb3, 0x14039b0f3\njnz     short loc_14039B0F0                                            ; +0xb7, 0x14039b0f7\nmov     rdx, rbx                                                       ; +0xb9, 0x14039b0f9\nlea     rcx, [rsp+88h+Block]                                           ; +0xbc, 0x14039b0fc\ncall    sub_14003D230                                                  ; +0xc1, 0x14039b101\nnop                                                                    ; +0xc6, 0x14039b106\nmov     rdi, [rdi+410h]                                                ; +0xc7, 0x14039b107\nlea     rcx, [rsp+88h+Block]                                           ; +0xce, 0x14039b10e\ncall    cs:?create@CCString@cocos2d@@SAPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCString::create(std::string const &) ; +0xd3, 0x14039b113\nmov     rdx, rax                                                       ; +0xd9, 0x14039b119\nmov     r8, rbp                                                        ; +0xdc, 0x14039b11c\nmov     rcx, rdi                                                       ; +0xdf, 0x14039b11f\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,__int64) ; +0xe2, 0x14039b122\nnop                                                                    ; +0xe8, 0x14039b128\nmov     rdx, [rsp+88h+var_38]                                          ; +0xe9, 0x14039b129\ncmp     rdx, 0Fh                                                       ; +0xee, 0x14039b12e\njbe     short loc_14039B178                                            ; +0xf2, 0x14039b132\ninc     rdx                                                            ; +0xf4, 0x14039b134\nmov     rcx, [rsp+88h+Block]; Block                                    ; +0xf7, 0x14039b137\nmov     rax, rcx                                                       ; +0xfc, 0x14039b13c\ncmp     rdx, 1000h                                                     ; +0xff, 0x14039b13f\njb      short loc_14039B173                                            ; +0x106, 0x14039b146\nadd     rdx, 27h ; '''                                                 ; +0x108, 0x14039b148\nmov     rcx, [rcx-8]                                                   ; +0x10c, 0x14039b14c\nsub     rax, rcx                                                       ; +0x110, 0x14039b150\nsub     rax, 8                                                         ; +0x113, 0x14039b153\ncmp     rax, 1Fh                                                       ; +0x117, 0x14039b157\njbe     short loc_14039B173                                            ; +0x11b, 0x14039b15b\nmov     [rsp+88h+Reserved], r14; Reserved                              ; +0x11d, 0x14039b15d\nxor     r9d, r9d; LineNo                                               ; +0x122, 0x14039b162\nxor     r8d, r8d; FileName                                             ; +0x125, 0x14039b165\nxor     edx, edx; FunctionName                                         ; +0x128, 0x14039b168\nxor     ecx, ecx; Expression                                           ; +0x12a, 0x14039b16a\ncall    cs:_invoke_watson                                              ; +0x12c, 0x14039b16c\ndb 0CCh                                                                ; +0x132, 0x14039b172\ncall    j_j_free                                                       ; +0x133, 0x14039b173\nmov     rax, rsi                                                       ; +0x138, 0x14039b178\nmov     rcx, [rsp+88h+var_30]                                          ; +0x13b, 0x14039b17b\nxor     rcx, rsp; StackCookie                                          ; +0x140, 0x14039b180\ncall    __security_check_cookie                                        ; +0x143, 0x14039b183\nadd     rsp, 60h                                                       ; +0x148, 0x14039b188\npop     r14                                                            ; +0x14c, 0x14039b18c\npop     rdi                                                            ; +0x14e, 0x14039b18e\npop     rsi                                                            ; +0x14f, 0x14039b18f\npop     rbp                                                            ; +0x150, 0x14039b190\npop     rbx                                                            ; +0x151, 0x14039b191\nretn                                                                   ; +0x152, 0x14039b192", "xrefs": ["FindObjectOptionsLayer::setupOptions @ 0x140180c75", "SFXSettingsPopup::setupOptions @ 0x14061f6d5", "<???> @ 0x14092330c"], "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"}