Function at 0x1400228c0
Capabilities:
Get keyboard layout

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x258
xor edi, edi
xor ecx, ecx
call sub.USER32.dll_GetKeyboardLayout
mov rsi, rax
xchg qword [0x1400665e8], rax
cmp rsi, rax
je 0x140022c05
xorps xmm0, xmm0
movaps xmmword [rsp + 0x60], xmm0
movaps xmmword [rsp + 0x140], xmm0
movaps xmmword [rsp + 0x130], xmm0
movaps xmmword [rsp + 0x120], xmm0
movaps xmmword [rsp + 0x110], xmm0
movaps xmmword [rsp + 0x100], xmm0
movaps xmmword [rsp + 0xf0], xmm0
movaps xmmword [rsp + 0xe0], xmm0
movaps xmmword [rsp + 0xd0], xmm0
movaps xmmword [rsp + 0xc0], xmm0
movaps xmmword [rsp + 0xb0], xmm0
movaps xmmword [rsp + 0xa0], xmm0
movaps xmmword [rsp + 0x90], xmm0
movaps xmmword [rsp + 0x80], xmm0
movaps xmmword [rsp + 0x70], xmm0
movaps xmmword [rsp + 0x50], xmm0
mov word [rsp + 0x61], 0x8080
movaps xmmword [rsp + 0x240], xmm0
movaps xmmword [rsp + 0x230], xmm0
movaps xmmword [rsp + 0x220], xmm0
movaps xmmword [rsp + 0x210], xmm0
movaps xmmword [rsp + 0x200], xmm0
movaps xmmword [rsp + 0x1f0], xmm0
movaps xmmword [rsp + 0x1e0], xmm0
movaps xmmword [rsp + 0x1d0], xmm0
movaps xmmword [rsp + 0x1c0], xmm0
movaps xmmword [rsp + 0x1b0], xmm0
movaps xmmword [rsp + 0x1a0], xmm0
movaps xmmword [rsp + 0x190], xmm0
movaps xmmword [rsp + 0x180], xmm0
movaps xmmword [rsp + 0x170], xmm0
movaps xmmword [rsp + 0x160], xmm0
movaps xmmword [rsp + 0x150], xmm0
mov ebx, 0xff
mov ebp, 0x110000
xor r12d, r12d
nop dword [rax]
test r12b, r12b
jne 0x140022c12
lea r13d, [rdi + 1]
cmp edi, 0xff
setae r12b
cmovae r13d, ebx
mov word [rsp + 0x48], 0
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 5
mov ecx, edi
xor edx, edx
lea r8, [rsp + 0x150]
lea r9, [rsp + 0x40]
call sub.USER32.dll_ToUnicodeEx
mov r14d, 0x110000
mov r15d, 0x110000
test eax, eax
jle 0x140022afd
movzx ecx, word [rsp + 0x40]
movzx edx, cx
mov eax, ecx
and eax, 0xf800
cmp eax, 0xd800
jne 0x140022ae0
mov eax, 1
cmp edx, 0xdbff
ja 0x140022ae7
movzx edx, word [rsp + 0x42]
lea ebx, [rdx + 0x2000]
movzx ebx, bx
cmp ebx, 0xfc00
mov ebx, 0xff
jb 0x140022ae7
lea eax, [rcx + 0x2800]
movzx ecx, ax
add edx, 0x2400
movzx eax, dx
shl rcx, 0x2a
shl rax, 0x20
or rax, rcx
movabs rcx, 0x1000000000000
add rax, rcx
jmp 0x140022ae7
shl rdx, 0x20
mov rax, rdx
mov r15, rax
shr r15, 0x20
test ax, ax
cmovne r15d, ebp
cmp ax, 2
cmove r15d, ebp
mov word [rsp + 0x48], 0
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 5
mov ecx, edi
xor edx, edx
lea r8, [rsp + 0x50]
lea r9, [rsp + 0x40]
call sub.USER32.dll_ToUnicodeEx
test eax, eax
jle 0x140022bcd
movzx ecx, word [rsp + 0x40]
movzx edx, cx
mov eax, ecx
and eax, 0xf800
cmp eax, 0xd800
jne 0x140022bb0
mov eax, 1
cmp edx, 0xdbff
ja 0x140022bb7
movzx edx, word [rsp + 0x42]
lea ebx, [rdx + 0x2000]
movzx ebx, bx
cmp ebx, 0xfc00
mov ebx, 0xff
jb 0x140022bb7
lea eax, [rcx + 0x2800]
movzx ecx, ax
add edx, 0x2400
movzx eax, dx
shl rcx, 0x2a
shl rax, 0x20
or rax, rcx
movabs rcx, 0x1000000000000
add rax, rcx
jmp 0x140022bb7
shl rdx, 0x20
mov rax, rdx
mov r14, rax
shr r14, 0x20
test ax, ax
cmovne r14d, ebp
cmp ax, 2
cmove r14d, ebp
mov edi, r13d
cmp r15d, r14d
je 0x140022a00
mov edi, r13d
cmp r15d, 0x110000
je 0x140022a00
mov edi, r13d
cmp r14d, 0x110000
je 0x140022a00
mov al, 1
mov cl, 1
xchg byte [0x1400665f0], cl
jmp 0x140022c1c
mov al, byte [0x1400665f0]
test al, al
setne al
jmp 0x140022c1c
xor eax, eax
xor ecx, ecx
xchg byte [0x1400665f0], cl
add rsp, 0x258
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret