{"type": "func", "start": 9286112, "end": 9286448, "name": "GJOptionsLayer::addGVToggle", "pseudocode": "// \n// GJOptionsLayer::addGVToggle from 0x8db1e0 to 0x8db330 (336 bytes)\n// \n// 24 xrefs:\n// > EditorOptionsLayer::setupOptions @ 0x8db39c\n// > EditorOptionsLayer::setupOptions @ 0x8db3c8\n// > EditorOptionsLayer::setupOptions @ 0x8db3f8\n// > EditorOptionsLayer::setupOptions @ 0x8db420\n// > EditorOptionsLayer::setupOptions @ 0x8db440\n// > EditorOptionsLayer::setupOptions @ 0x8db460\n// > EditorOptionsLayer::setupOptions @ 0x8db480\n// > EditorOptionsLayer::setupOptions @ 0x8db4a0\n// > EditorOptionsLayer::setupOptions @ 0x8db4c0\n// > EditorOptionsLayer::setupOptions @ 0x8db4e0\n// > EditorOptionsLayer::setupOptions @ 0x8db508\n// > EditorOptionsLayer::setupOptions @ 0x8db528\n// > EditorOptionsLayer::setupOptions @ 0x8db548\n// > EditorOptionsLayer::setupOptions @ 0x8db568\n// > EditorOptionsLayer::setupOptions @ 0x8db588\n// > EditorOptionsLayer::setupOptions @ 0x8db5a8\n// > EditorOptionsLayer::setupOptions @ 0x8db5c8\n// > EditorOptionsLayer::setupOptions @ 0x8db5e8\n// > EditorOptionsLayer::setupOptions @ 0x8db608\n// > EditorOptionsLayer::setupOptions @ 0x8db628\n// > EditorOptionsLayer::setupOptions @ 0x8db648\n// > EditorOptionsLayer::setupOptions @ 0x8db668\n// > EditorOptionsLayer::setupOptions @ 0x8db688\n// > <???> @ 0x6bb80\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\nvoid GJOptionsLayer::addGVToggle(GJOptionsLayer *a1, const char *a2, const char *a3, const char *a4)\n{\n  int v7; // w22\n  GameManager *v8; // x0\n  bool GameVariable; // w0\n  char *v10; // x1\n  cocos2d::CCDictionary *m_variables; // x21\n  const std::string *v12; // x1\n  cocos2d::CCObject *v13; // x0\n  void *v14; // x0\n  unsigned int *v15; // x2\n  int v16; // w1\n  __int64 v18; // [xsp+60h] [xbp+60h] BYREF\n\n  v7 = atoi(a3);\n  v8 = GameManager::sharedState();\n  GameVariable = GameManager::getGameVariable(v8, a3);\n  GJOptionsLayer::addToggleInternal(a1, a2, v7, GameVariable, a4);\n  v10 = (char *)a3;\n  m_variables = a1->m_variables;\n  sub_D153B8((int)&v18, v10);\n  v13 = (cocos2d::CCObject *)cocos2d::CCString::create((cocos2d::CCString *)&v18, v12);\n  cocos2d::CCDictionary::setObject(m_variables, v13, v7);\n  v14 = (void *)(v18 - 24);\n  if ( (__int64 *)(v18 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v15 = (unsigned int *)(v18 - 8);\n      do\n        v16 = __ldaxr(v15);\n      while ( __stlxr(v16 - 1, v15) );\n    }\n    else\n    {\n      v16 = *(_DWORD *)(v18 - 8);\n      *(_DWORD *)(v18 - 8) = v16 - 1;\n    }\n    if ( v16 <= 0 )\n      operator delete(v14);\n  }\n}", "assembly": "; \n; GJOptionsLayer::addGVToggle from 0x8db1e0 to 0x8db330 (336 bytes)\n; \n; 24 xrefs:\n; > EditorOptionsLayer::setupOptions @ 0x8db39c\n; > EditorOptionsLayer::setupOptions @ 0x8db3c8\n; > EditorOptionsLayer::setupOptions @ 0x8db3f8\n; > EditorOptionsLayer::setupOptions @ 0x8db420\n; > EditorOptionsLayer::setupOptions @ 0x8db440\n; > EditorOptionsLayer::setupOptions @ 0x8db460\n; > EditorOptionsLayer::setupOptions @ 0x8db480\n; > EditorOptionsLayer::setupOptions @ 0x8db4a0\n; > EditorOptionsLayer::setupOptions @ 0x8db4c0\n; > EditorOptionsLayer::setupOptions @ 0x8db4e0\n; > EditorOptionsLayer::setupOptions @ 0x8db508\n; > EditorOptionsLayer::setupOptions @ 0x8db528\n; > EditorOptionsLayer::setupOptions @ 0x8db548\n; > EditorOptionsLayer::setupOptions @ 0x8db568\n; > EditorOptionsLayer::setupOptions @ 0x8db588\n; > EditorOptionsLayer::setupOptions @ 0x8db5a8\n; > EditorOptionsLayer::setupOptions @ 0x8db5c8\n; > EditorOptionsLayer::setupOptions @ 0x8db5e8\n; > EditorOptionsLayer::setupOptions @ 0x8db608\n; > EditorOptionsLayer::setupOptions @ 0x8db628\n; > EditorOptionsLayer::setupOptions @ 0x8db648\n; > EditorOptionsLayer::setupOptions @ 0x8db668\n; > EditorOptionsLayer::setupOptions @ 0x8db688\n; > <???> @ 0x6bb80\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\nSTP             X29, X30, [SP,#var_70]!                                ; +0x0, 0x8db1e0\nMOV             X29, SP                                                ; +0x4, 0x8db1e4\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0x8db1e8\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x8db1ec\nADD             X20, X29, #0x70+var_10                                 ; +0x10, 0x8db1f0\nSTP             X23, X24, [SP,#0x70+var_40]                            ; +0x14, 0x8db1f4\nMOV             X24, X1                                                ; +0x18, 0x8db1f8\nMOV             X23, X0                                                ; +0x1c, 0x8db1fc\nLDR             X1, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x8db200\nMOV             X0, X2; char *                                         ; +0x24, 0x8db204\nSTR             X3, [X29,#0x70+var_28]                                 ; +0x28, 0x8db208\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x2c, 0x8db20c\nLDR             X1, [X1]                                               ; +0x30, 0x8db210\nMOV             X21, X2                                                ; +0x34, 0x8db214\nSTR             X1, [X29,#0x70+var_8]                                  ; +0x38, 0x8db218\nBL              .atoi                                                  ; +0x3c, 0x8db21c\nMOV             W22, W0                                                ; +0x40, 0x8db220\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x44, 0x8db224\nMOV             X1, X21; char *                                        ; +0x48, 0x8db228\nBL              _ZN11GameManager15getGameVariableEPKc; GameManager::getGameVariable(char const*) ; +0x4c, 0x8db22c\nMOV             W3, W0; bool                                           ; +0x50, 0x8db230\nLDR             X4, [X29,#0x70+var_28]; char *                         ; +0x54, 0x8db234\nMOV             X1, X24; char *                                        ; +0x58, 0x8db238\nMOV             W2, W22; int                                           ; +0x5c, 0x8db23c\nMOV             X0, X23; this                                          ; +0x60, 0x8db240\nBL              _ZN14GJOptionsLayer17addToggleInternalEPKcibS1_; GJOptionsLayer::addToggleInternal(char const*,int,bool,char const*) ; +0x64, 0x8db244\nMOV             X24, X0                                                ; +0x68, 0x8db248\nMOV             X1, X21; char *                                        ; +0x6c, 0x8db24c\nMOV             X0, X20; int                                           ; +0x70, 0x8db250\nADD             X2, X29, #0x70+var_20                                  ; +0x74, 0x8db254\nLDR             X21, [X23,#0x3E8]                                      ; +0x78, 0x8db258\nBL              sub_D153B8                                             ; +0x7c, 0x8db25c\nMOV             X0, X20                                                ; +0x80, 0x8db260\nBL              _ZN7cocos2d8CCString6createERKSs; cocos2d::CCString::create(std::string const&) ; +0x84, 0x8db264\nMOV             X1, X0; cocos2d::CCObject *                            ; +0x88, 0x8db268\nSXTW            X2, W22; __int64                                       ; +0x8c, 0x8db26c\nMOV             X0, X21; this                                          ; +0x90, 0x8db270\nBL              _ZN7cocos2d12CCDictionary9setObjectEPNS_8CCObjectEl; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,long) ; +0x94, 0x8db274\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x98, 0x8db278\nLDR             X2, [X29,#0x70+var_10]                                 ; +0x9c, 0x8db27c\nSUB             X0, X2, #0x18; p                                       ; +0xa0, 0x8db280\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xa4, 0x8db284\nCMP             X0, X1                                                 ; +0xa8, 0x8db288\nB.NE            loc_8DB2BC                                             ; +0xac, 0x8db28c\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xb0, 0x8db290\nMOV             X0, X24                                                ; +0xb4, 0x8db294\nLDR             X2, [X29,#0x70+var_8]                                  ; +0xb8, 0x8db298\nLDR             X1, [X19]                                              ; +0xbc, 0x8db29c\nCMP             X2, X1                                                 ; +0xc0, 0x8db2a0\nB.NE            loc_8DB300                                             ; +0xc4, 0x8db2a4\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0xc8, 0x8db2a8\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0xcc, 0x8db2ac\nLDP             X23, X24, [SP,#0x70+var_40]                            ; +0xd0, 0x8db2b0\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0xd4, 0x8db2b4\nRET                                                                    ; +0xd8, 0x8db2b8\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0xdc, 0x8db2bc\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xe0, 0x8db2c0\nCBZ             X1, loc_8DB2F0                                         ; +0xe4, 0x8db2c4\nSUB             X2, X2, #8                                             ; +0xe8, 0x8db2c8\nLDAXR           W1, [X2]                                               ; +0xec, 0x8db2cc\nSUB             W3, W1, #1                                             ; +0xf0, 0x8db2d0\nSTLXR           W4, W3, [X2]                                           ; +0xf4, 0x8db2d4\nCBNZ            W4, loc_8DB2CC                                         ; +0xf8, 0x8db2d8\nCMP             W1, WZR                                                ; +0xfc, 0x8db2dc\nB.GT            loc_8DB290                                             ; +0x100, 0x8db2e0\nADD             X1, X29, #0x70+var_18                                  ; +0x104, 0x8db2e4\nBL              j__ZdlPv; operator delete(void *)                      ; +0x108, 0x8db2e8\nB               loc_8DB290                                             ; +0x10c, 0x8db2ec\nLDUR            W1, [X2,#-8]                                           ; +0x110, 0x8db2f0\nSUB             W3, W1, #1                                             ; +0x114, 0x8db2f4\nSTUR            W3, [X2,#-8]                                           ; +0x118, 0x8db2f8\nB               loc_8DB2DC                                             ; +0x11c, 0x8db2fc\nBL              .__stack_chk_fail                                      ; +0x120, 0x8db300\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x124, 0x8db304\nMOV             X19, X0                                                ; +0x128, 0x8db308\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x12c, 0x8db30c\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x130, 0x8db310\nSUB             X0, X0, #0x18                                          ; +0x134, 0x8db314\nCMP             X0, X1                                                 ; +0x138, 0x8db318\nB.EQ            loc_8DB328                                             ; +0x13c, 0x8db31c\nADD             X1, X29, #0x70+var_18                                  ; +0x140, 0x8db320\nBL              sub_4DC698                                             ; +0x144, 0x8db324\nMOV             X0, X19                                                ; +0x148, 0x8db328\nBL              _Unwind_Resume                                         ; +0x14c, 0x8db32c", "xrefs": ["EditorOptionsLayer::setupOptions @ 0x8db39c", "EditorOptionsLayer::setupOptions @ 0x8db3c8", "EditorOptionsLayer::setupOptions @ 0x8db3f8", "EditorOptionsLayer::setupOptions @ 0x8db420", "EditorOptionsLayer::setupOptions @ 0x8db440", "EditorOptionsLayer::setupOptions @ 0x8db460", "EditorOptionsLayer::setupOptions @ 0x8db480", "EditorOptionsLayer::setupOptions @ 0x8db4a0", "EditorOptionsLayer::setupOptions @ 0x8db4c0", "EditorOptionsLayer::setupOptions @ 0x8db4e0", "EditorOptionsLayer::setupOptions @ 0x8db508", "EditorOptionsLayer::setupOptions @ 0x8db528", "EditorOptionsLayer::setupOptions @ 0x8db548", "EditorOptionsLayer::setupOptions @ 0x8db568", "EditorOptionsLayer::setupOptions @ 0x8db588", "EditorOptionsLayer::setupOptions @ 0x8db5a8", "EditorOptionsLayer::setupOptions @ 0x8db5c8", "EditorOptionsLayer::setupOptions @ 0x8db5e8", "EditorOptionsLayer::setupOptions @ 0x8db608", "EditorOptionsLayer::setupOptions @ 0x8db628", "EditorOptionsLayer::setupOptions @ 0x8db648", "EditorOptionsLayer::setupOptions @ 0x8db668", "EditorOptionsLayer::setupOptions @ 0x8db688", "<???> @ 0x6bb80"], "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"}