{"type": "func", "start": 4297617856, "end": 4297618141, "name": "GJOptionsLayer::addGVToggle", "pseudocode": "// \n// GJOptionsLayer::addGVToggle from 0x1002871c0 to 0x1002872dd (285 bytes)\n// \n// 26 xrefs:\n// > EditorOptionsLayer::setupOptions @ 0x10028852d\n// > EditorOptionsLayer::setupOptions @ 0x10028854a\n// > EditorOptionsLayer::setupOptions @ 0x100288567\n// > EditorOptionsLayer::setupOptions @ 0x100288584\n// > EditorOptionsLayer::setupOptions @ 0x1002885a1\n// > EditorOptionsLayer::setupOptions @ 0x1002885be\n// > EditorOptionsLayer::setupOptions @ 0x1002885db\n// > EditorOptionsLayer::setupOptions @ 0x1002885f8\n// > EditorOptionsLayer::setupOptions @ 0x100288615\n// > EditorOptionsLayer::setupOptions @ 0x100288632\n// > EditorOptionsLayer::setupOptions @ 0x10028866a\n// > EditorOptionsLayer::setupOptions @ 0x100288687\n// > EditorOptionsLayer::setupOptions @ 0x1002886a4\n// > EditorOptionsLayer::setupOptions @ 0x1002886c1\n// > EditorOptionsLayer::setupOptions @ 0x1002886de\n// > EditorOptionsLayer::setupOptions @ 0x1002886fb\n// > EditorOptionsLayer::setupOptions @ 0x100288718\n// > EditorOptionsLayer::setupOptions @ 0x100288735\n// > EditorOptionsLayer::setupOptions @ 0x100288752\n// > EditorOptionsLayer::setupOptions @ 0x10028876f\n// > EditorOptionsLayer::setupOptions @ 0x10028878c\n// > EditorOptionsLayer::setupOptions @ 0x1002887a9\n// > EditorOptionsLayer::setupOptions @ 0x1002887c6\n// > EditorOptionsLayer::setupOptions @ 0x1002887e3\n// > SFXSettingsPopup::setupOptions @ 0x1004347ca\n// > FindObjectOptionsLayer::setupOptions @ 0x1009068ea\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\n__int64 __fastcall GJOptionsLayer::addGVToggle(__int64 a1, char *__s, char *a3)\n{\n  int v6; // r14d\n  __int64 v7; // rdx\n  __int64 v8; // rax\n  __int64 v9; // r12\n  __int64 v10; // rbx\n  size_t v11; // rax\n  size_t v12; // r13\n  char *v13; // rbx\n  __int64 v14; // r14\n  size_t v15; // r12\n  __int64 v16; // rax\n  __int64 v18; // [rsp+0h] [rbp-50h]\n  _QWORD __dst[2]; // [rsp+8h] [rbp-48h] BYREF\n  void *__p; // [rsp+18h] [rbp-38h]\n  int v21; // [rsp+24h] [rbp-2Ch]\n\n  v6 = atoi(a3);\n  GameManager::sharedState(a3, __s, v7);\n  GameManager::getGameVariable(v8, a3);\n  v9 = sub_100287300(a1, __s);\n  v10 = *(_QWORD *)(a1 + 1048);\n  v11 = strlen(a3);\n  if ( v11 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100003630();\n  v12 = v11;\n  v18 = v10;\n  if ( v11 >= 0x17 )\n  {\n    v21 = v6;\n    v14 = v9;\n    v15 = 26;\n    if ( (v11 | 7) != 0x17 )\n      v15 = (v11 | 7) + 1;\n    v13 = (char *)operator new(v15);\n    __p = v13;\n    __dst[0] = v15 + 1;\n    v9 = v14;\n    v6 = v21;\n    __dst[1] = v12;\n    goto LABEL_8;\n  }\n  LOBYTE(__dst[0]) = 2 * v11;\n  v13 = (char *)__dst + 1;\n  if ( v11 )\nLABEL_8:\n    memcpy(v13, a3, v12);\n  v13[v12] = 0;\n  v16 = sub_10088E600(__dst);\n  cocos2d::CCDictionary::setObject_1(v18, v16, v6);\n  if ( (__dst[0] & 1) != 0 )\n    operator delete(__p);\n  return v9;\n}", "assembly": "; \n; GJOptionsLayer::addGVToggle from 0x1002871c0 to 0x1002872dd (285 bytes)\n; \n; 26 xrefs:\n; > EditorOptionsLayer::setupOptions @ 0x10028852d\n; > EditorOptionsLayer::setupOptions @ 0x10028854a\n; > EditorOptionsLayer::setupOptions @ 0x100288567\n; > EditorOptionsLayer::setupOptions @ 0x100288584\n; > EditorOptionsLayer::setupOptions @ 0x1002885a1\n; > EditorOptionsLayer::setupOptions @ 0x1002885be\n; > EditorOptionsLayer::setupOptions @ 0x1002885db\n; > EditorOptionsLayer::setupOptions @ 0x1002885f8\n; > EditorOptionsLayer::setupOptions @ 0x100288615\n; > EditorOptionsLayer::setupOptions @ 0x100288632\n; > EditorOptionsLayer::setupOptions @ 0x10028866a\n; > EditorOptionsLayer::setupOptions @ 0x100288687\n; > EditorOptionsLayer::setupOptions @ 0x1002886a4\n; > EditorOptionsLayer::setupOptions @ 0x1002886c1\n; > EditorOptionsLayer::setupOptions @ 0x1002886de\n; > EditorOptionsLayer::setupOptions @ 0x1002886fb\n; > EditorOptionsLayer::setupOptions @ 0x100288718\n; > EditorOptionsLayer::setupOptions @ 0x100288735\n; > EditorOptionsLayer::setupOptions @ 0x100288752\n; > EditorOptionsLayer::setupOptions @ 0x10028876f\n; > EditorOptionsLayer::setupOptions @ 0x10028878c\n; > EditorOptionsLayer::setupOptions @ 0x1002887a9\n; > EditorOptionsLayer::setupOptions @ 0x1002887c6\n; > EditorOptionsLayer::setupOptions @ 0x1002887e3\n; > SFXSettingsPopup::setupOptions @ 0x1004347ca\n; > FindObjectOptionsLayer::setupOptions @ 0x1009068ea\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, 0x1002871c0\nmov     rbp, rsp                                                       ; +0x1, 0x1002871c1\npush    r15                                                            ; +0x4, 0x1002871c4\npush    r14                                                            ; +0x6, 0x1002871c6\npush    r13                                                            ; +0x8, 0x1002871c8\npush    r12                                                            ; +0xa, 0x1002871ca\npush    rbx                                                            ; +0xc, 0x1002871cc\nsub     rsp, 28h                                                       ; +0xd, 0x1002871cd\nmov     rbx, rcx                                                       ; +0x11, 0x1002871d1\nmov     r15, rdx                                                       ; +0x14, 0x1002871d4\nmov     r12, rsi                                                       ; +0x17, 0x1002871d7\nmov     r13, rdi                                                       ; +0x1a, 0x1002871da\nmov     rdi, rdx; char *                                               ; +0x1d, 0x1002871dd\ncall    _atoi                                                          ; +0x20, 0x1002871e0\nmov     r14d, eax                                                      ; +0x25, 0x1002871e5\ncall    GameManager__sharedState                                       ; +0x28, 0x1002871e8\nmov     rdi, rax                                                       ; +0x2d, 0x1002871ed\nmov     rsi, r15                                                       ; +0x30, 0x1002871f0\ncall    GameManager__getGameVariable                                   ; +0x33, 0x1002871f3\nmovzx   ecx, al                                                        ; +0x38, 0x1002871f8\nmov     rdi, r13; char                                                 ; +0x3b, 0x1002871fb\nmov     rsi, r12; __s                                                  ; +0x3e, 0x1002871fe\nmov     edx, r14d                                                      ; +0x41, 0x100287201\nmov     r8, rbx                                                        ; +0x44, 0x100287204\ncall    sub_100287300                                                  ; +0x47, 0x100287207\nmov     r12, rax                                                       ; +0x4c, 0x10028720c\nmov     rbx, [r13+418h]                                                ; +0x4f, 0x10028720f\nmov     rdi, r15; __s                                                  ; +0x56, 0x100287216\ncall    _strlen                                                        ; +0x59, 0x100287219\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x5e, 0x10028721e\njnb     loc_1002872D8                                                  ; +0x62, 0x100287222\nmov     r13, rax                                                       ; +0x68, 0x100287228\nmov     [rbp+var_50], rbx                                              ; +0x6b, 0x10028722b\ncmp     rax, 17h                                                       ; +0x6f, 0x10028722f\njnb     short loc_10028724B                                            ; +0x73, 0x100287233\nlea     eax, ds:0[r13*2]                                               ; +0x75, 0x100287235\nmov     byte ptr [rbp+__dst], al                                       ; +0x7d, 0x10028723d\nlea     rbx, [rbp+__dst+1]                                             ; +0x80, 0x100287240\ntest    r13, r13                                                       ; +0x84, 0x100287244\njnz     short loc_10028728C                                            ; +0x87, 0x100287247\njmp     short loc_10028729A                                            ; +0x89, 0x100287249\nmov     rax, r13                                                       ; +0x8b, 0x10028724b\nor      rax, 7                                                         ; +0x8e, 0x10028724e\nlea     rcx, [rax+1]                                                   ; +0x92, 0x100287252\ncmp     rax, 17h                                                       ; +0x96, 0x100287256\nmov     [rbp+var_2C], r14d                                             ; +0x9a, 0x10028725a\nmov     r14, r12                                                       ; +0x9e, 0x10028725e\nmov     r12d, 1Ah                                                      ; +0xa1, 0x100287261\ncmovnz  r12, rcx                                                       ; +0xa7, 0x100287267\nmov     rdi, r12; __sz                                                 ; +0xab, 0x10028726b\ncall    __Znwm; operator new(ulong)                                    ; +0xae, 0x10028726e\nmov     rbx, rax                                                       ; +0xb3, 0x100287273\nmov     [rbp+__p], rax                                                 ; +0xb6, 0x100287276\ninc     r12                                                            ; +0xba, 0x10028727a\nmov     [rbp+__dst], r12                                               ; +0xbd, 0x10028727d\nmov     r12, r14                                                       ; +0xc1, 0x100287281\nmov     r14d, [rbp+var_2C]                                             ; +0xc4, 0x100287284\nmov     [rbp+var_40], r13                                              ; +0xc8, 0x100287288\nmov     rdi, rbx; __dst                                                ; +0xcc, 0x10028728c\nmov     rsi, r15; __src                                                ; +0xcf, 0x10028728f\nmov     rdx, r13; __n                                                  ; +0xd2, 0x100287292\ncall    _memcpy                                                        ; +0xd5, 0x100287295\nmov     byte ptr [rbx+r13], 0                                          ; +0xda, 0x10028729a\nlea     rdi, [rbp+__dst]                                               ; +0xdf, 0x10028729f\ncall    sub_10088E600                                                  ; +0xe3, 0x1002872a3\nmovsxd  rdx, r14d                                                      ; +0xe8, 0x1002872a8\nmov     rdi, [rbp+var_50]                                              ; +0xeb, 0x1002872ab\nmov     rsi, rax                                                       ; +0xef, 0x1002872af\ncall    cocos2d__CCDictionary__setObject_1                             ; +0xf2, 0x1002872b2\ntest    byte ptr [rbp+__dst], 1                                        ; +0xf7, 0x1002872b7\njz      short loc_1002872C6                                            ; +0xfb, 0x1002872bb\nmov     rdi, [rbp+__p]; __p                                            ; +0xfd, 0x1002872bd\ncall    __ZdlPv; operator delete(void *)                               ; +0x101, 0x1002872c1\nmov     rax, r12                                                       ; +0x106, 0x1002872c6\nadd     rsp, 28h                                                       ; +0x109, 0x1002872c9\npop     rbx                                                            ; +0x10d, 0x1002872cd\npop     r12                                                            ; +0x10e, 0x1002872ce\npop     r13                                                            ; +0x110, 0x1002872d0\npop     r14                                                            ; +0x112, 0x1002872d2\npop     r15                                                            ; +0x114, 0x1002872d4\npop     rbp                                                            ; +0x116, 0x1002872d6\nretn                                                                   ; +0x117, 0x1002872d7\ncall    sub_100003630                                                  ; +0x118, 0x1002872d8", "xrefs": ["EditorOptionsLayer::setupOptions @ 0x10028852d", "EditorOptionsLayer::setupOptions @ 0x10028854a", "EditorOptionsLayer::setupOptions @ 0x100288567", "EditorOptionsLayer::setupOptions @ 0x100288584", "EditorOptionsLayer::setupOptions @ 0x1002885a1", "EditorOptionsLayer::setupOptions @ 0x1002885be", "EditorOptionsLayer::setupOptions @ 0x1002885db", "EditorOptionsLayer::setupOptions @ 0x1002885f8", "EditorOptionsLayer::setupOptions @ 0x100288615", "EditorOptionsLayer::setupOptions @ 0x100288632", "EditorOptionsLayer::setupOptions @ 0x10028866a", "EditorOptionsLayer::setupOptions @ 0x100288687", "EditorOptionsLayer::setupOptions @ 0x1002886a4", "EditorOptionsLayer::setupOptions @ 0x1002886c1", "EditorOptionsLayer::setupOptions @ 0x1002886de", "EditorOptionsLayer::setupOptions @ 0x1002886fb", "EditorOptionsLayer::setupOptions @ 0x100288718", "EditorOptionsLayer::setupOptions @ 0x100288735", "EditorOptionsLayer::setupOptions @ 0x100288752", "EditorOptionsLayer::setupOptions @ 0x10028876f", "EditorOptionsLayer::setupOptions @ 0x10028878c", "EditorOptionsLayer::setupOptions @ 0x1002887a9", "EditorOptionsLayer::setupOptions @ 0x1002887c6", "EditorOptionsLayer::setupOptions @ 0x1002887e3", "SFXSettingsPopup::setupOptions @ 0x1004347ca", "FindObjectOptionsLayer::setupOptions @ 0x1009068ea"], "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"}