Function at 0x140005b18
Capabilities:
Manipulate console buffer

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r14
push r15
mov rbp, rsp
sub rsp, 0x80
mov rax, qword [0x14002f008]
xor rax, rsp
mov qword [rbp - 0x10], rax
mov ebx, ecx
mov r15, r9
mov ecx, edx
mov esi, r8d
mov r12d, edx
xor r14d, r14d
call fcn.14000ee3c
test eax, eax
je 0x140005c26
mov ecx, r12d
call qword [sym.imp.msvcrt.dll__get_osfhandle]
mov rcx, rax
lea rdx, [rbp - 0x40]
mov rdi, rax
call qword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x140005c26
movsx eax, word [rbp - 0x34]
movsx r14d, word [rbp - 0x30]
sub r14d, eax
dec r14d
and dword [rbp - 0x50], 0
mov r9, r15
mov r8d, esi
mov ecx, ebx
call fcn.140005c6c
lea rsi, [0x140042bf0]
mov r15d, eax
mov ebx, eax
test eax, eax
je 0x140005c5e
mov ecx, 0xa0
test rdi, rdi
je 0x140005c2d
cmp byte [0x14004b0c1], 0
jne 0x140017bfa
cmp r15d, ecx
mov ebx, r15d
cmova ebx, ecx
and qword [rsp + 0x20], 0
lea r9, [rbp - 0x50]
mov r8d, ebx
mov rdx, rsi
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
test eax, eax
je 0x140017d3c
xor ecx, ecx
mov dword [rbp - 0x50], ecx
mov eax, ebx
lea rsi, [rsi + rax*2]
sub r15d, ebx
jne 0x140005bad
test ecx, ecx
jne 0x140017d4c
mov eax, ecx
mov rcx, qword [rbp - 0x10]
xor rcx, rsp
call fcn.1400151c0
add rsp, 0x80
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret
xor edi, edi
jmp 0x140005b88
lea r8d, [rbx + rbx]
mov rdx, rsi
lea r9, [rbp - 0x48]
mov ecx, r12d
call fcn.14000eedc
test eax, eax
je 0x140005c51
mov eax, dword [rbp - 0x48]
mov ecx, ebx
add rcx, rcx
cmp rax, rcx
je 0x140005bee
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
mov ecx, eax
mov dword [rbp - 0x50], eax
jmp 0x140005bfe
mov ecx, dword [rbp - 0x50]
jmp 0x140005bfe
mov ecx, dword [0x14004b0f8]
cmp ecx, r14d
jb 0x140017d03
and dword [0x14004b0f8], 0
lea rdx, [rbp - 0x40]
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x140017cfd
mov r8d, dword [0x14004b0fc]
lea r9, [rbp - 0x50]
mov rdx, qword [0x14004b0f0]
mov rcx, rdi
and qword [rsp + 0x20], 0
call qword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
test eax, eax
je 0x140017cfd
mov ecx, 0xfffffff6
call qword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetStdHandle]
mov rcx, rax
call qword [sym.imp.api_ms_win_core_console_l2_1_0.dll_FlushConsoleInputBuffer]
lea rdx, [rbp - 0x4c]
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_console_l1_1_0.dll_GetConsoleMode]
xor edx, edx
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
call qword [sym.imp.msvcrt.dll__getch]
mov edx, dword [rbp - 0x4c]
mov rcx, rdi
mov ebx, eax
call qword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
lea rdx, [rbp - 0x28]
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
movsx ecx, word [rbp - 0x40]
movsx edx, word [rbp - 0x3a]
movsx r8d, word [rbp - 0x22]
mov r9d, dword [rbp - 0x3c]
imul edx, ecx
movsx ecx, word [rbp - 0x28]
imul r8d, ecx
mov rcx, rdi
movsx eax, r9w
sub r8d, edx
mov edx, 0x20
add r8d, eax
movsx eax, word [rbp - 0x24]
add r8d, eax
lea rax, [rbp - 0x50]
mov qword [rsp + 0x20], rax
call qword [sym.imp.api_ms_win_core_console_l2_1_0.dll_FillConsoleOutputCharacterW]
mov edx, dword [rbp - 0x3c]
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_console_l2_1_0.dll_SetConsoleCursorPosition]
cmp bx, 3
jne 0x140017cfd
call fcn.140022868
xor eax, eax
jmp 0x140005c08
mov ecx, dword [0x14004b0f8]
mov eax, r15d
mov rbx, rsi
lea rdx, [rsi + rax*2]
cmp rsi, rdx
jae 0x140017d31
cmp ecx, r14d
jae 0x140017d2b
movzx eax, word [rbx]
add rbx, 2
cmp ax, 0xa
jne 0x140017d26
inc ecx
cmp rbx, rdx
jb 0x140017d12
mov dword [0x14004b0f8], ecx
sub rbx, rsi
sar rbx, 1
jmp 0x140005bcd
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
mov ecx, eax
mov dword [rbp - 0x50], eax
jmp 0x140005bf3
cmp r12d, 2
jne 0x140005c06
lea ecx, [r12 - 1]
call fcn.140011814
int3