Function at 0x4ad04e65
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.4ad0403c
test eax, eax
je 0x4ad05075
push dword [ebp + 0xc]
call dword [sym.imp.msvcrt.dll__get_osfhandle]
mov edi, eax
pop ecx
lea eax, [ebp - 0x28]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x4ad05075
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 0x4ad040a8
push dword [ebp + 8]
call fcn.4ad04f40
mov ebx, eax
test ebx, ebx
mov dword [ebp + 0x10], ebx
mov dword [ebp + 0x14], 0x4ad38b00
je 0x4ad04f27
mov esi, dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test edi, edi
je 0x4ad05050
cmp byte [0x4ad3cb94], 0
jne 0x4ad17655
mov ebx, 0xa0
cmp dword [ebp + 0x10], ebx
ja 0x4ad04efc
mov ebx, dword [ebp + 0x10]
push 0
lea eax, [ebp - 4]
push eax
push ebx
push dword [ebp + 0x14]
push edi
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x4ad17737
and dword [ebp - 4], 0
sub dword [ebp + 0x10], ebx
mov eax, dword [ebp + 0x14]
lea eax, [eax + ebx*2]
mov dword [ebp + 0x14], eax
jne 0x4ad04eda
cmp dword [ebp - 4], 0
jne 0x4ad17759
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret 0x10
lea ecx, [ebp - 0x10]
push ecx
lea eax, [ebx + ebx]
push eax
push dword [ebp + 0x14]
push dword [ebp + 0xc]
call fcn.4ad0469d
test eax, eax
je 0x4ad0507c
lea eax, [ebx + ebx]
cmp dword [ebp - 0x10], eax
je 0x4ad04f15
jmp 0x4ad0507c
xor edi, edi
jmp 0x4ad04ead
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4ad17751
mov eax, dword [0x4ad3d8e4]
cmp eax, dword [ebp - 8]
jb 0x4ad17700
mov ebx, dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
and dword [0x4ad3d8e4], 0
lea eax, [ebp - 0x28]
push eax
push edi
call ebx
test eax, eax
je 0x4ad17700
push 0
lea eax, [ebp - 4]
push eax
push dword [0x4ad3d8dc]
push dword [0x4ad3d8e0]
push edi
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x4ad17700
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 edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
push 0
push edi
call esi
call dword [sym.imp.msvcrt.dll__getch]
push dword [ebp - 0xc]
mov dword [ebp + 8], eax
push edi
call esi
lea eax, [ebp - 0x40]
push eax
push edi
call ebx
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x24]
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x28]
push eax
call fcn.4ad1e371
push eax
push 0x20
push edi
call dword [sym.imp.KERNEL32.dll_FillConsoleOutputCharacterW]
push dword [ebp - 0x24]
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
cmp word [ebp + 8], 3
je 0x4ad17745
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
lea ecx, [eax + ecx*2]
jmp 0x4ad17727
mov edx, dword [0x4ad3d8e4]
cmp edx, dword [ebp - 8]
jae 0x4ad1772b
mov dx, word [eax]
inc eax
inc eax
cmp dx, 0xa
jne 0x4ad17727
inc dword [0x4ad3d8e4]
cmp eax, ecx
jb 0x4ad1770b
sub eax, dword [ebp + 0x14]
sar eax, 1
mov ebx, eax
jmp 0x4ad04efc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x4ad04f19
call fcn.4ad11fa1
xor eax, eax
jmp 0x4ad04f34
mov dword [ebp - 4], eax
jmp 0x4ad04f27
cmp dword [ebp + 0xc], 2
jne 0x4ad04f31
push 1
call fcn.4ad06d45
int3