{"type": "func", "start": 5371395488, "end": 5371395806, "name": "GJOptionsLayer::addGVToggle", "pseudocode": "// \n// GJOptionsLayer::addGVToggle from 0x14028fda0 to 0x14028fede (318 bytes)\n// \n// 24 xrefs:\n// > EditorOptionsLayer::setupOptions @ 0x1402910b6\n// > EditorOptionsLayer::setupOptions @ 0x1402910d3\n// > EditorOptionsLayer::setupOptions @ 0x1402910f0\n// > EditorOptionsLayer::setupOptions @ 0x14029110d\n// > EditorOptionsLayer::setupOptions @ 0x14029112a\n// > EditorOptionsLayer::setupOptions @ 0x140291147\n// > EditorOptionsLayer::setupOptions @ 0x140291164\n// > EditorOptionsLayer::setupOptions @ 0x140291181\n// > EditorOptionsLayer::setupOptions @ 0x14029119e\n// > EditorOptionsLayer::setupOptions @ 0x1402911bb\n// > EditorOptionsLayer::setupOptions @ 0x1402911f8\n// > EditorOptionsLayer::setupOptions @ 0x140291215\n// > EditorOptionsLayer::setupOptions @ 0x140291232\n// > EditorOptionsLayer::setupOptions @ 0x14029124f\n// > EditorOptionsLayer::setupOptions @ 0x14029126c\n// > EditorOptionsLayer::setupOptions @ 0x140291289\n// > EditorOptionsLayer::setupOptions @ 0x1402912a6\n// > EditorOptionsLayer::setupOptions @ 0x1402912c3\n// > EditorOptionsLayer::setupOptions @ 0x1402912e0\n// > EditorOptionsLayer::setupOptions @ 0x1402912fd\n// > EditorOptionsLayer::setupOptions @ 0x14029131a\n// > EditorOptionsLayer::setupOptions @ 0x140291337\n// > EditorOptionsLayer::setupOptions @ 0x140291354\n// > <???> @ 0x1406d1928\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=2\nvoid GJOptionsLayer::addGVToggle(GJOptionsLayer *a1, const char *a2, const char *a3, const char *a4)\n{\n  __int64 v8; // rsi\n  GameManager *v9; // rcx\n  bool GameVariable; // al\n  size_t v11; // r8\n  struct cocos2d::CCObject *v12; // rax\n  void *v13; // rcx\n  void *v14; // [rsp+30h] [rbp-58h]\n  void *Block[2]; // [rsp+38h] [rbp-50h] BYREF\n  __int64 v16; // [rsp+48h] [rbp-40h]\n  unsigned __int64 v17; // [rsp+50h] [rbp-38h]\n\n  v8 = atoi(a3);\n  v9 = (GameManager *)qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v14 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v14);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v9 = (GameManager *)qword_1406C2ED8;\n  }\n  GameVariable = GameManager::getGameVariable(v9, a3);\n  GJOptionsLayer::addToggleInternal(a1, a2, v8, GameVariable, a4);\n  *(_OWORD *)Block = 0;\n  v16 = 0;\n  v17 = 0;\n  v11 = -1;\n  do\n    ++v11;\n  while ( a3[v11] );\n  sub_14003A930(Block, a3, v11);\n  v12 = (struct cocos2d::CCObject *)cocos2d::CCString::create(Block);\n  cocos2d::CCDictionary::setObject(a1->m_variables, v12, v8);\n  if ( v17 > 0xF )\n  {\n    v13 = Block[0];\n    if ( v17 + 1 >= 0x1000 )\n    {\n      v13 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v13 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v13);\n  }\n}", "assembly": "; \n; GJOptionsLayer::addGVToggle from 0x14028fda0 to 0x14028fede (318 bytes)\n; \n; 24 xrefs:\n; > EditorOptionsLayer::setupOptions @ 0x1402910b6\n; > EditorOptionsLayer::setupOptions @ 0x1402910d3\n; > EditorOptionsLayer::setupOptions @ 0x1402910f0\n; > EditorOptionsLayer::setupOptions @ 0x14029110d\n; > EditorOptionsLayer::setupOptions @ 0x14029112a\n; > EditorOptionsLayer::setupOptions @ 0x140291147\n; > EditorOptionsLayer::setupOptions @ 0x140291164\n; > EditorOptionsLayer::setupOptions @ 0x140291181\n; > EditorOptionsLayer::setupOptions @ 0x14029119e\n; > EditorOptionsLayer::setupOptions @ 0x1402911bb\n; > EditorOptionsLayer::setupOptions @ 0x1402911f8\n; > EditorOptionsLayer::setupOptions @ 0x140291215\n; > EditorOptionsLayer::setupOptions @ 0x140291232\n; > EditorOptionsLayer::setupOptions @ 0x14029124f\n; > EditorOptionsLayer::setupOptions @ 0x14029126c\n; > EditorOptionsLayer::setupOptions @ 0x140291289\n; > EditorOptionsLayer::setupOptions @ 0x1402912a6\n; > EditorOptionsLayer::setupOptions @ 0x1402912c3\n; > EditorOptionsLayer::setupOptions @ 0x1402912e0\n; > EditorOptionsLayer::setupOptions @ 0x1402912fd\n; > EditorOptionsLayer::setupOptions @ 0x14029131a\n; > EditorOptionsLayer::setupOptions @ 0x140291337\n; > EditorOptionsLayer::setupOptions @ 0x140291354\n; > <???> @ 0x1406d1928\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\npush    rbx                                                            ; +0x0, 0x14028fda0\npush    rbp                                                            ; +0x2, 0x14028fda2\npush    rsi                                                            ; +0x3, 0x14028fda3\npush    rdi                                                            ; +0x4, 0x14028fda4\npush    r14                                                            ; +0x5, 0x14028fda5\nsub     rsp, 60h                                                       ; +0x7, 0x14028fda7\nmov     rax, cs:__security_cookie                                      ; +0xb, 0x14028fdab\nxor     rax, rsp                                                       ; +0x12, 0x14028fdb2\nmov     [rsp+88h+var_30], rax                                          ; +0x15, 0x14028fdb5\nmov     r14, r9                                                        ; +0x1a, 0x14028fdba\nmov     rbx, r8                                                        ; +0x1d, 0x14028fdbd\nmov     rbp, rdx                                                       ; +0x20, 0x14028fdc0\nmov     rdi, rcx                                                       ; +0x23, 0x14028fdc3\nmov     rcx, r8; String                                                ; +0x26, 0x14028fdc6\ncall    cs:atoi                                                        ; +0x29, 0x14028fdc9\nmovsxd  rsi, eax                                                       ; +0x2f, 0x14028fdcf\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x32, 0x14028fdd2\ntest    rcx, rcx                                                       ; +0x39, 0x14028fdd9\njnz     short loc_14028FE0E                                            ; +0x3c, 0x14028fddc\nmov     ecx, 668h; Size                                                ; +0x3e, 0x14028fdde\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x43, 0x14028fde3\nmov     [rsp+88h+var_58], rax                                          ; +0x48, 0x14028fde8\nmov     rcx, rax                                                       ; +0x4d, 0x14028fded\ncall    sub_14017AB00                                                  ; +0x50, 0x14028fdf0\nnop                                                                    ; +0x55, 0x14028fdf5\nmov     cs:qword_1406C2ED8, rax                                        ; +0x56, 0x14028fdf6\nmov     r8, [rax]                                                      ; +0x5d, 0x14028fdfd\nmov     rcx, rax                                                       ; +0x60, 0x14028fe00\ncall    qword ptr [r8+48h]                                             ; +0x63, 0x14028fe03\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x67, 0x14028fe07\nmov     rdx, rbx                                                       ; +0x6e, 0x14028fe0e\ncall    GameManager__getGameVariable                                   ; +0x71, 0x14028fe11\nmov     [rsp+88h+var_68], r14                                          ; +0x76, 0x14028fe16\nmovzx   r9d, al                                                        ; +0x7b, 0x14028fe1b\nmov     r8d, esi                                                       ; +0x7f, 0x14028fe1f\nmov     rdx, rbp                                                       ; +0x82, 0x14028fe22\nmov     rcx, rdi                                                       ; +0x85, 0x14028fe25\ncall    GJOptionsLayer__addToggleInternal                              ; +0x88, 0x14028fe28\nxorps   xmm0, xmm0                                                     ; +0x8d, 0x14028fe2d\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0x90, 0x14028fe30\nxor     eax, eax                                                       ; +0x95, 0x14028fe35\nmov     [rsp+88h+var_40], rax                                          ; +0x97, 0x14028fe37\nmov     [rsp+88h+var_38], rax                                          ; +0x9c, 0x14028fe3c\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xa1, 0x14028fe41\nnop     dword ptr [rax+rax+00000000h]                                  ; +0xa8, 0x14028fe48\ninc     r8                                                             ; +0xb0, 0x14028fe50\ncmp     [rbx+r8], al                                                   ; +0xb3, 0x14028fe53\njnz     short loc_14028FE50                                            ; +0xb7, 0x14028fe57\nmov     rdx, rbx                                                       ; +0xb9, 0x14028fe59\nlea     rcx, [rsp+88h+Block]                                           ; +0xbc, 0x14028fe5c\ncall    sub_14003A930                                                  ; +0xc1, 0x14028fe61\nnop                                                                    ; +0xc6, 0x14028fe66\nlea     rcx, [rsp+88h+Block]                                           ; +0xc7, 0x14028fe67\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 &) ; +0xcc, 0x14028fe6c\nmov     rdx, rax                                                       ; +0xd2, 0x14028fe72\nmov     r8, rsi                                                        ; +0xd5, 0x14028fe75\nmov     rcx, [rdi+3D0h]                                                ; +0xd8, 0x14028fe78\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,__int64) ; +0xdf, 0x14028fe7f\nnop                                                                    ; +0xe5, 0x14028fe85\nmov     rdx, [rsp+88h+var_38]                                          ; +0xe6, 0x14028fe86\ncmp     rdx, 0Fh                                                       ; +0xeb, 0x14028fe8b\njbe     short loc_14028FEC6                                            ; +0xef, 0x14028fe8f\ninc     rdx                                                            ; +0xf1, 0x14028fe91\nmov     rcx, [rsp+88h+Block]; Block                                    ; +0xf4, 0x14028fe94\nmov     rax, rcx                                                       ; +0xf9, 0x14028fe99\ncmp     rdx, 1000h                                                     ; +0xfc, 0x14028fe9c\njb      short loc_14028FEC1                                            ; +0x103, 0x14028fea3\nadd     rdx, 27h ; '''                                                 ; +0x105, 0x14028fea5\nmov     rcx, [rcx-8]                                                   ; +0x109, 0x14028fea9\nsub     rax, rcx                                                       ; +0x10d, 0x14028fead\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x110, 0x14028feb0\ncmp     rax, 1Fh                                                       ; +0x114, 0x14028feb4\njbe     short loc_14028FEC1                                            ; +0x118, 0x14028feb8\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x11a, 0x14028feba\ndb 0CCh                                                                ; +0x120, 0x14028fec0\ncall    j_j_free                                                       ; +0x121, 0x14028fec1\nmov     rcx, [rsp+88h+var_30]                                          ; +0x126, 0x14028fec6\nxor     rcx, rsp; StackCookie                                          ; +0x12b, 0x14028fecb\ncall    __security_check_cookie                                        ; +0x12e, 0x14028fece\nadd     rsp, 60h                                                       ; +0x133, 0x14028fed3\npop     r14                                                            ; +0x137, 0x14028fed7\npop     rdi                                                            ; +0x139, 0x14028fed9\npop     rsi                                                            ; +0x13a, 0x14028feda\npop     rbp                                                            ; +0x13b, 0x14028fedb\npop     rbx                                                            ; +0x13c, 0x14028fedc\nretn                                                                   ; +0x13d, 0x14028fedd", "xrefs": ["EditorOptionsLayer::setupOptions @ 0x1402910b6", "EditorOptionsLayer::setupOptions @ 0x1402910d3", "EditorOptionsLayer::setupOptions @ 0x1402910f0", "EditorOptionsLayer::setupOptions @ 0x14029110d", "EditorOptionsLayer::setupOptions @ 0x14029112a", "EditorOptionsLayer::setupOptions @ 0x140291147", "EditorOptionsLayer::setupOptions @ 0x140291164", "EditorOptionsLayer::setupOptions @ 0x140291181", "EditorOptionsLayer::setupOptions @ 0x14029119e", "EditorOptionsLayer::setupOptions @ 0x1402911bb", "EditorOptionsLayer::setupOptions @ 0x1402911f8", "EditorOptionsLayer::setupOptions @ 0x140291215", "EditorOptionsLayer::setupOptions @ 0x140291232", "EditorOptionsLayer::setupOptions @ 0x14029124f", "EditorOptionsLayer::setupOptions @ 0x14029126c", "EditorOptionsLayer::setupOptions @ 0x140291289", "EditorOptionsLayer::setupOptions @ 0x1402912a6", "EditorOptionsLayer::setupOptions @ 0x1402912c3", "EditorOptionsLayer::setupOptions @ 0x1402912e0", "EditorOptionsLayer::setupOptions @ 0x1402912fd", "EditorOptionsLayer::setupOptions @ 0x14029131a", "EditorOptionsLayer::setupOptions @ 0x140291337", "EditorOptionsLayer::setupOptions @ 0x140291354", "<???> @ 0x1406d1928"], "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"}