Function at 0x140017b60
Capabilities:
Get keyboard layout

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x198
mov rdi, r8
mov rbx, rdx
mov rsi, rcx
mov rcx, rdx
mov edx, 0x10
call fcn.14001bb40
mov ebp, eax
mov rcx, rbx
mov edx, 3
call fcn.14001bb40
mov r14d, eax
mov rcx, rbx
mov edx, 0xc
call fcn.14001bb40
movzx ecx, bpl
or bpl, 2
movzx edx, bpl
test al, al
cmove edx, ecx
lea eax, [rdx + 4]
movzx r12d, al
test r14b, r14b
cmove r12d, edx
movzx r15d, word [rbx + 6]
movzx r13d, byte [rbx + 0xc]
movzx r8d, word [rbx + 0xa]
movzx eax, r8w
cmp r15d, 0x12
jne 0x140017c78
test r13b, r13b
jne 0x140017c78
test r8w, r8w
je 0x140017c78
mov ecx, r8d
and ecx, 0xf800
cmp ecx, 0xd800
jne 0x140017ccb
cmp word [rdi], 0
je 0x140017d0f
movzx ecx, word [rdi + 2]
movzx edx, cx
mov word [rdi], 0
mov r8d, ecx
and r8d, 0xf800
cmp r8d, 0xd800
jne 0x140017d1b
cmp edx, 0xdbff
ja case.0x140017cb9.16
cmp eax, 0xdc00
jb case.0x140017cb9.16
and ecx, 0x3ff
and eax, 0x3ff
shl rcx, 0x1a
shl rax, 0x10
or rax, rcx
movabs rdx, 0x100000000
add rdx, rax
jmp 0x140017d1f
lea ecx, [r15 - 0x6a]
cmp cx, 0xfff6
jb 0x140017c97
cmp r12b, 4
jb 0x140017c97
mov ecx, r12d
and cl, 3
cmp cl, 3
jne case.0x140017cb9.16
movzx ecx, r15w
add ecx, 0xfffffff8
cmp ecx, 0x26
ja case.0x140017cb9.10
xor edx, edx
lea r9, [0x140018194]
movsxd r10, dword [r9 + rcx*4]
add r10, r9
xor ecx, ecx
jmp r10
mov eax, r12d
and al, 1
or al, 0xa
movzx ecx, al
jmp 0x140017e19
mov ecx, eax
xor ecx, 0xffefd800
cmp ecx, 0xffef07ff
jbe 0x140018129
shl rax, 0x20
or rax, 0xf
mov qword [rsp + 0x90], rax
mov byte [rsp + 0x98], r12b
mov byte [rsp + 0x99], 0
mov rcx, qword [rsp + 0x92]
mov r8b, 2
jmp 0x140017e55
mov word [rdi], 1
mov word [rdi + 2], r8w
jmp case.0x140017cb9.16
shl rdx, 0x10
shl rdx, 0x10
movabs r14, 0x1fffff00000000
and r14, rdx
movabs rax, 0x11000000000000
cmp r14, rax
jne 0x140017d49
mov word [rsi], 6
jmp 0x140017e6b
mov rcx, rbx
mov edx, 0x10
call fcn.14001bb40
mov edi, eax
mov rcx, rbx
mov edx, 3
call fcn.14001bb40
mov ebp, eax
mov rcx, rbx
mov edx, 0xc
call fcn.14001bb40
movzx ecx, dil
or dil, 2
movzx edx, dil
test al, al
cmove edx, ecx
lea eax, [rdx + 4]
movzx eax, al
test bpl, bpl
cmove eax, edx
or r14, 0xf
mov word [rsi], 2
mov qword [rsi + 4], r14
mov byte [rsi + 0xc], al
mov word [rsi + 0xd], 0
jmp 0x140017e6b
mov ecx, 3
jmp 0x140017e19
mov ecx, 4
jmp 0x140017e19
lea ecx, [r15 - 0x70]
cmp ecx, 0x18
jae 0x140017e82
lea eax, [r15 - 0x6f]
movzx edx, ax
mov ecx, 0xe
jmp case.0x140017cb9.8
mov ecx, 0x11
jmp 0x140017e19
mov ecx, 8
jmp 0x140017e19
mov ecx, 2
jmp 0x140017e19
mov ecx, 1
jmp 0x140017e19
mov ecx, 9
jmp 0x140017e19
mov ecx, 7
jmp 0x140017e19
mov ecx, 5
jmp 0x140017e19
mov ecx, 0xd
jmp 0x140017e19
mov ecx, 6
jmp 0x140017e19
mov ecx, 0xc
xor edx, edx
test r13b, r13b
sete r8b
shl r14, 0x20
shl edx, 8
movzx eax, dx
or rax, r14
or rax, rcx
mov qword [rsp + 0x90], rax
mov byte [rsp + 0x98], r12b
mov byte [rsp + 0x99], 0
mov rcx, qword [rsp + 0x92]
add r8b, r8b
mov word [rdi], 0
mov word [rsi], 2
mov word [rsi + 4], ax
mov qword [rsi + 6], rcx
mov byte [rsi + 0xe], r8b
mov rax, rsi
add rsp, 0x198
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
cmp r8w, 0x20
jae 0x140018045
movzx ebp, word [rbx + 8]
xorps xmm0, xmm0
movaps xmmword [rsp + 0x180], xmm0
movaps xmmword [rsp + 0x170], xmm0
movaps xmmword [rsp + 0x160], xmm0
movaps xmmword [rsp + 0x150], 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
mov dword [rsp + 0x44], 0x100000
call sub.user32.dll_GetForegroundWindow
mov rcx, rax
xor edx, edx
call sub.user32.dll_GetWindowThreadProcessId
mov ecx, eax
call sub.user32.dll_GetKeyboardLayout
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], 4
mov dword [rsp + 0x20], 2
lea r8, [rsp + 0x90]
lea r9, [rsp + 0x44]
mov ecx, r15d
mov edx, ebp
call sub.user32.dll_ToUnicodeEx
test eax, eax
jle case.0x140017cb9.16
mov ecx, dword [rsp + 0x44]
mov eax, eax
mov qword [rsp + 0x58], 0
mov qword [rsp + 0x60], 2
mov dword [rsp + 0x68], ecx
mov qword [rsp + 0x70], rax
mov word [rsp + 0x78], 0
lea rcx, [rsp + 0x58]
call fcn.140017610
mov r14, rax
dec eax
cmp ax, 2
jb case.0x140017cb9.16
shr r14, 0x20
cmp r14d, 0x110000
je case.0x140017cb9.16
lea rcx, [rsp + 0x58]
call fcn.140017610
cmp ax, 2
jne case.0x140017cb9.16
mov rcx, rbx
mov edx, 0x10
call fcn.14001bb40
mov ebp, eax
mov rcx, rbx
mov edx, 0x80
call fcn.14001bb40
cmp bpl, al
je 0x14001807d
lea eax, [r14 - 0x61]
cmp eax, 0x1a
jae 0x1400180f3
lea rbx, [rsp + 0x84]
mov rcx, rbx
mov edx, r14d
call fcn.14003dfd0
lea r15, [rsp + 0x48]
mov rcx, r15
mov rdx, rbx
call fcn.140038730
mov rcx, r15
call fcn.1400386c0
cmp eax, 0x110000
je 0x14001815d
mov ebx, eax
lea rcx, [rsp + 0x48]
call fcn.1400386c0
jmp 0x1400180cc
mov ecx, r8d
and ecx, 0xf800
cmp ecx, 0xd800
je 0x140017c0c
mov ecx, eax
xor ecx, 0xffefd800
cmp ecx, 0xffef07ff
jbe 0x140018143
mov ecx, 0xf
xor edx, edx
mov r14d, eax
jmp case.0x140017cb9.8
lea eax, [r14 - 0x41]
cmp eax, 0x1a
jae 0x14001810e
lea rbx, [rsp + 0x84]
mov rcx, rbx
mov edx, r14d
call fcn.14003def0
lea r15, [rsp + 0x48]
mov rcx, r15
mov rdx, rbx
call fcn.140038730
mov rcx, r15
call fcn.1400386c0
cmp eax, 0x110000
je 0x140018177
mov ebx, eax
lea rcx, [rsp + 0x48]
call fcn.1400386c0
cmp eax, 0x110000
cmove r14d, ebx
cmp r14d, 0x110000
je case.0x140017cb9.16
mov edx, r14d
shl rdx, 0x18
mov ecx, 0xf
jmp case.0x140017cb9.8
cmp r14d, 0x80
jb 0x1400180d5
mov ecx, r14d
call fcn.14003dd10
test al, al
jne 0x140017ffe
jmp 0x1400180d5
cmp r14d, 0x80
jb 0x1400180d5
mov ecx, r14d
call fcn.14003de00
test al, al
jne 0x14001808a
jmp 0x1400180d5
lea rcx, [0x1400519d8]
lea r8, [0x140051aa8]
mov edx, 0x2b
call fcn.140041920
ud2
lea rcx, [0x1400519d8]
lea r8, [0x140051ac0]
mov edx, 0x2b
call fcn.140041920
ud2
lea rcx, [0x1400519d8]
lea r8, [0x140051a78]
mov edx, 0x2b
call fcn.140041920
ud2
lea rcx, [0x1400519d8]
lea r8, [0x140051a90]
mov edx, 0x2b
call fcn.140041920
ud2