Function at 0x140012c46
Capabilities:
Get keyboard layout
Log keystrokes via polling

Disassembly:
mov r11, rsp
push rbp
push rbx
push rsi
push rdi
push r15
lea rbp, [rsp - 0x70]
sub rsp, 0x170
movzx ebx, dl
mov r15, r9
movzx eax, bx
movzx edi, r8w
or ax, r8w
mov esi, ecx
je 0x140013382
mov eax, dword [rbp + 0xc8]
mov ecx, 0xffc3d44d
mov qword [r11 + 8], r12
test eax, eax
mov qword [r11 - 0x30], r13
cmovne ecx, eax
mov qword [r11 - 0x38], r14
mov dword [rsp + 0x38], ecx
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x14018ada0]
sete r14b
cmp dword [0x14018cd4c], 0
je 0x140012cc2
test r14b, r14b
jne 0x140012cc2
mov r12b, 1
jmp 0x140012cc5
xor r12b, r12b
cmp dword [0x14018cd4c], 1
mov byte [rsp + 0x30], r12b
je 0x140012ce0
test r14b, r14b
je 0x140012ce7
mov byte [rbp + 0xc0], 0
test bl, bl
jne 0x140012cff
movzx ecx, di
call fcn.140017386
movzx ebx, al
jmp 0x140012d15
test di, di
jne 0x140012d15
xor edx, edx
movzx ecx, bl
call fcn.14001705c
movzx edi, ax
xor r13d, r13d
lea rdx, [0x140000000]
mov ecx, r13d
movzx eax, di
shr ax, 8
test al, al
setne cl
cmp dword [0x14018cd4c], 2
mov dword [rsp + 0x48], ecx
jne case.default.0x140012d5c
movzx eax, bl
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x140012d5c
cdqe
mov ecx, dword [rdx + rax*4 + 0x13391]
add rcx, rdx
jmp rcx
mov bl, reloc.OLEAUT32.dll_SafeArrayGetElemsize
jmp case.default.0x140012d5c
mov bl, reloc.OLEAUT32.dll_SafeArrayGetDim
jmp case.default.0x140012d5c
mov bl, reloc.OLEAUT32.dll_SafeArrayGetUBound
test r15, r15
je 0x140012ee2
xor r8d, r8d
movzx edx, di
movzx ecx, bl
call fcn.140016040
test al, al
je 0x140012e62
lea rcx, [rsp + 0x60]
call qword [sym.imp.USER32.dll_GetKeyboardState]
test esi, esi
jne 0x140012dad
movzx eax, bl
or byte [rsp + rax + 0x60], 0x80
jmp 0x140012dbe
cmp esi, 1
jne 0x140012dbe
movzx eax, bl
and byte [rsp + rax + 0x60], 0x7f
movzx eax, bl
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x140012de2
lea rdx, [0x140000000]
cdqe
mov ecx, dword [rdx + rax*4 + 0x133a9]
add rcx, rdx
jmp rcx
test byte [rbp + 2], 0x80
jne 0x140012e02
test byte [rbp + 3], 0x80
jne 0x140012e02
and byte [rsp + 0x71], 0x7f
jmp case.default.0x140012de2
or byte [rsp + 0x71], 0x80
jmp case.default.0x140012de2
test byte [rbp], 0x80
jne 0x140012e2a
test byte [rbp + 1], 0x80
jne 0x140012e2a
and byte [rsp + 0x70], 0x7f
jmp case.default.0x140012de2
or byte [rsp + 0x70], 0x80
jmp case.default.0x140012de2
test byte [rbp + 4], 0x80
jne 0x140012e52
test byte [rbp + 5], 0x80
jne 0x140012e52
and byte [rsp + 0x72], 0x7f
jmp case.default.0x140012de2
or byte [rsp + 0x72], 0x80
lea rcx, [rsp + 0x60]
call qword [sym.imp.USER32.dll_SetKeyboardState]
movzx eax, di
shl eax, 0x10
movsxd rdi, eax
cmp esi, 1
je 0x140012e8d
mov r9, rdi
movzx r8d, bl
or r9, 1
mov edx, 0x100
mov rcx, r15
call qword [sym.imp.USER32.dll_PostMessageW]
cmp byte [rbp + 0xc0], r13b
je 0x140012eba
cmp esi, 2
jne 0x140012eba
mov rax, qword [0x140185a58]
mov ecx, dword [rax + 0x84]
call fcn.140014f5a
jmp 0x140012ec2
test esi, esi
je 0x140013336
mov r9d, 0xc0000001
movzx r8d, bl
or r9, rdi
mov edx, 0x101
mov rcx, r15
call qword [sym.imp.USER32.dll_PostMessageW]
jmp 0x140013336
cmp byte [0x140189ec7], r13b
mov dword [0x14018f1b0], esi
mov byte [0x14018cd58], bl
je 0x140012f29
cmp bl, 0x12
je 0x140012f0f
lea eax, [rbx + 0x5c]
cmp al, 1
ja 0x140012f29
test r14b, r14b
jne 0x140012f29
xor ecx, ecx
mov byte [rsp + 0x34], 1
call fcn.14003badd
jmp 0x140012f2e
mov byte [rsp + 0x34], r13b
test r14b, r14b
lea rax, [0x14018f1b4]
lea r15, [rsp + 0x4c]
cmove r15, rax
cmp bl, 0xa5
jne 0x14001300d
test r12b, r12b
jne 0x14001300d
cmp qword [0x140189ed8], r13
je 0x14001300d
mov al, 1
mov byte [rsp + 0x33], al
mov byte [rbp + 0xa8], al
test r14b, r14b
jne 0x140012f86
mov rax, qword [0x14018f1b8]
mov qword [rsp + 0x40], rax
jmp 0x140012fc5
call qword [sym.imp.USER32.dll_GetForegroundWindow]
test rax, rax
je 0x140012fa5
xor edx, edx
mov rcx, rax
call qword [sym.imp.USER32.dll_GetWindowThreadProcessId]
jmp 0x140012fa8
mov eax, r13d
mov ecx, eax
call qword [sym.imp.USER32.dll_GetKeyboardLayout]
mov rcx, rax
mov qword [rsp + 0x40], rax
xor edx, edx
mov r12, rax
call fcn.1400164db
mov dword [r15], eax
cmp dword [r15], r13d
je 0x140012fdd
mov byte [rbp + 0xa8], r13b
mov r10b, 1
jmp 0x140013068
mov ecx, 0xa2
mov byte [rbp + 0xb0], 0xa2
call qword [sym.imp.USER32.dll_GetAsyncKeyState]
movzx r12d, ax
mov r10b, 1
mov eax, dword [rsp + 0x38]
shr r12d, 0xf
and r12b, 1
mov dword [0x14018ac6c], eax
jmp 0x14001307d
xor r10b, r10b
mov byte [rsp + 0x33], r10b
mov byte [rbp + 0xa8], r10b
test r12b, r12b
je 0x14001305e
xor r8d, r8d
movzx edx, di
movzx ecx, bl
call fcn.140016040
movzx r12d, byte [rbp + 0xa8]
movzx ecx, al
mov byte [rsp + 0x32], al
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x40], rax
movzx eax, byte [rbp + 0xa8]
mov byte [rbp + 0xb0], al
jmp 0x140013083
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x40], rax
movzx eax, byte [rbp + 0xa8]
movzx r12d, byte [rbp + 0xa8]
mov byte [rbp + 0xb0], al
xor cl, cl
mov byte [rsp + 0x32], cl
test r14b, r14b
jne 0x1400130bb
mov eax, dword [0x14018cd4c]
cmp eax, 2
je 0x1400130bb
cmp qword [0x140189ed8], r13
je 0x1400130b1
cmp eax, 1
jne 0x1400130bb
mov byte [rsp + 0x31], 1
jmp 0x1400130c0
mov byte [rsp + 0x31], r13b
mov r14d, 0x8000
cmp esi, 1
je 0x1400131cb
cmp byte [rsp + 0x30], r13b
je 0x140013116
mov eax, dword [rsp + 0x38]
movzx r8d, di
mov r9d, dword [rsp + 0x48]
movzx edx, bl
mov dword [rsp + 0x20], eax
call fcn.1400148f9
mov r14, qword [rsp + 0x40]
cmp byte [rsp + 0x31], r13b
je 0x1400131d0
movzx r8d, di
movzx edx, bl
xor ecx, ecx
call fcn.140015185
jmp 0x1400131d0
test r10b, r10b
je 0x140013134
mov eax, dword [0x14018ac68]
cmp dword [r15], 3
cmove eax, dword [rsp + 0x38]
mov dword [0x14018ac68], eax
mov r9d, dword [rsp + 0x38]
movzx edx, dil
mov r8d, dword [rsp + 0x48]
movzx ecx, bl
call qword [sym.imp.USER32.dll_keybd_event]
mov dword [0x14018ac68], r13d
cmp byte [rbp + 0xa8], r13b
je 0x1400130f3
cmp dword [0x14018ac6c], r13d
mov byte [rbp + 0xa8], r13b
je 0x140013194
mov r14, qword [rsp + 0x40]
mov edx, 4
mov rcx, r14
mov dword [0x14018ac6c], r13d
call fcn.1400164db
mov dword [r15], eax
jmp 0x1400130f8
test r12b, r12b
jne 0x1400130f3
movzx ecx, byte [rbp + 0xb0]
call qword [sym.imp.USER32.dll_GetAsyncKeyState]
and ax, r14w
mov r14, qword [rsp + 0x40]
neg ax
mov rcx, r14
sbb edx, edx
add edx, 4
call fcn.1400164db
mov dword [r15], eax
jmp 0x1400130f8
mov r14, qword [rsp + 0x40]
cmp byte [rbp + 0xc0], r13b
je 0x140013219
cmp esi, 2
jne 0x140013219
cmp dword [0x14018cd4c], esi
mov rax, qword [0x140185a58]
jne 0x140013209
mov ecx, dword [rax + 0x88]
call fcn.140014f5a
jmp 0x140013221
mov ecx, dword [rax + 0x84]
call fcn.140014f5a
jmp 0x140013221
test esi, esi
je 0x140013324
mov ecx, dword [rsp + 0x48]
or ecx, 2
cmp byte [rsp + 0x30], r13b
je 0x140013254
mov eax, dword [rsp + 0x38]
mov r9d, ecx
movzx ecx, byte [rsp + 0x32]
movzx r8d, di
movzx edx, bl
mov dword [rsp + 0x20], eax
call fcn.1400148f9
jmp 0x1400132ec
cmp byte [rsp + 0x33], r13b
je 0x140013274
mov eax, dword [0x14018ac64]
cmp dword [r15], 3
cmove eax, dword [rsp + 0x38]
mov dword [0x14018ac64], eax
mov r9d, dword [rsp + 0x38]
mov r8d, ecx
movzx ecx, bl
movzx edx, dil
call qword [sym.imp.USER32.dll_keybd_event]
mov dword [0x14018ac64], r13d
cmp byte [rbp + 0xa8], r13b
je 0x1400132ec
cmp dword [0x14018ac6c], r13d
je 0x1400132bb
mov dword [0x14018ac6c], r13d
mov edx, 4
jmp 0x1400132e1
test r12b, r12b
je 0x1400132ec
movzx ecx, byte [rbp + 0xb0]
call qword [sym.imp.USER32.dll_GetAsyncKeyState]
mov ecx, 0x8000
test cx, ax
setne r13b
lea edx, [r13 + 3]
mov rcx, r14
call fcn.1400164db
mov dword [r15], eax
cmp dword [r15], 0
je 0x14001330b
mov eax, 0x138
cmp di, ax
jne 0x14001330b
and byte [0x14018f196], 0xfe
cmp byte [rsp + 0x31], 0
je 0x140013324
movzx r8d, di
movzx edx, bl
mov cl, 1
call fcn.140015185
cmp byte [rsp + 0x34], 0
je 0x140013336
mov cl, 1
call fcn.14003badd
cmp byte [rbp + 0xc0], 0
mov r14, qword [rsp + 0x160]
mov r13, qword [rsp + 0x168]
mov r12, qword [rsp + 0x1a0]
je 0x140013382
cmp dword [0x14018cd4c], 2
mov rax, qword [0x140185a58]
jne 0x14001337a
mov ecx, dword [rax + 0x80]
jmp 0x14001337d
mov ecx, dword [rax + 0x7c]
call fcn.140014f5a
add rsp, 0x170
pop r15
pop rdi
pop rsi
pop rbx
pop rbp
ret