Function at 0x140047bd0
Capabilities:
Get keyboard layout

Disassembly:
mov byte [rsp + 0x20], r9b
mov byte [rsp + 0x18], r8b
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r15
sub rsp, 0x50
xor r15d, r15d
movzx r12d, r8b
mov rsi, rdx
movzx ebx, r15w
mov qword [rsp + 0x30], rdx
mov rbp, rcx
mov edi, r15d
mov dword [rsp + 0x28], r15d
mov word [rsp + 0x26], r15w
mov word [rsp + 0x20], bx
test r8b, r8b
je 0x140047c26
cmp byte [rcx + 0x64], dil
je 0x140047c26
mov byte [rsp + 0x90], 1
jmp 0x140047c2f
xor al, al
mov byte [rsp + 0x90], al
mov r13, rdx
cmp word [rdx], di
je 0x140048067
movzx esi, byte [rsp + 0x90]
mov qword [rsp + 0x48], r14
movzx r14d, byte [rsp + 0xa0]
mov ecx, 0x7d
nop word [rax + rax]
mov word [rsp + 0x24], r15w
movzx eax, word [r13]
cmp eax, 0x7b
je 0x140047ce1
cmp eax, 0x7d
je 0x140047d20
test sil, sil
je 0x140047c89
inc edi
mov dword [rsp + 0x28], edi
jmp 0x140047d20
xor ecx, ecx
mov word [rsp + 0x24], ax
mov byte [rsp + 0x90], 0
call qword [sym.imp.USER32.dll_GetKeyboardLayout]
movzx ecx, word [rsp + 0x24]
test cx, cx
jne 0x140047cb6
xor dil, dil
xor r14b, r14b
xor r15b, r15b
jmp 0x140047e2a
lea rdx, [rsp + 0x90]
lea rcx, [rsp + 0x24]
mov r9, rax
mov r8b, 1
call fcn.14001aac0
movzx ecx, word [rsp + 0x24]
xor r14b, r14b
movzx edi, al
xor r15b, r15b
jmp 0x140047e2a
mov edx, ecx
lea rbx, [r13 + 2]
mov rcx, rbx
call fcn.1400cb4a4
mov r12, rax
test rax, rax
je 0x140047d16
sub rax, r13
sar rax, 1
dec rax
jne 0x140047da2
add r12, 2
cmp word [r12], 0x7d
je 0x140047da8
movzx ebx, word [rsp + 0x20]
mov ecx, 0x7d
movzx r12d, byte [rsp + 0xa0]
add r13, 2
cmp word [r13], 0
jne 0x140047c60
mov r14, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x30]
test edi, edi
je 0x14004805e
mov eax, dword [rbp + 0x30]
cmp edi, eax
jbe 0x140047fe8
test eax, eax
je 0x140047d63
mov rcx, qword [rbp + 0x28]
call fcn.1400cafac
lea ecx, [rdi + rdi + 2]
call fcn.1400ca834
mov qword [rbp + 0x28], rax
test rax, rax
jne 0x140047fe5
lea r8, [0x1400e34fc]
lea rdx, str.Out_of_memory.
lea rcx, [0x14011b1d0]
call fcn.1400405d0
add rsp, 0x50
pop r15
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret
cmp rax, 1
jne 0x140047dc0
test sil, sil
je 0x140047db8
inc edi
mov dword [rsp + 0x28], edi
jmp 0x140047d16
movzx eax, word [rbx]
mov word [rsp + 0x24], ax
mov word [r12], r15w
xor r15b, r15b
xor ecx, ecx
mov byte [rsp + 0x98], r15b
mov byte [rsp + 0x90], r15b
call qword [sym.imp.USER32.dll_GetKeyboardLayout]
cmp word [rbx], 0
jne 0x140047e80
xor dil, dil
lea rdx, [rsp + 0x98]
mov rcx, rbx
call fcn.14001a9a0
movzx r15d, byte [rsp + 0x98]
movzx ebx, ax
mov word [rsp + 0x20], ax
mov r13d, 0x7d
mov word [r12], r13w
movzx ecx, word [rsp + 0x24]
mov r13, r12
movzx r12d, byte [rsp + 0xa0]
test dil, dil
je 0x140047fa5
test cx, cx
je 0x140047f41
test r12b, r12b
je 0x140047f41
call qword [sym.imp.USER32.dll_IsCharAlphaW]
test eax, eax
jne 0x140047f41
test byte [rsp + 0x90], 0x30
movzx r9d, byte [rsp + 0xa8]
movzx edx, byte [rsp + 0xb0]
movzx eax, dil
je 0x140047f3a
or byte [rax + rbp + 0x74], 1
jmp 0x140047fb6
lea rdx, [rsp + 0x90]
mov r9, rax
mov r8b, 1
mov rcx, rbx
call fcn.14001aac0
movzx edi, al
test al, al
je 0x140047ded
movzx ebx, word [rbx]
test ebx, 0xffffff80
jne 0x140047ebf
mov edx, 2
mov ecx, ebx
call fcn.1400cb9d8
test eax, eax
je 0x140047ebf
and ebx, 0xffffffdf
cmp bx, 0x56
jne 0x140047ef0
movzx ebx, word [r13 + 4]
test ebx, 0xffffff80
jne 0x140047ee5
mov edx, 2
mov ecx, ebx
call fcn.1400cb9d8
test eax, eax
je 0x140047ee5
and ebx, 0xffffffdf
cmp bx, 0x4b
jne 0x140047ef0
mov r14b, 1
jmp 0x140047ef3
xor r14b, r14b
cmp qword [rbp + 0x10], 0
je 0x140047f30
test r14b, r14b
jne 0x140047f30
mov dl, 1
movzx ecx, dil
call fcn.14001b1c0
movzx ebx, ax
mov word [rsp + 0x20], ax
test ax, ax
je 0x140047e0e
mov eax, 0x100
xor bx, ax
xor dil, dil
mov word [rsp + 0x20], bx
jmp 0x140047e0e
movzx ebx, word [rsp + 0x20]
jmp 0x140047e0e
or byte [rax + rbp + 0x74], 2
jmp 0x140047fb6
movzx r9d, byte [rsp + 0xa8]
movzx edx, byte [rsp + 0xb0]
movzx ecx, dil
movzx ebx, r9b
not bl
movzx eax, bl
and al, byte [rcx + rbp + 0x74]
or al, dl
mov byte [rcx + rbp + 0x74], al
test r9b, r9b
je 0x140047f9e
test r14b, r14b
jne 0x140047f9e
xor edx, edx
movzx ecx, dil
call fcn.14001b1c0
movzx r9d, byte [rsp + 0xa8]
movzx edx, byte [rsp + 0xb0]
test ax, ax
je 0x140047f9e
movzx eax, ax
and byte [rax + rbp + 0x174], bl
movzx ebx, word [rsp + 0x20]
jmp 0x140047fb6
movzx r9d, byte [rsp + 0xa8]
movzx edx, byte [rsp + 0xb0]
test bx, bx
jne 0x140047fc0
test r15b, r15b
je 0x140047fd9
movzx ecx, bx
movzx eax, r9b
not al
and al, byte [rcx + rbp + 0x174]
or al, dl
mov byte [rcx + rbp + 0x174], al
mov edi, dword [rsp + 0x28]
xor r15d, r15d
jmp 0x140047d1b
mov dword [rbp + 0x30], edi
cmp word [rsi], 0
mov rbx, qword [rbp + 0x28]
je 0x140048058
mov r13d, 0x7d
movzx eax, word [rsi]
cmp eax, 0x7b
je 0x14004800e
cmp eax, r13d
je 0x14004804e
mov word [rbx], ax
add rbx, 2
jmp 0x14004804e
lea rdi, [rsi + 2]
mov edx, r13d
mov rcx, rdi
call fcn.1400cb4a4
mov r11, rax
test rax, rax
je 0x14004804e
cmp rax, rdi
jne 0x140048037
cmp word [rax + 2], r13w
lea rcx, [rax + 2]
cmove r11, rcx
lea rax, [rsi + 4]
cmp r11, rax
jne 0x14004804b
movzx eax, word [rdi]
add rbx, 2
mov word [rbx - 2], ax
mov rsi, r11
add rsi, 2
cmp word [rsi], 0
jne 0x140047ff8
mov word [rbx], r15w
jmp 0x140048087
movzx r12d, byte [rsp + 0xa0]
test r12b, r12b
je 0x140048087
cmp dword [rbp + 0x30], 0
je 0x14004807c
mov rax, qword [rbp + 0x28]
mov word [rax], r15w
jmp 0x140048087
lea rax, [0x1400e34fc]
mov qword [rbp + 0x28], rax
mov eax, 1
add rsp, 0x50
pop r15
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret