Function at 0x140057a50
Capabilities:
Get keyboard layout

Disassembly:
mov qword [rsp + 0x20], rdi
push r12
push r14
push r15
sub rsp, 0x190
movsxd rax, dword [rcx]
movzx r12d, r9b
mov edi, r8d
mov r15, rdx
mov r14, rcx
cmp eax, 6
ja case.0x140057a8d.1
lea r9, [0x140000000]
mov eax, dword [r9 + rax*4 + 0x57ce8]
add rax, r9
jmp rax
lea rax, str.Timeout
jmp 0x140057ac0
lea rax, str.Match
jmp 0x140057ac0
mov qword [rsp + 0x1c0], rsi
mov rsi, r15
test r15, r15
jne 0x140057ad6
lea rax, str.EndKey
mov rsi, qword [rsp + 0x1c0]
mov rdi, qword [rsp + 0x1c8]
add rsp, 0x190
pop r15
pop r14
pop r12
ret
test r12b, r12b
je 0x140057aec
movups xmm0, xmmword [str.EndKey:]
lea rsi, [rdx + 0xe]
sub edi, 7
movups xmmword [rdx], xmm0
movzx eax, word [rcx + 0x68]
mov qword [rsp + 0x1b8], rbp
test ax, ax
je 0x140057b0b
xor ebp, ebp
mov word [rsi], ax
mov word [rsi + 2], bp
jmp 0x140057c9d
cmp byte [rcx + 0x6b], 0
mov qword [rsp + 0x1b0], rbx
je 0x140057bdb
xor edx, edx
lea rcx, [rsp + 0x90]
mov r8d, 0x100
call fcn.1400cc200
mov byte [rsp + 0xa0], 0x80
call qword [sym.imp.USER32.dll_GetForegroundWindow]
xor ebp, ebp
mov ebx, ebp
test rax, rax
je 0x140057b83
xor edx, edx
mov rcx, rax
call qword [sym.imp.USER32.dll_GetWindowThreadProcessId]
lea rdx, [rsp + 0x40]
mov dword [rsp + 0x40], 0x48
mov ecx, eax
mov ebx, eax
call qword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x140057b83
mov rcx, qword [rsp + 0x50]
test rcx, rcx
je 0x140057b83
xor edx, edx
call qword [sym.imp.USER32.dll_GetWindowThreadProcessId]
mov ebx, eax
mov ecx, ebx
call qword [sym.imp.USER32.dll_GetKeyboardLayout]
movzx ecx, byte [r14 + 0x65]
mov ebx, ebp
cmp dword [0x1401341f0], ebx
mov rdi, rax
setne bl
xor edx, edx
call fcn.140022f70
movzx ecx, byte [r14 + 0x65]
lea r8, [rsp + 0x90]
mov qword [rsp + 0x30], rdi
mov r9, rsi
movzx edx, ax
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x20], 2
call qword [sym.imp.USER32.dll_ToUnicodeEx]
movsxd rcx, eax
mov word [rsi + rcx*2], bp
jmp 0x140057c95
xor ebp, ebp
mov word [rsi], bp
cmp byte [rcx + 0x6a], bpl
je 0x140057c39
movzx edx, word [rcx + 0x66]
lea rax, [0x14012fc28]
mov ecx, ebp
lea r8, [0x14012fcf8]
nop word [rax + rax]
cmp word [rax], dx
je 0x140057c12
inc ecx
add rax, 0x10
cmp rax, r8
jl 0x140057c00
jmp 0x140057c39
movsxd rdx, ecx
mov rcx, rsi
add rdx, rdx
movsxd rbx, edi
mov rdx, qword [r9 + rdx*8 + 0x12fc20]
lea r8, [rbx - 1]
call fcn.1400de184
mov word [rsi + rbx*2 - 2], bp
cmp word [rsi], bp
jne 0x140057c77
test r12b, r12b
je 0x140057c44
cmp byte [r14 + 0x6a], bpl
jne 0x140057c5c
cmp byte [r14 + 0x6a], bpl
mov r8d, edi
movzx ecx, byte [r14 + 0x65]
mov rdx, rsi
sete r9b
call fcn.140021c80
cmp word [rsi], bp
jne 0x140057c77
movzx r9d, word [r14 + 0x66]
lea r8, str.sc_03X
mov edx, edi
mov rcx, rsi
call fcn.1400acf50
movzx ecx, word [rsi]
lea eax, [rcx - 0x61]
cmp ax, 0x19
ja 0x140057c95
cmp word [rsi + 2], bp
jne 0x140057c95
test r12b, r12b
je 0x140057c95
sub cx, 0x20
mov word [rsi], cx
mov rbx, qword [rsp + 0x1b0]
mov rbp, qword [rsp + 0x1b8]
lea rax, str.EndKey
test r12b, r12b
cmovne rax, r15
jmp 0x140057ab8
lea rax, [0x140113330]
jmp 0x140057ac0
lea rax, str.NewInput
jmp 0x140057ac0
lea rax, str.Stopped
jmp 0x140057ac0
lea rax, [0x1400fb87c]
jmp 0x140057ac0