{"type": "func", "start": 4296437772, "end": 4296438116, "name": "GameSettingsLayer::onCustomButton", "pseudocode": "// \n// GameSettingsLayer::onCustomButton from 0x10016700c to 0x100167164 (344 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x1008e3430\n// \n// This function is hookable on this platform (idp: arm, 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 10:59:48 +0000\n// \n\nvoid __fastcall GameSettingsLayer::onCustomButton(__int64 a1, __int64 a2)\n{\n  __int64 v3; // x0\n  _QWORD *v4; // x20\n  __int64 v5; // x0\n  __int64 v6; // x0\n  void *v7; // x0\n  void *__p[2]; // [xsp+8h] [xbp-28h] BYREF\n  char v9; // [xsp+1Fh] [xbp-11h]\n\n  v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);\n  if ( (_DWORD)v3 == -1004 )\n  {\n    v7 = (void *)sub_1004A9BA8();\nLABEL_11:\n    (*(void (__fastcall **)(void *))(*(_QWORD *)v7 + 1312LL))(v7);\n    return;\n  }\n  if ( (_DWORD)v3 != -1003 )\n  {\n    if ( (_DWORD)v3 == -1001 )\n    {\n      v4 = (_QWORD *)sub_100302C44();\n      v4[74] = a1 + 1088;\n      v5 = cocos2d::CCDirector::sharedDirector(v4);\n      (*(void (__fastcall **)(_QWORD, _QWORD *, __int64))(**(_QWORD **)(v5 + 272) + 464LL))(\n        *(_QWORD *)(v5 + 272),\n        v4,\n        106);\n      (*(void (__fastcall **)(_QWORD *, _QWORD))(*v4 + 1328LL))(v4, 0);\n    }\n    return;\n  }\n  if ( *(_BYTE *)(GJKeybindManager::sharedState(v3) + 184) != 1 )\n  {\n    (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 344LL))(a1, 0);\n    (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1000LL))(a1, 0);\n    (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1072LL))(a1, 0);\n    v7 = KeybindingsLayer::create(a1);\n    goto LABEL_11;\n  }\n  sub_100009900(__p, \"You cannot edit <cy>Global Controls</c> while <cg>Custom Level Controls</c> are active.\");\n  v6 = sub_10034A8F8(0, \"Keybinds\", __p, \"OK\", 0);\n  (*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 1312LL))(v6);\n  if ( v9 < 0 )\n    operator delete(__p[0]);\n}", "assembly": "; \n; GameSettingsLayer::onCustomButton from 0x10016700c to 0x100167164 (344 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x1008e3430\n; \n; This function is hookable on this platform (idp: arm, 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 10:59:48 +0000\n; \nSUB             SP, SP, #0x40                                          ; +0x0, 0x10016700c\nSTP             X20, X19, [SP,#0x30+var_10]                            ; +0x4, 0x100167010\nSTP             X29, X30, [SP,#0x30+var_s0]                            ; +0x8, 0x100167014\nADD             X29, SP, #0x30                                         ; +0xc, 0x100167018\nMOV             X19, X0                                                ; +0x10, 0x10016701c\nLDR             X8, [X1]                                               ; +0x14, 0x100167020\nLDR             X8, [X8,#0x40]                                         ; +0x18, 0x100167024\nMOV             X0, X1                                                 ; +0x1c, 0x100167028\nBLR             X8                                                     ; +0x20, 0x10016702c\nCMN             W0, #0x3EC                                             ; +0x24, 0x100167030\nB.EQ            loc_100167100                                          ; +0x28, 0x100167034\nCMN             W0, #0x3EB                                             ; +0x2c, 0x100167038\nB.EQ            loc_100167094                                          ; +0x30, 0x10016703c\nCMN             W0, #0x3E9                                             ; +0x34, 0x100167040\nB.NE            loc_1001670F0                                          ; +0x38, 0x100167044\nBL              sub_100302C44                                          ; +0x3c, 0x100167048\nMOV             X20, X0                                                ; +0x40, 0x10016704c\nADD             X8, X19, #0x440                                        ; +0x44, 0x100167050\nSTR             X8, [X0,#0x250]                                        ; +0x48, 0x100167054\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x4c, 0x100167058\nLDR             X0, [X0,#0x110]                                        ; +0x50, 0x10016705c\nLDR             X8, [X0]                                               ; +0x54, 0x100167060\nLDR             X8, [X8,#0x1D0]                                        ; +0x58, 0x100167064\nMOV             X1, X20                                                ; +0x5c, 0x100167068\nMOV             W2, #0x6A ; 'j'                                        ; +0x60, 0x10016706c\nBLR             X8                                                     ; +0x64, 0x100167070\nLDR             X8, [X20]                                              ; +0x68, 0x100167074\nLDR             X2, [X8,#0x530]                                        ; +0x6c, 0x100167078\nMOV             X0, X20                                                ; +0x70, 0x10016707c\nMOV             W1, #0                                                 ; +0x74, 0x100167080\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0x78, 0x100167084\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0x7c, 0x100167088\nADD             SP, SP, #0x40 ; '@'                                    ; +0x80, 0x10016708c\nBR              X2                                                     ; +0x84, 0x100167090\nBL              GJKeybindManager__sharedState                          ; +0x88, 0x100167094\nLDRB            W8, [X0,#0xB8]                                         ; +0x8c, 0x100167098\nCMP             W8, #1                                                 ; +0x90, 0x10016709c\nB.NE            loc_100167108                                          ; +0x94, 0x1001670a0\nADRL            X1, aYouCannotEditC; \"You cannot edit <cy>Global Controls</c>\"... ; +0x98, 0x1001670a4\nADD             X0, SP, #0x30+__p; int                                 ; +0xa0, 0x1001670ac\nBL              sub_100009900                                          ; +0xa4, 0x1001670b0\nADRL            X1, aKeybinds; \"Keybinds\"                              ; +0xa8, 0x1001670b4\nADRL            X3, aOk; \"OK\"                                          ; +0xb0, 0x1001670bc\nADD             X2, SP, #0x30+__p                                      ; +0xb8, 0x1001670c4\nMOV             X0, #0                                                 ; +0xbc, 0x1001670c8\nMOV             X4, #0                                                 ; +0xc0, 0x1001670cc\nBL              sub_10034A8F8                                          ; +0xc4, 0x1001670d0\nLDR             X8, [X0]                                               ; +0xc8, 0x1001670d4\nLDR             X8, [X8,#0x520]                                        ; +0xcc, 0x1001670d8\nBLR             X8                                                     ; +0xd0, 0x1001670dc\nLDRSB           W8, [SP,#0x30+var_11]                                  ; +0xd4, 0x1001670e0\nTBZ             W8, #0x1F, loc_1001670F0                               ; +0xd8, 0x1001670e4\nLDR             X0, [SP,#0x30+__p]; __p                                ; +0xdc, 0x1001670e8\nBL              __ZdlPv; operator delete(void *)                       ; +0xe0, 0x1001670ec\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0xe4, 0x1001670f0\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0xe8, 0x1001670f4\nADD             SP, SP, #0x40 ; '@'                                    ; +0xec, 0x1001670f8\nRET                                                                    ; +0xf0, 0x1001670fc\nBL              sub_1004A9BA8                                          ; +0xf4, 0x100167100\nB               loc_10016714C                                          ; +0xf8, 0x100167104\nLDR             X8, [X19]                                              ; +0xfc, 0x100167108\nLDR             X8, [X8,#0x158]                                        ; +0x100, 0x10016710c\nMOV             X0, X19                                                ; +0x104, 0x100167110\nMOV             W1, #0                                                 ; +0x108, 0x100167114\nBLR             X8                                                     ; +0x10c, 0x100167118\nLDR             X8, [X19]                                              ; +0x110, 0x10016711c\nLDR             X8, [X8,#0x3E8]                                        ; +0x114, 0x100167120\nMOV             X0, X19                                                ; +0x118, 0x100167124\nMOV             W1, #0                                                 ; +0x11c, 0x100167128\nBLR             X8                                                     ; +0x120, 0x10016712c\nLDR             X8, [X19]                                              ; +0x124, 0x100167130\nLDR             X8, [X8,#0x430]                                        ; +0x128, 0x100167134\nMOV             X0, X19                                                ; +0x12c, 0x100167138\nMOV             W1, #0                                                 ; +0x130, 0x10016713c\nBLR             X8                                                     ; +0x134, 0x100167140\nMOV             X0, X19                                                ; +0x138, 0x100167144\nBL              KeybindingsLayer__create                               ; +0x13c, 0x100167148\nLDR             X8, [X0]                                               ; +0x140, 0x10016714c\nLDR             X1, [X8,#0x520]                                        ; +0x144, 0x100167150\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0x148, 0x100167154\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0x14c, 0x100167158\nADD             SP, SP, #0x40 ; '@'                                    ; +0x150, 0x10016715c\nBR              X1                                                     ; +0x154, 0x100167160", "xrefs": ["<???> @ 0x1008e3430"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "arm", "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"}