Function at 0x140018690
Capabilities:
Manipulate console buffer

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
mov rbx, rdx
mov rbp, rcx
mov rcx, rdx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov ecx, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__get_osfhandle]
mov rsi, rax
mov eax, 0xffffffff
cmp rsi, 0xffffffffffffffff
je 0x14001881b
mov rcx, rbx
call fcn.140087e98
lea rdx, [rsp + 0x30]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x140018800
movzx edx, byte [rbp]
test edx, edx
je 0x140018800
nop dword [rax + rax]
mov rbx, rbp
nop dword [rax + rax]
movzx eax, byte [rbx + 1]
lea r8d, [rdx - 0x80]
mov ecx, edx
mov r9, rbx
add rbx, 1
cmp r8d, 0x1f
movzx edx, al
mov r12d, edx
jbe 0x1400188b8
cmp ecx, 0x1b
sete cl
test al, al
je 0x140018800
sub eax, 0x40
cmp al, 0x1f
ja 0x140018700
test cl, cl
je 0x140018700
lea rbx, [r9 + 2]
mov edx, 2
movzx eax, byte [rbx]
test al, al
je 0x140018816
mov rdi, rbx
jmp 0x140018763
movzx eax, byte [rdi]
test al, al
je 0x140018816
sub eax, 0x40
mov r13, rdi
add rdi, 1
cmp eax, 0x3e
ja 0x140018758
movsxd rax, edx
mov r8, rbx
mov rdx, rbp
sub r8, rax
mov rcx, rsi
sub r8, rbp
call fcn.140018490
movzx eax, byte [r13]
shl eax, 8
or eax, r12d
cmp ax, 0x465b
je 0x140018d1b
jg 0x140018830
cmp ax, 0x435b
je 0x140018ca8
jg 0x1400188d0
cmp ax, 0x415b
je 0x140018af8
cmp ax, 0x425b
jne 0x1400187f0
cmp r13, rbx
je 0x140018e0d
lea r15, [rsp + 0x38]
mov rcx, rbx
mov r8d, 0xa
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebx, eax
je 0x140018e12
mov rbp, rdi
movzx edx, byte [rbp]
test edx, edx
jne 0x1400186f8
nop
mov rcx, rbp
call sub.api_ms_win_crt_string_l1_1_0.dll_strlen
mov rdx, rbp
mov rcx, rsi
mov r8, rax
call fcn.140018490
mov eax, 1
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp ax, 0x4b5b
je 0x140018c40
jg 0x140018958
cmp ax, 0x485b
je 0x140018b6a
cmp ax, 0x4a5b
je 0x140018a89
cmp ax, 0x475b
jne 0x1400187f0
cmp r13, rbx
je 0x140018ee5
lea r15, [rsp + 0x38]
mov r8d, 0xa
mov rcx, rbx
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebp, eax
jne 0x1400187f0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
mov eax, ebp
mov ebx, dword [rsp + 0x44]
sub eax, 1
jns 0x140018f01
xor edx, edx
jmp 0x140018f0d
lea r12d, [rcx - 0x40]
mov edx, 1
jmp 0x140018743
cmp ax, 0x445b
je 0x140018a1d
cmp ax, 0x455b
jne 0x1400187f0
cmp r13, rbx
je 0x140018ed1
lea r15, [rsp + 0x38]
mov r8d, 0xa
mov rcx, rbx
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebp, eax
jne 0x1400187f0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
movsx ecx, word [rsp + 0x46]
movsx edx, word [rsp + 0x42]
mov eax, ecx
mov ebx, edx
sub edx, ecx
add eax, ebp
cmp edx, ebp
cmovg ebx, eax
mov rcx, rsi
mov rbp, rdi
shl ebx, 0x10
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
jmp 0x1400187f3
cmp ax, 0x665b
je 0x140018b6a
cmp ax, 0x6d5b
jne 0x1400187f0
cmp r13, rbx
je 0x140018fff
lea r15, [rsp + 0x38]
xor r14d, r14d
xor ebp, ebp
lea r12, [0x1400b9670]
nop word cs:[rax + rax]
mov rcx, rbx
mov r8d, 0xa
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
mov rbx, qword [rsp + 0x38]
cmp byte [rbx], 0x3b
je 0x1400189b0
cmp rbx, r13
jne case.0x1400189be.38
cmp eax, 0x31
ja case.0x1400189be.2
mov edx, eax
movsxd rdx, dword [r12 + rdx*4]
add rdx, r12
jmp rdx
or ebp, 7
mov r14d, 0xffffffff
nop dword [rax]
add rbx, 1
cmp rbx, r13
jne 0x140018990
cmp r14w, 0xffff
jne 0x140018dca
test bp, 0x4000
movzx edx, bp
je 0x140018a0c
mov edx, ebp
mov eax, ebp
shl ebp, 4
shr dx, 4
xor al, al
and edx, 0xf
or edx, eax
movzx eax, bpl
or edx, eax
and edx, 0xbfff
mov rcx, rsi
mov rbp, rdi
call qword [sym.imp.KERNEL32.dll_SetConsoleTextAttribute]
jmp 0x1400187f3
cmp r13, rbx
je 0x140018edb
lea r15, [rsp + 0x38]
mov r8d, 0xa
mov rcx, rbx
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebp, eax
jne 0x1400187f0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
movsx edx, word [rsp + 0x44]
mov rcx, rsi
mov ebx, dword [rsp + 0x44]
mov eax, edx
sub eax, ebp
cmp edx, ebp
mov edx, 0
cmovle eax, edx
mov bx, ax
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
jmp 0x1400187f0
cmp r13, rbx
je 0x140018f92
lea r15, [rsp + 0x38]
mov rcx, rbx
mov r8d, 0xa
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebx, eax
jne 0x1400187f0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
cmp ebx, 1
je 0x140019032
cmp ebx, 2
je 0x140019018
test ebx, ebx
je 0x140018fa8
movsx eax, word [rsp + 0x42]
xor ecx, ecx
xor ebx, ebx
xor edx, edx
jmp 0x140018fc7
cmp r13, rbx
je 0x140018fe6
lea r15, [rsp + 0x38]
mov rcx, rbx
mov r8d, 0xa
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebx, eax
jne 0x1400187f0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
movsx edx, word [rsp + 0x46]
mov eax, edx
sub eax, ebx
cmp edx, ebx
mov edx, 0
cmovle eax, edx
movzx ebx, word [rsp + 0x44]
shl eax, 0x10
mov rcx, rsi
mov rbp, rdi
or ebx, eax
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
jmp 0x1400187f3
cmp r13, rbx
je 0x140018ff0
mov r8, r13
mov edx, 0x3b
mov rcx, rbx
lea r15, [rsp + 0x38]
sub r8, rbx
call sub.api_ms_win_crt_private_l1_1_0.dll_memchr
mov r8d, 0xa
mov rdx, r15
mov rcx, rbx
test rax, rax
mov rbp, rax
je 0x140018df1
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp rbp, qword [rsp + 0x38]
mov ebx, eax
jne 0x1400187f0
lea rcx, [rbp + 1]
mov r8d, 0xa
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebp, eax
jne 0x1400187f0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
movsx eax, word [rsp + 0x4c]
movsx edx, word [rsp + 0x4a]
lea eax, [rbx + rax - 1]
lea ecx, [rbp + rdx - 1]
xor edx, edx
test eax, eax
js 0x140018c11
movsx r8d, word [rsp + 0x42]
mov edx, r8d
cmp eax, r8d
cmovle edx, eax
xor eax, eax
test ecx, ecx
js 0x140018c26
movsx r8d, word [rsp + 0x40]
mov eax, r8d
cmp ecx, r8d
cmovle eax, ecx
shl edx, 0x10
movzx eax, ax
mov ebx, edx
mov rcx, rsi
or ebx, eax
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
jmp 0x1400187f0
cmp r13, rbx
je 0x140018f20
lea r15, [rsp + 0x38]
mov rcx, rbx
mov r8d, 0xa
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebx, eax
jne 0x1400187f0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
test ebx, ebx
movzx edx, word [rsp + 0x46]
je 0x140018f3b
cmp ebx, 1
je 0x140019009
movsx ebp, word [rsp + 0x40]
xor eax, eax
jmp 0x140018f49
cmp r13, rbx
je 0x140018ec7
lea r15, [rsp + 0x38]
mov r8d, 0xa
mov rcx, rbx
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebp, eax
jne 0x1400187f0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
movsx r8d, word [rsp + 0x44]
movsx ecx, word [rsp + 0x40]
mov ebx, dword [rsp + 0x44]
mov edx, r8d
mov eax, ecx
sub ecx, r8d
add edx, ebp
cmp ecx, ebp
mov rcx, rsi
cmovg eax, edx
mov bx, ax
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
jmp 0x1400187f0
cmp r13, rbx
je 0x140018ebd
lea r15, [rsp + 0x38]
mov rcx, rbx
mov r8d, 0xa
mov rdx, r15
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebx, eax
jne 0x1400187f0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
movsx edx, word [rsp + 0x46]
mov eax, edx
sub eax, ebx
cmp edx, ebx
mov ebx, 0
jmp 0x14001893a
mov edx, eax
and ebp, 0xffffff8f
and edx, 1
shl edx, 6
or ebp, edx
mov edx, ebp
or edx, 0x20
test al, 2
cmovne ebp, edx
mov edx, ebp
or edx, 0x10
test al, 4
cmovne ebp, edx
or r14d, 0x70
jmp case.0x1400189be.2
lea ecx, [rax - 0x1e]
mov edx, eax
and ebp, 0xfffffff8
and edx, 1
shl edx, 2
or ebp, edx
mov edx, ebp
or edx, 2
test al, 2
cmove ebp, edx
mov eax, ebp
or eax, 1
and ecx, 4
cmovne ebp, eax
or r14d, 7
jmp case.0x1400189be.2
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400189e4
mov eax, r14d
not eax
and ax, word [rsp + 0x48]
or ebp, eax
jmp 0x1400189e4
call sub.api_ms_win_crt_convert_l1_1_0.dll_strtol
cmp qword [rsp + 0x38], r13
mov ebp, 1
mov ebx, eax
jne 0x1400187f0
jmp 0x140018bd4
mov ebx, 1
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
movsx r8d, word [rsp + 0x46]
movsx ecx, word [rsp + 0x42]
mov edx, r8d
mov eax, ecx
sub ecx, r8d
add edx, ebx
cmp ecx, ebx
cmovg eax, edx
jmp 0x140018b4d
and bp, 0xbfff
or r14w, 0x4000
jmp case.0x1400189be.2
and bpl, 0x7f
or r14b, 0x80
jmp case.0x1400189be.2
or ebp, 7
or r14d, 7
jmp case.0x1400189be.2
and ebp, 0xffffff8f
or r14d, 0x70
jmp case.0x1400189be.2
and bp, 0x7fff
or r14w, 0x8000
jmp case.0x1400189be.2
and ebp, 0xfffffff7
or r14d, 8
jmp case.0x1400189be.2
or bp, 0x4000
jmp case.0x1400189be.2
or bpl, 0x80
jmp case.0x1400189be.2
or bp, 0x8000
jmp case.0x1400189be.2
or ebp, 8
jmp case.0x1400189be.2
mov ebx, 1
jmp 0x140018d47
mov ebp, 1
jmp 0x140018cd4
mov ebp, 1
jmp 0x140018910
mov ebp, 1
jmp 0x140018a49
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
mov ebx, dword [rsp + 0x44]
xor eax, eax
movsx ecx, word [rsp + 0x40]
mov edx, ecx
cmp ecx, eax
cmovge edx, eax
mov bx, dx
mov rcx, rsi
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
jmp 0x1400187f0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
movzx edx, word [rsp + 0x46]
movsx ecx, word [rsp + 0x44]
movsx ebp, word [rsp + 0x40]
mov eax, ecx
sub ebp, ecx
shl edx, 0x10
movzx eax, ax
mov ebx, edx
or ebx, eax
mov r8d, ebp
mov edx, 0x20
lea r12, [rsp + 0x34]
mov r9d, ebx
mov rcx, rsi
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_FillConsoleOutputCharacterW]
mov r8d, ebp
movzx edx, word [rsp + 0x48]
mov r9d, ebx
mov qword [rsp + 0x20], r12
mov rcx, rsi
mov rbp, rdi
call qword [sym.imp.KERNEL32.dll_FillConsoleOutputAttribute]
jmp 0x1400187f3
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x1400187f0
movsx eax, word [rsp + 0x44]
movsx edx, word [rsp + 0x40]
movsx r8d, word [rsp + 0x46]
mov ebx, eax
sub edx, eax
movsx eax, word [rsp + 0x50]
mov ecx, r8d
sub eax, r8d
test eax, eax
js 0x1400187f0
movsx ebp, word [rsp + 0x40]
movzx ebx, bx
imul ebp, eax
mov eax, ecx
shl eax, 0x10
add ebp, edx
jmp 0x140018f51
mov ebx, 1
jmp 0x140018b24
mov ebp, 1
mov ebx, 1
jmp 0x140018bd4
mov edx, 7
jmp 0x140018a0c
movsx ebp, word [rsp + 0x44]
xor eax, eax
add ebp, 1
jmp 0x140018f49
movsx edx, word [rsp + 0x4c]
movsx eax, word [rsp + 0x50]
movzx ebx, word [rsp + 0x4a]
mov ecx, edx
sub eax, edx
xor edx, edx
add eax, 1
jmp 0x140018fc7
movsx r8d, word [rsp + 0x4c]
xor ebx, ebx
movsx edx, word [rsp + 0x44]
movsx eax, word [rsp + 0x46]
mov ecx, r8d
add edx, 1
sub eax, r8d
jmp 0x140018fc7