Function at 0x407760
Capabilities:
Log keystrokes via polling

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x88
movsx esi, byte [r8]
mov r13d, dword [rsp + 0xf0]
mov rdi, rcx
mov rbp, rdx
mov rbx, r8
mov r12d, r9d
test sil, sil
js 0x407830
mov ecx, esi
call qword [sym.imp.USER32.dll_VkKeyScanW]
cmp ax, 0xffff
je 0x407be0
mov ecx, eax
movzx r8d, al
shr cx, 4
and ecx, 0x10
mov edx, ecx
or edx, 8
test ah, 2
cmovne ecx, edx
mov edx, ecx
or edx, 1
test ah, 4
cmovne ecx, edx
test r13b, r13b
jne 0x407810
movzx ecx, cx
mov r9d, esi
mov eax, esi
xor edx, edx
mov dword [rsp + 0x38], edx
mov dword [rsp + 0x28], ecx
mov rdx, rbp
mov dword [rsp + 0x30], esi
mov dword [rsp + 0x20], eax
mov rcx, rdi
call fcn.004072d0
nop
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
test cl, 8
jne 0x407a12
or ecx, 2
mov eax, esi
movzx ecx, cx
mov r9d, eax
mov edx, 2
xor eax, eax
jmp 0x4077d8
mov eax, esi
and eax, 0xe0
cmp eax, 0xc0
je 0x4079e0
mov eax, esi
and eax, 0xf0
cmp eax, 0xe0
je 0x407ab4
mov eax, esi
and eax, 0xf8
cmp eax, 0xf0
je 0x407a20
nop word cs:[rax + rax]
movzx eax, byte [0x004de040]
test al, al
je 0x407b60
movzx esi, byte [0x004de048]
test sil, sil
je 0x4077f4
lea rdi, [rsp + 0x60]
mov edx, 0x40
mov qword [rsp + 0x68], 0
mov byte [rsp + 0x70], 0
lea rax, [rdi + 0x10]
mov rcx, rdi
mov qword [rsp + 0x60], rax
call fcn.00499ba0
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0x68]
cmp rax, 0x21
jbe 0x407be7
lea rdx, str.Discarding_invalid_UTF_8_sequence:
mov r8d, 0x22
mov rcx, rdi
call fcn.00499d20
test r12d, r12d
jle 0x407b20
lea eax, [r12 - 1]
lea rsi, [0x004c2390]
lea r12, [rdi + 0x10]
lea r13, [rsp + 0x40]
lea rbp, [rbx + rax + 1]
jmp 0x407991
mov byte [rdx + r14], 0x20
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x68], r15
mov byte [rax + r14 + 1], 0
movzx eax, byte [rbx]
mov byte [rsp + 0x42], 0
mov qword [rsp + 0x48], 0
mov qword [rsp + 0x50], 2
mov edx, eax
and eax, 0xf
movzx eax, byte [rsi + rax]
shr dl, 4
and edx, 0xf
movzx edx, byte [rsi + rdx]
mov byte [rsp + 0x41], al
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0x68]
mov byte [rsp + 0x40], dl
cmp rax, 1
jbe 0x407ba5
mov r8d, 2
mov rdx, r13
mov rcx, rdi
call fcn.00499d20
add rbx, 1
cmp rbx, rbp
je 0x407b20
mov rdx, qword [rsp + 0x60]
mov r14, qword [rsp + 0x68]
mov eax, 0xf
cmp rdx, r12
cmovne rax, qword [rsp + 0x70]
lea r15, [r14 + 1]
cmp r15, rax
jbe 0x407910
mov qword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov rdx, r14
mov rcx, rdi
call fcn.00499ee0
mov rdx, qword [rsp + 0x60]
jmp 0x407910
movzx eax, byte [r8 + 1]
mov edx, eax
and edx, 0xc0
add edx, 0xffffff80
jne 0x407870
shl esi, 6
and eax, 0x3f
and esi, 0x7c0
or esi, eax
cmp esi, 0x7f
jbe 0x407870
jmp 0x407794
or ecx, 2
xor eax, eax
movzx ecx, cx
jmp 0x407821
movsx edx, byte [r8 + 1]
mov eax, edx
and eax, 0xc0
add eax, 0xffffff80
jne 0x407870
movsx eax, byte [rbx + 2]
mov ecx, eax
and ecx, 0xc0
add ecx, 0xffffff80
jne 0x407870
movzx ecx, byte [rbx + 3]
mov r8d, ecx
and r8d, 0xc0
add r8d, 0xffffff80
jne 0x407870
shl esi, 0x12
shl edx, 0xc
and ecx, 0x3f
mov r8d, esi
and edx, 0x3f000
shl eax, 6
and r8d, 0x1c0000
and eax, 0xfc0
or edx, r8d
or edx, ecx
or eax, edx
lea edx, [rax - 0x10000]
cmp edx, 0xfffff
ja 0x407870
test r13b, r13b
mov esi, eax
je 0x407b50
xor r8d, r8d
mov ecx, 2
jmp 0x407821
movsx eax, byte [r8 + 1]
mov edx, eax
and edx, 0xc0
add edx, 0xffffff80
jne 0x407870
movzx edx, byte [rbx + 2]
mov ecx, edx
and ecx, 0xc0
add ecx, 0xffffff80
jne 0x407870
shl esi, 0xc
shl eax, 6
and edx, 0x3f
movzx ecx, si
mov esi, eax
and esi, 0xfc0
or esi, ecx
or esi, edx
lea eax, [rsi - 0xd800]
cmp eax, 0x7ff
jbe 0x407870
cmp esi, 0x7ff
jbe 0x407870
jmp 0x407794
mov rdx, qword [rsp + 0x60]
lea rcx, [0x004b1173]
call fcn.00413ac0
mov rcx, qword [rsp + 0x60]
add rdi, 0x10
cmp rcx, rdi
je 0x4077f4
call fcn.004aaf10
jmp 0x4077f4
mov r9d, eax
xor r8d, r8d
xor ecx, ecx
xor edx, edx
jmp 0x4077d8
lea rcx, [0x004de040]
call fcn.004ab580
test eax, eax
je 0x40787f
call fcn.00414460
test al, al
mov esi, eax
je 0x407b8d
lea rcx, str.input
call fcn.00413d90
mov esi, eax
lea rcx, [0x004de040]
mov byte [0x004de048], sil
call fcn.004ab690
jmp 0x407886
lea rcx, [0x004b108b]
call fcn.004a50e0
mov rcx, qword [rsp + 0x60]
add rdi, 0x10
mov rbx, rax
cmp rcx, rdi
je 0x407bc7
call fcn.004aaf10
mov rcx, rbx
call fcn.00424a70
lea rcx, [0x004de040]
mov rbx, rax
call fcn.004ab530
jmp 0x407bc7
mov eax, esi
jmp 0x407a9c
lea rcx, [0x004b108b]
call fcn.004a50e0
jmp 0x407bb1