Function at 0x4ad097ca
Capabilities:
Manipulate console buffer

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x40
push ebx
push esi
push edi
push dword [ebp + 0xc]
call fcn.4ad04490
test eax, eax
je 0x4ad099ca
push dword [ebp + 0xc]
call dword [sym.imp.msvcrt.dll__get_osfhandle]
mov ebx, eax
pop ecx
lea eax, [ebp - 0x28]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x4ad099ca
movsx ecx, word [ebp - 0x1c]
movsx eax, word [ebp - 0x18]
sub eax, ecx
dec eax
mov dword [ebp - 8], eax
push dword [ebp + 0x14]
and dword [ebp - 4], 0
push dword [ebp + 0x10]
push 0x4ad025b8
push dword [ebp + 8]
call fcn.4ad098a5
mov esi, eax
mov dword [ebp + 0x10], esi
mov dword [ebp + 0x14], 0x4ad34640
test esi, esi
je 0x4ad0988c
mov edi, dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test ebx, ebx
je 0x4ad099a5
cmp byte [0x4ad406a4], 0
jne 0x4ad1991d
mov esi, 0xa0
cmp dword [ebp + 0x10], esi
ja 0x4ad09861
mov esi, dword [ebp + 0x10]
push 0
lea eax, [ebp - 4]
push eax
push esi
push dword [ebp + 0x14]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x4ad19a00
and dword [ebp - 4], 0
sub dword [ebp + 0x10], esi
mov eax, dword [ebp + 0x14]
lea eax, [eax + esi*2]
mov dword [ebp + 0x14], eax
jne 0x4ad0983f
cmp dword [ebp - 4], 0
jne 0x4ad19a22
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret 0x10
lea ecx, [ebp - 0x10]
push ecx
lea eax, [esi + esi]
push eax
push dword [ebp + 0x14]
push dword [ebp + 0xc]
call fcn.4ad0453e
test eax, eax
je 0x4ad099d1
lea eax, [esi + esi]
cmp dword [ebp - 0x10], eax
je 0x4ad0987a
jmp 0x4ad099d1
xor ebx, ebx
jmp 0x4ad09812
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4ad19a1a
mov eax, dword [0x4ad40924]
cmp eax, dword [ebp - 8]
jb 0x4ad199c9
and dword [0x4ad40924], 0
lea eax, [ebp - 0x28]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x4ad199c9
push 0
lea eax, [ebp - 4]
push eax
push dword [0x4ad4091c]
push dword [0x4ad40920]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x4ad199c9
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_FlushConsoleInputBuffer]
lea eax, [ebp - 0xc]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
push 0
push ebx
call edi
call dword [sym.imp.msvcrt.dll__getch]
push dword [ebp - 0xc]
movzx esi, ax
push ebx
call edi
lea eax, [ebp - 0x40]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x24]
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x28]
push eax
call fcn.4ad1fd20
push eax
push 0x20
push ebx
call dword [sym.imp.KERNEL32.dll_FillConsoleOutputCharacterW]
push dword [ebp - 0x24]
push ebx
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
cmp si, 3
je 0x4ad19a0e
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
lea ecx, [eax + ecx*2]
jmp 0x4ad199f0
mov edx, dword [0x4ad40924]
cmp edx, dword [ebp - 8]
jae 0x4ad199f4
mov dx, word [eax]
inc eax
inc eax
cmp dx, 0xa
jne 0x4ad199f0
inc dword [0x4ad40924]
cmp eax, ecx
jb 0x4ad199d4
sub eax, dword [ebp + 0x14]
sar eax, 1
mov esi, eax
jmp 0x4ad09861
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x4ad0987e
call fcn.4ad1e702
xor eax, eax
jmp 0x4ad09899
mov dword [ebp - 4], eax
jmp 0x4ad0988c
cmp dword [ebp + 0xc], 2
jne 0x4ad09896
push 1
call fcn.4ad072e9
int3