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

Disassembly:
push rbx
push rsi
push rdi
push r14
sub rsp, 0x198
mov rax, qword [0x1401b7700]
xor rax, rsp
mov qword [rsp + 0x170], rax
mov rcx, qword [0x140232ef0]
mov rsi, r8
mov rdi, qword [0x140232f08]
test rcx, rcx
je case.default.0x1400390dc
lea r14, [rcx + 8]
test r9b, r9b
je 0x140039235
cmp rdx, 0x200
ja 0x1400390b9
je 0x14003907e
cmp rdx, 0xa0
jne case.default.0x1400390dc
mov rbx, qword [r8]
lea rdx, [rsp + 0x40]
mov rcx, rdi
call qword [sym.imp.USER32.dll_GetWindowRect]
mov rax, rbx
mov rcx, r14
sub ebx, dword [rsp + 0x40]
shr rax, 0x20
sub eax, dword [rsp + 0x44]
movd xmm1, ebx
cvtdq2ps xmm1, xmm1
movd xmm2, eax
cvtdq2ps xmm2, xmm2
call fcn.140012b50
jmp case.default.0x1400390dc
lea rax, [rdx - 0x201]
cmp rax, 0xd
ja case.default.0x1400390dc
lea r8, [0x140000000]
mov eax, dword [r8 + rax*4 + 0x3962c]
add rax, r8
jmp rax
xor eax, eax
cmp rdx, 0x204
je 0x1400390f4
mov ebx, eax
cmp rdx, 0x206
jne 0x1400390f9
mov ebx, 1
cmp rdx, 0x207
je 0x14003910b
cmp rdx, 0x209
jne 0x140039110
mov ebx, 2
cmp rdx, 0x20b
je 0x140039122
cmp rdx, 0x20d
jne 0x140039131
cmp word [rsi + 0xa], 1
mov rbx, rax
setne bl
add rbx, 3
cmp byte [rcx + rax + 0xe08], 0
jne 0x140039158
inc rax
cmp rax, 5
jl 0x140039131
call qword [sym.imp.USER32.dll_GetCapture]
test rax, rax
jne 0x140039158
mov rcx, rdi
call qword [sym.imp.USER32.dll_SetCapture]
mov byte [rbx + r14 + 0xe00], 1
jmp case.default.0x1400390dc
xor eax, eax
cmp rdx, 0x205
mov ebx, eax
sete bl
cmp rdx, 0x208
jne 0x140039182
lea ebx, [rax + 2]
jmp 0x14003919d
cmp rdx, 0x20c
jne 0x14003919d
shr rsi, 0x10
mov rbx, rax
cmp si, 1
setne bl
add rbx, 3
mov byte [rbx + r14 + 0xe00], al
nop word [rax + rax]
cmp byte [rcx + rax + 0xe08], 0
jne case.default.0x1400390dc
inc rax
cmp rax, 5
jl 0x1400391b0
call qword [sym.imp.USER32.dll_GetCapture]
cmp rax, rdi
jne case.default.0x1400390dc
call qword [sym.imp.USER32.dll_ReleaseCapture]
jmp case.default.0x1400390dc
movsx eax, word [rsi + 0xa]
movd xmm0, eax
cvtdq2ps xmm0, xmm0
divss xmm0, dword [0x14019de64]
addss xmm0, dword [r14 + 0xe08]
movss dword [r14 + 0xe08], xmm0
jmp case.default.0x1400390dc
movsx eax, word [rsi + 0xa]
movd xmm0, eax
cvtdq2ps xmm0, xmm0
divss xmm0, dword [0x14019de64]
addss xmm0, dword [r14 + 0xe0c]
movss dword [r14 + 0xe0c], xmm0
jmp case.default.0x1400390dc
mov rax, rdx
sub rax, 0x100
je 0x140039256
sub rax, 1
je 0x140039256
sub rax, 3
je 0x140039256
cmp rax, 1
jne case.default.0x1400390dc
lea rax, [rdx - 0x100]
test rax, 0xfffffffffffffffb
sete bl
cmp dword [r8], 0x200
jae case.default.0x1400390dc
mov qword [rsp + 0x1c0], rbp
mov qword [rsp + 0x190], r15
movaps xmmword [rsp + 0x180], xmm6
call fcn.140037bc0
mov edi, dword [rsi]
mov ecx, edi
call fcn.140038030
movss xmm6, dword [0x14019dce0]
mov ebp, edi
movsxd r15, eax
cmp r15d, 0x256
jne 0x140039320
test bl, bl
jne 0x140039307
mov qword [rsp + 0x1c8], r13
mov r13, qword [0x140232ef0]
cmp byte [r13 + 0x37b1], bl
je 0x1400392df
movaps xmm3, xmm6
lea rcx, [r13 + 8]
mov r8b, 1
mov edx, r15d
call fcn.1400129b0
mov ebp, dword [rsi]
cmp edi, 0x1ff
ja 0x1400392ff
movsxd rax, edi
mov dword [r13 + rax*4 + 0xfc], 0x256
mov dword [r13 + 0xa54], edi
mov ebp, dword [rsi]
mov r13, qword [rsp + 0x1c8]
mov rdi, qword [0x140232ef0]
cmp byte [rdi + 0x37b1], 0
je 0x140039339
test bl, bl
je 0x140039326
movaps xmm3, xmm6
jmp 0x140039329
test eax, eax
je 0x140039354
jmp 0x140039307
xorps xmm3, xmm3
movzx r8d, bl
lea rcx, [rdi + 8]
mov edx, r15d
call fcn.1400129b0
cmp ebp, 0x1ff
ja 0x140039354
movsxd rax, ebp
mov dword [rdi + rax*4 + 0xfc], r15d
mov dword [rdi + r15*4 + 0xfc], ebp
mov eax, dword [rsi]
mov r15, qword [rsp + 0x190]
mov rbp, qword [rsp + 0x1c0]
cmp eax, 0x10
jne 0x140039422
mov ecx, 0xa0
call qword [sym.imp.USER32.dll_GetKeyState]
shr eax, 0xf
and al, 1
cmp al, bl
jne 0x1400393c5
mov rdi, qword [0x140232ef0]
cmp byte [rdi + 0x37b1], 0
je 0x1400393b1
test bl, bl
je 0x14003939c
movaps xmm3, xmm6
jmp 0x14003939f
xorps xmm3, xmm3
movzx r8d, bl
lea rcx, [rdi + 8]
mov edx, 0x210
call fcn.1400129b0
mov dword [rdi + 0x37c], 0x210
mov dword [rdi + 0x93c], 0xa0
mov ecx, 0xa1
call qword [sym.imp.USER32.dll_GetKeyState]
shr eax, 0xf
and al, 1
cmp al, bl
jne 0x140039591
mov rdi, qword [0x140232ef0]
cmp byte [rdi + 0x37b1], 0
je 0x140039409
test bl, bl
jne 0x1400393f4
xorps xmm6, xmm6
movaps xmm3, xmm6
lea rcx, [rdi + 8]
movzx r8d, bl
mov edx, 0x214
call fcn.1400129b0
mov dword [rdi + 0x380], 0x214
mov dword [rdi + 0x94c], 0xa1
jmp 0x140039591
cmp eax, 0x11
jne 0x1400394de
mov ecx, 0xa2
call qword [sym.imp.USER32.dll_GetKeyState]
shr eax, 0xf
and al, 1
cmp al, bl
jne 0x140039481
mov rdi, qword [0x140232ef0]
cmp byte [rdi + 0x37b1], 0
je 0x14003946d
test bl, bl
je 0x140039458
movaps xmm3, xmm6
jmp 0x14003945b
xorps xmm3, xmm3
movzx r8d, bl
lea rcx, [rdi + 8]
mov edx, 0x20f
call fcn.1400129b0
mov dword [rdi + 0x384], 0x20f
mov dword [rdi + 0x938], 0xa2
mov ecx, 0xa3
call qword [sym.imp.USER32.dll_GetKeyState]
shr eax, 0xf
and al, 1
cmp al, bl
jne 0x140039591
mov rdi, qword [0x140232ef0]
cmp byte [rdi + 0x37b1], 0
je 0x1400394c5
test bl, bl
jne 0x1400394b0
xorps xmm6, xmm6
movaps xmm3, xmm6
lea rcx, [rdi + 8]
movzx r8d, bl
mov edx, 0x213
call fcn.1400129b0
mov dword [rdi + 0x388], 0x213
mov dword [rdi + 0x948], 0xa3
jmp 0x140039591
cmp eax, 0x12
jne 0x140039591
mov ecx, 0xa4
call qword [sym.imp.USER32.dll_GetKeyState]
shr eax, 0xf
and al, 1
cmp al, bl
jne 0x14003953d
mov rdi, qword [0x140232ef0]
cmp byte [rdi + 0x37b1], 0
je 0x140039529
test bl, bl
je 0x140039514
movaps xmm3, xmm6
jmp 0x140039517
xorps xmm3, xmm3
movzx r8d, bl
lea rcx, [rdi + 8]
mov edx, 0x211
call fcn.1400129b0
mov dword [rdi + 0x38c], 0x211
mov dword [rdi + 0x940], 0xa4
mov ecx, 0xa5
call qword [sym.imp.USER32.dll_GetKeyState]
shr eax, 0xf
and al, 1
cmp al, bl
jne 0x140039591
mov rdi, qword [0x140232ef0]
cmp byte [rdi + 0x37b1], 0
je 0x14003957d
test bl, bl
jne 0x140039568
xorps xmm6, xmm6
movaps xmm3, xmm6
lea rcx, [rdi + 8]
movzx r8d, bl
mov edx, 0x215
call fcn.1400129b0
mov dword [rdi + 0x390], 0x215
mov dword [rdi + 0x950], 0xa5
movaps xmm6, xmmword [rsp + 0x180]
test bl, bl
je case.default.0x1400390dc
lea rcx, [rsp + 0x70]
call qword [sym.imp.USER32.dll_GetKeyboardState]
test eax, eax
je case.default.0x1400390dc
xor ecx, ecx
call qword [sym.imp.USER32.dll_GetKeyboardLayout]
mov edx, dword [rsi + 4]
lea r9, [rsp + 0x50]
mov ecx, dword [rsi]
lea r8, [rsp + 0x70]
mov qword [rsp + 0x30], rax
mov edi, 0xa
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], edi
call qword [sym.imp.USER32.dll_ToUnicodeEx]
test eax, eax
je case.default.0x1400390dc
lea rbx, [rsp + 0x50]
movzx edx, word [rbx]
test dx, dx
je 0x140039600
cmp edx, 0x10000
jae 0x140039600
mov rcx, r14
call fcn.1400127c0
add rbx, 2
sub rdi, 1
jne 0x1400395e8
xor eax, eax
mov rcx, qword [rsp + 0x170]
xor rcx, rsp
call fcn.140136b70
add rsp, 0x198
pop r14
pop rdi
pop rsi
pop rbx
ret