{"type": "func", "start": 5373226576, "end": 5373227200, "name": "KeybindCapturePopup::keyDown", "pseudocode": "// \n// KeybindCapturePopup::keyDown from 0x14044ee50 to 0x14044f0c0 (624 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x140794018\n// > <???> @ 0x1408cc5d4\n// > <???> @ 0x1408cc5e4\n// > <???> @ 0x140927668\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:32:26 +0000\n// \n\nchar __fastcall KeybindCapturePopup::keyDown(__int64 a1, int a2)\n{\n  unsigned __int16 v2; // di\n  char result; // al\n  __int64 v5; // rax\n  char v6; // si\n  __int64 v7; // rcx\n  __int64 v8; // rax\n  char v9; // bp\n  __int64 v10; // rcx\n  __int64 v11; // rax\n  __int64 v12; // rax\n  int v13; // edx\n  __int64 v14; // r8\n  int v15; // eax\n  int v16; // ecx\n  int v17; // edi\n  int *v18; // rax\n  __int64 v19; // rax\n  __int64 v20; // rcx\n  void *v21; // rdx\n  bool v22; // bp\n  void (__fastcall ***v23)(_QWORD, void *, __int64); // rcx\n  __int64 v24; // rdx\n  __int64 v25; // rcx\n  int v26; // eax\n  __int64 v27; // rcx\n\n  v2 = a2;\n  result = a2 - 16;\n  switch ( a2 )\n  {\n    case 16:\n    case 17:\n    case 18:\n    case 160:\n    case 161:\n    case 162:\n    case 163:\n      return result;\n    case 27:\n      result = (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)(a1 - 344) + 1104LL))(a1 - 344, 0);\n      break;\n    default:\n      v5 = cocos2d::CCDirector::sharedDirector(a1);\n      v6 = *(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 176LL))(v5) + 153);\n      v8 = cocos2d::CCDirector::sharedDirector(v7);\n      v9 = *(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 176LL))(v8) + 154);\n      v11 = cocos2d::CCDirector::sharedDirector(v10);\n      v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 176LL))(v11);\n      v13 = v2;\n      v14 = *(unsigned __int8 *)(v12 + 152);\n      if ( (unsigned int)v2 - 1001 > 0x2B )\n      {\n        v15 = v2 | 0x10000;\n        if ( !v6 )\n          v15 = v2;\n        v16 = v15 | 0x20000;\n        if ( !v9 )\n          v16 = v15;\n        v13 = v16 | 0x40000;\n        if ( !(_BYTE)v14 )\n          v13 = v16;\n      }\n      v17 = (unsigned __int16)v13;\n      if ( !*(_BYTE *)(a1 + 695)\n        || (result = (unsigned int)(unsigned __int16)v13 - 1001 <= 0x2B, result == *(_BYTE *)(a1 + 694)) )\n      {\n        v18 = (int *)(a1 + 688);\n        if ( *(_BYTE *)(a1 + 693) && v13 == *v18 )\n        {\n          result = KeybindCapturePopup::onSet(a1 - 344);\n        }\n        else\n        {\n          *v18 = v13;\n          v19 = *(_QWORD *)(a1 + 712);\n          *(_BYTE *)(a1 + 693) = 0;\n          if ( v19 )\n          {\n            v20 = *(_QWORD *)(v19 + 344);\n            v21 = &unk_140703BF0;\n            v22 = (v17 & 1) == 0;\n            *(_BYTE *)(v19 + 328) = v22;\n            v23 = (void (__fastcall ***)(_QWORD, void *, __int64))(v20 + 320);\n            if ( (v17 & 1) == 0 )\n              v21 = &unk_140703BD4;\n            (**v23)(v23, v21, v14);\n            v25 = *(_QWORD *)(a1 + 712);\n            v26 = v17 - 1;\n            if ( (v17 & 1) != 0 )\n              v26 = v17;\n            *(_DWORD *)(v25 + 332) = v26;\n            ControllerInputNode::refreshVisuals(v25, v24);\n            v27 = *(_QWORD *)(a1 + 720);\n            if ( v27 )\n              CCMenuItemToggler::toggle(v27, v22);\n          }\n          result = KeybindCapturePopup::updateChordDisplay(a1 - 344);\n        }\n      }\n      break;\n  }\n  return result;\n}", "assembly": "; \n; KeybindCapturePopup::keyDown from 0x14044ee50 to 0x14044f0c0 (624 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x140794018\n; > <???> @ 0x1408cc5d4\n; > <???> @ 0x1408cc5e4\n; > <???> @ 0x140927668\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:32:26 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x14044ee50\npush    rdi                                                            ; +0x5, 0x14044ee55\nsub     rsp, 20h                                                       ; +0x6, 0x14044ee56\nlea     eax, [rdx-10h]; switch 148 cases                               ; +0xa, 0x14044ee5a\nmov     edi, edx                                                       ; +0xd, 0x14044ee5d\nmov     rbx, rcx                                                       ; +0xf, 0x14044ee5f\ncmp     eax, 93h                                                       ; +0x12, 0x14044ee62\nja      short def_14044EE85; jumptable 000000014044EE85 default case, cases 19-26,28-159 ; +0x17, 0x14044ee67\nlea     rcx, cs:140000000h                                             ; +0x19, 0x14044ee69\ncdqe                                                                   ; +0x20, 0x14044ee70\nmovzx   eax, ds:(byte_14044F02C - 140000000h)[rcx+rax]                 ; +0x22, 0x14044ee72\nmov     r8d, ds:(jpt_14044EE85 - 140000000h)[rcx+rax*4]                ; +0x2a, 0x14044ee7a\nadd     r8, rcx                                                        ; +0x32, 0x14044ee82\njmp     r8; switch jump                                                ; +0x35, 0x14044ee85\nlea     rcx, [rbx-158h]; jumptable 000000014044EE85 case 27            ; +0x38, 0x14044ee88\nxor     edx, edx                                                       ; +0x3f, 0x14044ee8f\nmov     rax, [rcx]                                                     ; +0x41, 0x14044ee91\nmov     rbx, [rsp+28h+arg_10]                                          ; +0x44, 0x14044ee94\nadd     rsp, 20h                                                       ; +0x49, 0x14044ee99\npop     rdi                                                            ; +0x4d, 0x14044ee9d\njmp     qword ptr [rax+450h]                                           ; +0x4e, 0x14044ee9e\nmov     [rsp+28h+arg_0], rbp; jumptable 000000014044EE85 default case, cases 19-26,28-159 ; +0x55, 0x14044eea5\nmov     [rsp+28h+arg_8], rsi                                           ; +0x5a, 0x14044eeaa\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x5f, 0x14044eeaf\nmov     rcx, [rax]                                                     ; +0x65, 0x14044eeb5\nmov     rdx, [rcx+0B0h]                                                ; +0x68, 0x14044eeb8\nmov     rcx, rax                                                       ; +0x6f, 0x14044eebf\ncall    rdx                                                            ; +0x72, 0x14044eec2\nmovzx   esi, byte ptr [rax+99h]                                        ; +0x74, 0x14044eec4\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x7b, 0x14044eecb\nmov     rcx, [rax]                                                     ; +0x81, 0x14044eed1\nmov     rdx, [rcx+0B0h]                                                ; +0x84, 0x14044eed4\nmov     rcx, rax                                                       ; +0x8b, 0x14044eedb\ncall    rdx                                                            ; +0x8e, 0x14044eede\nmovzx   ebp, byte ptr [rax+9Ah]                                        ; +0x90, 0x14044eee0\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x97, 0x14044eee7\nmov     rcx, [rax]                                                     ; +0x9d, 0x14044eeed\nmov     rdx, [rcx+0B0h]                                                ; +0xa0, 0x14044eef0\nmov     rcx, rax                                                       ; +0xa7, 0x14044eef7\ncall    rdx                                                            ; +0xaa, 0x14044eefa\nmovzx   edx, di                                                        ; +0xac, 0x14044eefc\nmovzx   r8d, byte ptr [rax+98h]                                        ; +0xaf, 0x14044eeff\nlea     eax, [rdx-3E9h]                                                ; +0xb7, 0x14044ef07\ncmp     eax, 2Bh ; '+'                                                 ; +0xbd, 0x14044ef0d\njbe     short loc_14044EF36                                            ; +0xc0, 0x14044ef10\nmov     eax, edx                                                       ; +0xc2, 0x14044ef12\nbts     eax, 10h                                                       ; +0xc4, 0x14044ef14\ntest    sil, sil                                                       ; +0xc8, 0x14044ef18\ncmovz   eax, edx                                                       ; +0xcb, 0x14044ef1b\nmov     ecx, eax                                                       ; +0xce, 0x14044ef1e\nbts     ecx, 11h                                                       ; +0xd0, 0x14044ef20\ntest    bpl, bpl                                                       ; +0xd4, 0x14044ef24\ncmovz   ecx, eax                                                       ; +0xd7, 0x14044ef27\nmov     edx, ecx                                                       ; +0xda, 0x14044ef2a\nbts     edx, 12h                                                       ; +0xdc, 0x14044ef2c\ntest    r8b, r8b                                                       ; +0xe0, 0x14044ef30\ncmovz   edx, ecx                                                       ; +0xe3, 0x14044ef33\ncmp     byte ptr [rbx+2B7h], 0                                         ; +0xe6, 0x14044ef36\nmovzx   edi, dx                                                        ; +0xed, 0x14044ef3d\njz      short loc_14044EF5A                                            ; +0xf0, 0x14044ef40\nlea     eax, [rdi-3E9h]                                                ; +0xf2, 0x14044ef42\ncmp     eax, 2Bh ; '+'                                                 ; +0xf8, 0x14044ef48\nsetbe   al                                                             ; +0xfb, 0x14044ef4b\ncmp     al, [rbx+2B6h]                                                 ; +0xfe, 0x14044ef4e\njnz     loc_14044F009                                                  ; +0x104, 0x14044ef54\ncmp     byte ptr [rbx+2B5h], 0                                         ; +0x10a, 0x14044ef5a\nlea     rax, [rbx+2B0h]                                                ; +0x111, 0x14044ef61\njz      short loc_14044EF81                                            ; +0x118, 0x14044ef68\ncmp     edx, [rax]                                                     ; +0x11a, 0x14044ef6a\njnz     short loc_14044EF81                                            ; +0x11c, 0x14044ef6c\nxor     edx, edx                                                       ; +0x11e, 0x14044ef6e\nlea     rcx, [rbx-158h]                                                ; +0x120, 0x14044ef70\ncall    KeybindCapturePopup__onSet                                     ; +0x127, 0x14044ef77\njmp     loc_14044F009                                                  ; +0x12c, 0x14044ef7c\nmov     [rax], edx                                                     ; +0x131, 0x14044ef81\nmov     rax, [rbx+2C8h]                                                ; +0x133, 0x14044ef83\nmov     byte ptr [rbx+2B5h], 0                                         ; +0x13a, 0x14044ef8a\ntest    rax, rax                                                       ; +0x141, 0x14044ef91\njz      short loc_14044EFFD                                            ; +0x144, 0x14044ef94\nmov     rcx, [rax+158h]                                                ; +0x146, 0x14044ef96\nlea     rdx, unk_140703BF0                                             ; +0x14d, 0x14044ef9d\nmovzx   ebp, dil                                                       ; +0x154, 0x14044efa4\nnot     bpl                                                            ; +0x158, 0x14044efa8\nand     bpl, 1                                                         ; +0x15b, 0x14044efab\nmov     [rax+148h], bpl                                                ; +0x15f, 0x14044efaf\nlea     rcx, [rcx+140h]                                                ; +0x166, 0x14044efb6\nlea     rax, unk_140703BD4                                             ; +0x16d, 0x14044efbd\ncmovnz  rdx, rax                                                       ; +0x174, 0x14044efc4\nmov     rax, [rcx]                                                     ; +0x178, 0x14044efc8\ncall    qword ptr [rax]                                                ; +0x17b, 0x14044efcb\nmov     rcx, [rbx+2C8h]                                                ; +0x17d, 0x14044efcd\nlea     eax, [rdi-1]                                                   ; +0x184, 0x14044efd4\ntest    bpl, bpl                                                       ; +0x187, 0x14044efd7\ncmovz   eax, edi                                                       ; +0x18a, 0x14044efda\nmov     [rcx+14Ch], eax                                                ; +0x18d, 0x14044efdd\ncall    ControllerInputNode__refreshVisuals                            ; +0x193, 0x14044efe3\nmov     rcx, [rbx+2D0h]                                                ; +0x198, 0x14044efe8\ntest    rcx, rcx                                                       ; +0x19f, 0x14044efef\njz      short loc_14044EFFD                                            ; +0x1a2, 0x14044eff2\nmovzx   edx, bpl                                                       ; +0x1a4, 0x14044eff4\ncall    CCMenuItemToggler__toggle                                      ; +0x1a8, 0x14044eff8\nlea     rcx, [rbx-158h]                                                ; +0x1ad, 0x14044effd\ncall    KeybindCapturePopup__updateChordDisplay                        ; +0x1b4, 0x14044f004\nmov     rbp, [rsp+28h+arg_0]                                           ; +0x1b9, 0x14044f009\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x1be, 0x14044f00e\nmov     rbx, [rsp+28h+arg_10]; jumptable 000000014044EE85 cases 16-18,160-163 ; +0x1c3, 0x14044f013\nadd     rsp, 20h                                                       ; +0x1c8, 0x14044f018\npop     rdi                                                            ; +0x1cc, 0x14044f01c\nretn                                                                   ; +0x1cd, 0x14044f01d\nalign 20h                                                              ; +0x1ce, 0x14044f01e\ndd offset loc_14044F013 - 140000000h; jump table for switch statement  ; +0x1d0, 0x14044f020\ndb      0,     0,     0,     2; indirect table for switch statement    ; +0x1dc, 0x14044f02c", "xrefs": ["<???> @ 0x140794018", "<???> @ 0x1408cc5d4", "<???> @ 0x1408cc5e4", "<???> @ 0x140927668"], "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"}