{"type": "func", "start": 5371624144, "end": 5371624973, "name": "GameSettingsLayer::onCustomButton", "pseudocode": "// \n// GameSettingsLayer::onCustomButton from 0x1402c7ad0 to 0x1402c7e0d (829 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x140766250\n// > <???> @ 0x14091dc00\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 11:29:22 +0000\n// \n\n// Hidden C++ exception states: #wind=2\n__int64 __fastcall GameSettingsLayer::onCustomButton(__int64 a1, __int64 a2)\n{\n  __int64 result; // rax\n  __int64 v4; // rax\n  __int64 v5; // rbx\n  __int64 v6; // rcx\n  __int64 v7; // rax\n  __int64 v8; // rax\n  cocos2d::CCObject *v9; // rbx\n  __int64 (__fastcall *v10)(__int64); // rdx\n  __int64 v11; // rax\n  __int128 v12; // [rsp+50h] [rbp-48h] BYREF\n  __int64 v13; // [rsp+60h] [rbp-38h]\n  __int64 v14; // [rsp+68h] [rbp-30h]\n  _BYTE v15[32]; // [rsp+70h] [rbp-28h] BYREF\n\n  result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);\n  switch ( (_DWORD)result )\n  {\n    case 0xFFFFFC14:\n      v9 = (cocos2d::CCObject *)operator new(0x2C0u);\n      memset(v9, 0, 0x2C0u);\n      FLAlertLayer::FLAlertLayer((__int64)v9);\n      *(_QWORD *)v9 = &ClearPlatformerSavesPopup::`vftable';\n      *((_QWORD *)v9 + 40) = &ClearPlatformerSavesPopup::`vftable';\n      *((_QWORD *)v9 + 41) = &ClearPlatformerSavesPopup::`vftable';\n      *((_QWORD *)v9 + 42) = &ClearPlatformerSavesPopup::`vftable';\n      *((_QWORD *)v9 + 43) = &ClearPlatformerSavesPopup::`vftable';\n      *((_QWORD *)v9 + 44) = &ClearPlatformerSavesPopup::`vftable';\n      *((_QWORD *)v9 + 51) = &ClearPlatformerSavesPopup::`vftable';\n      *((_QWORD *)v9 + 54) = &ClearPlatformerSavesPopup::`vftable';\n      *((_QWORD *)v9 + 68) = &ClearPlatformerSavesPopup::`vftable';\n      *((_QWORD *)v9 + 83) = &ClearPlatformerSavesPopup::`vftable';\n      *((_BYTE *)v9 + 672) = 0;\n      *((_QWORD *)v9 + 85) = 0;\n      *((_QWORD *)v9 + 86) = 0;\n      *((_QWORD *)v9 + 87) = 0;\n      if ( ClearPlatformerSavesPopup::init((__int64)v9) )\n      {\n        cocos2d::CCObject::autorelease(v9);\n      }\n      else\n      {\n        (*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v9 + 8LL))(v9, 1);\n        v9 = nullptr;\n      }\n      v10 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 1064LL);\n      if ( v10 == FLAlertLayer::show )\n        return FLAlertLayer::show((__int64)v9);\n      return v10((__int64)v9);\n    case 0xFFFFFC15:\n      if ( !*(_BYTE *)(GJKeybindManager::sharedState() + 216) )\n      {\n        (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 336LL))(a1, 0);\n        (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 920LL))(a1, 0);\n        (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 992LL))(a1, 0);\n        v11 = KeybindingsLayer::create(a1);\n        return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 1064LL))(v11);\n      }\n      v12 = 0;\n      *(_QWORD *)&v12 = sub_14003D460(0x60u);\n      v13 = 87;\n      v14 = 95;\n      strcpy((char *)v12, \"You cannot edit <cy>Global Controls</c> while <cg>Custom Level Controls</c> are active.\");\n      v8 = sub_14003F4F0((__int64)v15, (__int64)&v12);\n      v9 = FLAlertLayer::create(0, (int)\"Keybinds\", v8, (__int64)\"OK\", 0, 1132068864, 0, 0, 1065353216);\n      sub_14003D310((__int64)&v12);\n      v10 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 1064LL);\n      return v10((__int64)v9);\n    case 0xFFFFFC17:\n      v4 = GJSongBrowser::create();\n      v5 = v4;\n      v6 = a1 + 1072;\n      if ( !a1 )\n        v6 = 0;\n      *(_QWORD *)(v4 + 592) = v6;\n      v7 = cocos2d::CCDirector::sharedDirector(v6);\n      (*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(v7 + 272) + 456LL))(\n        *(_QWORD *)(v7 + 272),\n        v5,\n        106);\n      return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v5 + 1080LL))(v5, 0);\n  }\n  return result;\n}", "assembly": "; \n; GameSettingsLayer::onCustomButton from 0x1402c7ad0 to 0x1402c7e0d (829 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x140766250\n; > <???> @ 0x14091dc00\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 11:29:22 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1402c7ad0\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1402c7ad5\npush    rdi                                                            ; +0xa, 0x1402c7ada\nsub     rsp, 90h                                                       ; +0xb, 0x1402c7adb\nmov     rdi, rcx                                                       ; +0x12, 0x1402c7ae2\nmov     rax, [rdx]                                                     ; +0x15, 0x1402c7ae5\nmov     rcx, rdx                                                       ; +0x18, 0x1402c7ae8\ncall    qword ptr [rax+38h]                                            ; +0x1b, 0x1402c7aeb\ncmp     eax, 0FFFFFC14h                                                ; +0x1e, 0x1402c7aee\njz      loc_1402C7CD7                                                  ; +0x23, 0x1402c7af3\ncmp     eax, 0FFFFFC15h                                                ; +0x29, 0x1402c7af9\njz      short loc_1402C7B60                                            ; +0x2e, 0x1402c7afe\ncmp     eax, 0FFFFFC17h                                                ; +0x30, 0x1402c7b00\njnz     loc_1402C7C81                                                  ; +0x35, 0x1402c7b05\ncall    GJSongBrowser__create                                          ; +0x3b, 0x1402c7b0b\nmov     rbx, rax                                                       ; +0x40, 0x1402c7b10\nlea     rcx, [rdi+430h]                                                ; +0x43, 0x1402c7b13\nxor     esi, esi                                                       ; +0x4a, 0x1402c7b1a\ntest    rdi, rdi                                                       ; +0x4c, 0x1402c7b1c\ncmovz   rcx, rsi                                                       ; +0x4f, 0x1402c7b1f\nmov     [rax+250h], rcx                                                ; +0x53, 0x1402c7b23\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x5a, 0x1402c7b2a\nmov     rcx, [rax+110h]                                                ; +0x60, 0x1402c7b30\nmov     rdx, [rcx]                                                     ; +0x67, 0x1402c7b37\nmov     r9, [rdx+1C8h]                                                 ; +0x6a, 0x1402c7b3a\nmov     r8d, 6Ah ; 'j'                                                 ; +0x71, 0x1402c7b41\nmov     rdx, rbx                                                       ; +0x77, 0x1402c7b47\ncall    r9                                                             ; +0x7a, 0x1402c7b4a\nmov     rax, [rbx]                                                     ; +0x7d, 0x1402c7b4d\nxor     edx, edx                                                       ; +0x80, 0x1402c7b50\nmov     rcx, rbx                                                       ; +0x82, 0x1402c7b52\ncall    qword ptr [rax+438h]                                           ; +0x85, 0x1402c7b55\njmp     loc_1402C7C81                                                  ; +0x8b, 0x1402c7b5b\ncall    GJKeybindManager__sharedState                                  ; +0x90, 0x1402c7b60\ncmp     byte ptr [rax+0D8h], 0                                         ; +0x95, 0x1402c7b65\njz      loc_1402C7C96                                                  ; +0x9c, 0x1402c7b6c\nxorps   xmm0, xmm0                                                     ; +0xa2, 0x1402c7b72\nmovups  [rsp+98h+var_48], xmm0                                         ; +0xa5, 0x1402c7b75\nxor     esi, esi                                                       ; +0xaa, 0x1402c7b7a\nmov     [rsp+98h+var_38], rsi                                          ; +0xac, 0x1402c7b7c\nmov     [rsp+98h+var_30], rsi                                          ; +0xb1, 0x1402c7b81\nmov     ecx, 60h ; '`'                                                 ; +0xb6, 0x1402c7b86\ncall    sub_14003D460                                                  ; +0xbb, 0x1402c7b8b\nmov     rcx, rax                                                       ; +0xc0, 0x1402c7b90\nmov     qword ptr [rsp+98h+var_48], rax                                ; +0xc3, 0x1402c7b93\nmov     [rsp+98h+var_38], 57h ; 'W'                                    ; +0xc8, 0x1402c7b98\nmov     [rsp+98h+var_30], 5Fh ; '_'                                    ; +0xd1, 0x1402c7ba1\nmovaps  xmm0, cs:xmmword_140765940                                     ; +0xda, 0x1402c7baa\nmovups  xmmword ptr [rax], xmm0                                        ; +0xe1, 0x1402c7bb1\nmovaps  xmm1, cs:xmmword_140765950                                     ; +0xe4, 0x1402c7bb4\nmovups  xmmword ptr [rax+10h], xmm1                                    ; +0xeb, 0x1402c7bbb\nmovaps  xmm0, cs:xmmword_140765960                                     ; +0xef, 0x1402c7bbf\nmovups  xmmword ptr [rax+20h], xmm0                                    ; +0xf6, 0x1402c7bc6\nmovaps  xmm1, cs:xmmword_140765970                                     ; +0xfa, 0x1402c7bca\nmovups  xmmword ptr [rax+30h], xmm1                                    ; +0x101, 0x1402c7bd1\nmovaps  xmm0, cs:xmmword_140765980                                     ; +0x105, 0x1402c7bd5\nmovups  xmmword ptr [rax+40h], xmm0                                    ; +0x10c, 0x1402c7bdc\nmov     eax, cs:dword_140765990                                        ; +0x110, 0x1402c7be0\nmov     [rcx+50h], eax                                                 ; +0x116, 0x1402c7be6\nmovzx   eax, cs:word_140765994                                         ; +0x119, 0x1402c7be9\nmov     [rcx+54h], ax                                                  ; +0x120, 0x1402c7bf0\nmovzx   eax, cs:byte_140765996                                         ; +0x124, 0x1402c7bf4\nmov     [rcx+56h], al                                                  ; +0x12b, 0x1402c7bfb\nmov     [rcx+57h], sil                                                 ; +0x12e, 0x1402c7bfe\nlea     rax, [rsp+98h+var_48]                                          ; +0x132, 0x1402c7c02\nmov     [rsp+98h+arg_8], rax                                           ; +0x137, 0x1402c7c07\nlea     rdx, [rsp+98h+var_48]                                          ; +0x13f, 0x1402c7c0f\nlea     rcx, [rsp+98h+var_28]                                          ; +0x144, 0x1402c7c14\ncall    sub_14003F4F0                                                  ; +0x149, 0x1402c7c19\nmovss   xmm0, cs:flt_140835080                                         ; +0x14e, 0x1402c7c1e\nmovss   [rsp+98h+var_58], xmm0                                         ; +0x156, 0x1402c7c26\nxorps   xmm1, xmm1                                                     ; +0x15c, 0x1402c7c2c\nmovss   [rsp+98h+var_60], xmm1                                         ; +0x15f, 0x1402c7c2f\nmov     [rsp+98h+var_68], sil                                          ; +0x165, 0x1402c7c35\nmovss   xmm0, cs:dword_14083595C                                       ; +0x16a, 0x1402c7c3a\nmovss   [rsp+98h+var_70], xmm0                                         ; +0x172, 0x1402c7c42\nmov     [rsp+98h+var_78], rsi                                          ; +0x178, 0x1402c7c48\nlea     r9, aOk; \"OK\"                                                  ; +0x17d, 0x1402c7c4d\nmov     r8, rax                                                        ; +0x184, 0x1402c7c54\nlea     rdx, aKeybinds; \"Keybinds\"                                     ; +0x187, 0x1402c7c57\nxor     ecx, ecx                                                       ; +0x18e, 0x1402c7c5e\ncall    FLAlertLayer__create                                           ; +0x190, 0x1402c7c60\nmov     rbx, rax                                                       ; +0x195, 0x1402c7c65\nlea     rcx, [rsp+98h+var_48]                                          ; +0x198, 0x1402c7c68\ncall    sub_14003D310                                                  ; +0x19d, 0x1402c7c6d\nmov     rcx, [rbx]                                                     ; +0x1a2, 0x1402c7c72\nmov     rdx, [rcx+428h]                                                ; +0x1a5, 0x1402c7c75\nmov     rcx, rbx                                                       ; +0x1ac, 0x1402c7c7c\ncall    rdx                                                            ; +0x1af, 0x1402c7c7f\nlea     r11, [rsp+98h+var_8]                                           ; +0x1b1, 0x1402c7c81\nmov     rbx, [r11+10h]                                                 ; +0x1b9, 0x1402c7c89\nmov     rsi, [r11+28h]                                                 ; +0x1bd, 0x1402c7c8d\nmov     rsp, r11                                                       ; +0x1c1, 0x1402c7c91\npop     rdi                                                            ; +0x1c4, 0x1402c7c94\nretn                                                                   ; +0x1c5, 0x1402c7c95\nmov     rax, [rdi]                                                     ; +0x1c6, 0x1402c7c96\nxor     edx, edx                                                       ; +0x1c9, 0x1402c7c99\nmov     rcx, rdi                                                       ; +0x1cb, 0x1402c7c9b\ncall    qword ptr [rax+150h]                                           ; +0x1ce, 0x1402c7c9e\nmov     rax, [rdi]                                                     ; +0x1d4, 0x1402c7ca4\nxor     edx, edx                                                       ; +0x1d7, 0x1402c7ca7\nmov     rcx, rdi                                                       ; +0x1d9, 0x1402c7ca9\ncall    qword ptr [rax+398h]                                           ; +0x1dc, 0x1402c7cac\nmov     rax, [rdi]                                                     ; +0x1e2, 0x1402c7cb2\nxor     edx, edx                                                       ; +0x1e5, 0x1402c7cb5\nmov     rcx, rdi                                                       ; +0x1e7, 0x1402c7cb7\ncall    qword ptr [rax+3E0h]                                           ; +0x1ea, 0x1402c7cba\nmov     rcx, rdi                                                       ; +0x1f0, 0x1402c7cc0\ncall    KeybindingsLayer__create                                       ; +0x1f3, 0x1402c7cc3\nmov     rcx, [rax]                                                     ; +0x1f8, 0x1402c7cc8\nmov     rdx, [rcx+428h]                                                ; +0x1fb, 0x1402c7ccb\nmov     rcx, rax                                                       ; +0x202, 0x1402c7cd2\njmp     short loc_1402C7C7F                                            ; +0x205, 0x1402c7cd5\nmov     ecx, 2C0h; Size                                                ; +0x207, 0x1402c7cd7\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x20c, 0x1402c7cdc\nmov     rbx, rax                                                       ; +0x211, 0x1402c7ce1\nmov     [rsp+98h+arg_8], rax                                           ; +0x214, 0x1402c7ce4\nxor     edx, edx; Val                                                  ; +0x21c, 0x1402c7cec\nmov     r8d, 2C0h; Size                                                ; +0x21e, 0x1402c7cee\nmov     rcx, rax; void *                                               ; +0x224, 0x1402c7cf4\ncall    memset                                                         ; +0x227, 0x1402c7cf7\nmov     rcx, rbx                                                       ; +0x22c, 0x1402c7cfc\ncall    FLAlertLayer__FLAlertLayer                                     ; +0x22f, 0x1402c7cff\nlea     rax, ??_7ClearPlatformerSavesPopup@@6B@; const ClearPlatformerSavesPopup::`vftable' ; +0x234, 0x1402c7d04\nmov     [rbx], rax                                                     ; +0x23b, 0x1402c7d0b\nlea     rax, ??_7ClearPlatformerSavesPopup@@6B@_0; const ClearPlatformerSavesPopup::`vftable' ; +0x23e, 0x1402c7d0e\nmov     [rbx+140h], rax                                                ; +0x245, 0x1402c7d15\nlea     rax, ??_7ClearPlatformerSavesPopup@@6B@_1; const ClearPlatformerSavesPopup::`vftable' ; +0x24c, 0x1402c7d1c\nmov     [rbx+148h], rax                                                ; +0x253, 0x1402c7d23\nlea     rax, ??_7ClearPlatformerSavesPopup@@6B@_2; const ClearPlatformerSavesPopup::`vftable' ; +0x25a, 0x1402c7d2a\nmov     [rbx+150h], rax                                                ; +0x261, 0x1402c7d31\nlea     rax, ??_7ClearPlatformerSavesPopup@@6B@_3; const ClearPlatformerSavesPopup::`vftable' ; +0x268, 0x1402c7d38\nmov     [rbx+158h], rax                                                ; +0x26f, 0x1402c7d3f\nlea     rax, ??_7ClearPlatformerSavesPopup@@6B@_4; const ClearPlatformerSavesPopup::`vftable' ; +0x276, 0x1402c7d46\nmov     [rbx+160h], rax                                                ; +0x27d, 0x1402c7d4d\nlea     rax, ??_7ClearPlatformerSavesPopup@@6B@_5; const ClearPlatformerSavesPopup::`vftable' ; +0x284, 0x1402c7d54\nmov     [rbx+198h], rax                                                ; +0x28b, 0x1402c7d5b\nlea     rax, ??_7ClearPlatformerSavesPopup@@6B@_6; const ClearPlatformerSavesPopup::`vftable' ; +0x292, 0x1402c7d62\nmov     [rbx+1B0h], rax                                                ; +0x299, 0x1402c7d69\nlea     rax, ??_7ClearPlatformerSavesPopup@@6B@_7; const ClearPlatformerSavesPopup::`vftable' ; +0x2a0, 0x1402c7d70\nmov     [rbx+220h], rax                                                ; +0x2a7, 0x1402c7d77\nlea     rax, ??_7ClearPlatformerSavesPopup@@6B@_8; const ClearPlatformerSavesPopup::`vftable' ; +0x2ae, 0x1402c7d7e\nmov     [rbx+298h], rax                                                ; +0x2b5, 0x1402c7d85\nmov     byte ptr [rbx+2A0h], 0                                         ; +0x2bc, 0x1402c7d8c\nxor     esi, esi                                                       ; +0x2c3, 0x1402c7d93\nmov     [rbx+2A8h], rsi                                                ; +0x2c5, 0x1402c7d95\nmov     [rbx+2B0h], rsi                                                ; +0x2cc, 0x1402c7d9c\nmov     [rbx+2B8h], rsi                                                ; +0x2d3, 0x1402c7da3\nmov     rax, cs:off_14071D7A8                                          ; +0x2da, 0x1402c7daa\nlea     rcx, ClearPlatformerSavesPopup__init                           ; +0x2e1, 0x1402c7db1\ncmp     rax, rcx                                                       ; +0x2e8, 0x1402c7db8\nmov     rcx, rbx                                                       ; +0x2eb, 0x1402c7dbb\njnz     short loc_1402C7DC7                                            ; +0x2ee, 0x1402c7dbe\ncall    ClearPlatformerSavesPopup__init                                ; +0x2f0, 0x1402c7dc0\njmp     short loc_1402C7DC9                                            ; +0x2f5, 0x1402c7dc5\ncall    rax ; ClearPlatformerSavesPopup__init                          ; +0x2f7, 0x1402c7dc7\nmov     rcx, rbx                                                       ; +0x2f9, 0x1402c7dc9\ntest    al, al                                                         ; +0x2fc, 0x1402c7dcc\njz      short loc_1402C7DD8                                            ; +0x2fe, 0x1402c7dce\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x300, 0x1402c7dd0\njmp     short loc_1402C7DE6                                            ; +0x306, 0x1402c7dd6\nmov     rax, [rbx]                                                     ; +0x308, 0x1402c7dd8\nmov     edx, 1                                                         ; +0x30b, 0x1402c7ddb\ncall    qword ptr [rax+8]                                              ; +0x310, 0x1402c7de0\nmov     rbx, rsi                                                       ; +0x313, 0x1402c7de3\nmov     rax, [rbx]                                                     ; +0x316, 0x1402c7de6\nmov     rdx, [rax+428h]                                                ; +0x319, 0x1402c7de9\nlea     rax, FLAlertLayer__show                                        ; +0x320, 0x1402c7df0\ncmp     rdx, rax                                                       ; +0x327, 0x1402c7df7\njnz     loc_1402C7C7C                                                  ; +0x32a, 0x1402c7dfa\nmov     rcx, rbx                                                       ; +0x330, 0x1402c7e00\ncall    FLAlertLayer__show                                             ; +0x333, 0x1402c7e03\njmp     loc_1402C7C81                                                  ; +0x338, 0x1402c7e08", "xrefs": ["<???> @ 0x140766250", "<???> @ 0x14091dc00"], "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"}