{"type": "func", "start": 4301271712, "end": 4301272101, "name": "GameSettingsLayer::onCustomButton", "pseudocode": "// \n// GameSettingsLayer::onCustomButton from 0x1006032a0 to 0x100603425 (389 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x100b7f4d0\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:34:31 +0000\n// \n\nvoid __fastcall GameSettingsLayer::onCustomButton(__int64 a1, __int64 a2)\n{\n  int v2; // eax\n  _QWORD *v3; // r14\n  __int64 v4; // rax\n  __int64 v5; // rax\n  __int64 v6; // rax\n  __int128 v7; // [rsp+8h] [rbp-28h] BYREF\n  void *__p; // [rsp+18h] [rbp-18h]\n\n  v2 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);\n  if ( v2 == -1004 )\n  {\n    v6 = sub_1008B3FB0();\nLABEL_11:\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 1312LL))(v6);\n    return;\n  }\n  if ( v2 != -1003 )\n  {\n    if ( v2 == -1001 )\n    {\n      v3 = (_QWORD *)GJSongBrowser::create();\n      v3[74] = a1 + 1088;\n      v4 = cocos2d::CCDirector::sharedDirector();\n      (*(void (__fastcall **)(_QWORD, _QWORD *, __int64))(**(_QWORD **)(v4 + 272) + 464LL))(\n        *(_QWORD *)(v4 + 272),\n        v3,\n        106);\n      (*(void (__fastcall **)(_QWORD *, _QWORD))(*v3 + 1328LL))(v3, 0);\n    }\n    return;\n  }\n  if ( *(_BYTE *)(GJKeybindManager::sharedState(a2) + 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    v6 = KeybindingsLayer::create(a1);\n    goto LABEL_11;\n  }\n  __p = operator new(0x58u);\n  *(_QWORD *)&v7 = 89;\n  *((_QWORD *)&v7 + 1) = 87;\n  strcpy((char *)__p, \"You cannot edit <cy>Global Controls</c> while <cg>Custom Level Controls</c> are active.\");\n  v5 = sub_100493AB0(0, (__int64)\"Keybinds\", &v7, (__int64)\"OK\", 0);\n  (*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 1312LL))(v5);\n  if ( (v7 & 1) != 0 )\n    operator delete(__p);\n}", "assembly": "; \n; GameSettingsLayer::onCustomButton from 0x1006032a0 to 0x100603425 (389 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x100b7f4d0\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:34:31 +0000\n; \npush    rbp                                                            ; +0x0, 0x1006032a0\nmov     rbp, rsp                                                       ; +0x1, 0x1006032a1\npush    r14                                                            ; +0x4, 0x1006032a4\npush    rbx                                                            ; +0x6, 0x1006032a6\nsub     rsp, 20h                                                       ; +0x7, 0x1006032a7\nmov     rbx, rdi                                                       ; +0xb, 0x1006032ab\nmov     rax, [rsi]                                                     ; +0xe, 0x1006032ae\nmov     rdi, rsi                                                       ; +0x11, 0x1006032b1\ncall    qword ptr [rax+40h]                                            ; +0x14, 0x1006032b4\ncmp     eax, 0FFFFFC14h                                                ; +0x17, 0x1006032b7\njz      loc_1006033D8                                                  ; +0x1c, 0x1006032bc\ncmp     eax, 0FFFFFC15h                                                ; +0x22, 0x1006032c2\njz      short loc_100603320                                            ; +0x27, 0x1006032c7\ncmp     eax, 0FFFFFC17h                                                ; +0x29, 0x1006032c9\njnz     loc_1006033CF                                                  ; +0x2e, 0x1006032ce\ncall    GJSongBrowser__create                                          ; +0x34, 0x1006032d4\nmov     r14, rax                                                       ; +0x39, 0x1006032d9\nadd     rbx, 440h                                                      ; +0x3c, 0x1006032dc\nmov     [rax+250h], rbx                                                ; +0x43, 0x1006032e3\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x4a, 0x1006032ea\nmov     rdi, [rax+110h]                                                ; +0x4f, 0x1006032ef\nmov     rax, [rdi]                                                     ; +0x56, 0x1006032f6\nmov     rsi, r14                                                       ; +0x59, 0x1006032f9\nmov     edx, 6Ah ; 'j'                                                 ; +0x5c, 0x1006032fc\ncall    qword ptr [rax+1D0h]                                           ; +0x61, 0x100603301\nmov     rax, [r14]                                                     ; +0x67, 0x100603307\nmov     rax, [rax+530h]                                                ; +0x6a, 0x10060330a\nmov     rdi, r14                                                       ; +0x71, 0x100603311\nxor     esi, esi                                                       ; +0x74, 0x100603314\nadd     rsp, 20h                                                       ; +0x76, 0x100603316\npop     rbx                                                            ; +0x7a, 0x10060331a\npop     r14                                                            ; +0x7b, 0x10060331b\npop     rbp                                                            ; +0x7d, 0x10060331d\njmp     rax                                                            ; +0x7e, 0x10060331e\ncall    GJKeybindManager__sharedState                                  ; +0x80, 0x100603320\ncmp     byte ptr [rax+0B8h], 1                                         ; +0x85, 0x100603325\njnz     loc_1006033DF                                                  ; +0x8c, 0x10060332c\nmov     edi, 58h ; 'X'; __sz                                           ; +0x92, 0x100603332\ncall    __Znwm; operator new(ulong)                                    ; +0x97, 0x100603337\nmov     [rbp+__p], rax                                                 ; +0x9c, 0x10060333c\nmov     [rbp+var_28], 59h ; 'Y'                                        ; +0xa0, 0x100603340\nmov     [rbp+var_20], 57h ; 'W'                                        ; +0xa8, 0x100603348\nmov     rcx, 2E65766974636120h                                         ; +0xb0, 0x100603350\nmov     [rax+4Fh], rcx                                                 ; +0xba, 0x10060335a\nmovups  xmm0, xmmword ptr cs:aYouCannotEditC+40h; \"ontrols</c> are active.\" ; +0xbe, 0x10060335e\nmovups  xmmword ptr [rax+40h], xmm0                                    ; +0xc5, 0x100603365\nmovups  xmm0, xmmword ptr cs:aYouCannotEditC+30h; \"g>Custom Level Controls</c> are active.\" ; +0xc9, 0x100603369\nmovups  xmmword ptr [rax+30h], xmm0                                    ; +0xd0, 0x100603370\nmovups  xmm0, xmmword ptr cs:aYouCannotEditC+20h; \"ols</c> while <cg>Custom Level Controls\"... ; +0xd4, 0x100603374\nmovups  xmmword ptr [rax+20h], xmm0                                    ; +0xdb, 0x10060337b\nmovups  xmm0, xmmword ptr cs:aYouCannotEditC+10h; \"<cy>Global Controls</c> while <cg>Custo\"... ; +0xdf, 0x10060337f\nmovups  xmmword ptr [rax+10h], xmm0                                    ; +0xe6, 0x100603386\nmovups  xmm0, xmmword ptr cs:aYouCannotEditC; \"You cannot edit <cy>Global Controls</c>\"... ; +0xea, 0x10060338a\nmovups  xmmword ptr [rax], xmm0                                        ; +0xf1, 0x100603391\nmov     byte ptr [rax+57h], 0                                          ; +0xf4, 0x100603394\nlea     rsi, aKeybinds; \"Keybinds\"                                     ; +0xf8, 0x100603398\nlea     rcx, aOk; \"OK\"                                                 ; +0xff, 0x10060339f\nlea     rdx, [rbp+var_28]                                              ; +0x106, 0x1006033a6\nxor     edi, edi                                                       ; +0x10a, 0x1006033aa\nxor     r8d, r8d                                                       ; +0x10c, 0x1006033ac\ncall    sub_100493AB0                                                  ; +0x10f, 0x1006033af\nmov     rcx, [rax]                                                     ; +0x114, 0x1006033b4\nmov     rdi, rax                                                       ; +0x117, 0x1006033b7\ncall    qword ptr [rcx+520h]                                           ; +0x11a, 0x1006033ba\ntest    byte ptr [rbp+var_28], 1                                       ; +0x120, 0x1006033c0\njz      short loc_1006033CF                                            ; +0x124, 0x1006033c4\nmov     rdi, [rbp+__p]; __p                                            ; +0x126, 0x1006033c6\ncall    __ZdlPv; operator delete(void *)                               ; +0x12a, 0x1006033ca\nadd     rsp, 20h                                                       ; +0x12f, 0x1006033cf\npop     rbx                                                            ; +0x133, 0x1006033d3\npop     r14                                                            ; +0x134, 0x1006033d4\npop     rbp                                                            ; +0x136, 0x1006033d6\nretn                                                                   ; +0x137, 0x1006033d7\ncall    sub_1008B3FB0                                                  ; +0x138, 0x1006033d8\njmp     short loc_100603411                                            ; +0x13d, 0x1006033dd\nmov     rax, [rbx]                                                     ; +0x13f, 0x1006033df\nmov     rdi, rbx                                                       ; +0x142, 0x1006033e2\nxor     esi, esi                                                       ; +0x145, 0x1006033e5\ncall    qword ptr [rax+158h]                                           ; +0x147, 0x1006033e7\nmov     rax, [rbx]                                                     ; +0x14d, 0x1006033ed\nmov     rdi, rbx                                                       ; +0x150, 0x1006033f0\nxor     esi, esi                                                       ; +0x153, 0x1006033f3\ncall    qword ptr [rax+3E8h]                                           ; +0x155, 0x1006033f5\nmov     rax, [rbx]                                                     ; +0x15b, 0x1006033fb\nmov     rdi, rbx                                                       ; +0x15e, 0x1006033fe\nxor     esi, esi                                                       ; +0x161, 0x100603401\ncall    qword ptr [rax+430h]                                           ; +0x163, 0x100603403\nmov     rdi, rbx                                                       ; +0x169, 0x100603409\ncall    KeybindingsLayer__create                                       ; +0x16c, 0x10060340c\nmov     rcx, [rax]                                                     ; +0x171, 0x100603411\nmov     rdi, rax                                                       ; +0x174, 0x100603414\nadd     rsp, 20h                                                       ; +0x177, 0x100603417\npop     rbx                                                            ; +0x17b, 0x10060341b\npop     r14                                                            ; +0x17c, 0x10060341c\npop     rbp                                                            ; +0x17e, 0x10060341e\njmp     qword ptr [rcx+520h]                                           ; +0x17f, 0x10060341f", "xrefs": ["<???> @ 0x100b7f4d0"], "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"}