Function at 0x4ad057ae
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.4ad013c1
test eax, eax
je 0x4ad05993
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 0x4ad05993
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 0x4ad023a8
push dword [ebp + 8]
call fcn.4ad05889
mov esi, eax
test esi, esi
mov dword [ebp + 0x10], esi
mov dword [ebp + 0x14], 0x4ad345e0
je 0x4ad05870
mov edi, dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test ebx, ebx
je 0x4ad0596e
cmp byte [0x4ad4060c], 0
jne 0x4ad1901f
mov esi, 0xa0
cmp dword [ebp + 0x10], esi
ja 0x4ad05845
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 0x4ad19102
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 0x4ad05823
cmp dword [ebp - 4], 0
jne 0x4ad19124
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.4ad034bf
test eax, eax
je 0x4ad0599a
lea eax, [esi + esi]
cmp dword [ebp - 0x10], eax
je 0x4ad0585e
jmp 0x4ad0599a
xor ebx, ebx
jmp 0x4ad057f6
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4ad1911c
mov eax, dword [0x4ad408e0]
cmp eax, dword [ebp - 8]
jb 0x4ad190cb
and dword [0x4ad408e0], 0
lea eax, [ebp - 0x28]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x4ad190cb
push 0
lea eax, [ebp - 4]
push eax
push dword [0x4ad408d8]
push dword [0x4ad408dc]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x4ad190cb
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.4ad1f382
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 0x4ad19110
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
lea ecx, [eax + ecx*2]
jmp 0x4ad190f2
mov edx, dword [0x4ad408e0]
cmp edx, dword [ebp - 8]
jae 0x4ad190f6
mov dx, word [eax]
inc eax
inc eax
cmp dx, 0xa
jne 0x4ad190f2
inc dword [0x4ad408e0]
cmp eax, ecx
jb 0x4ad190d6
sub eax, dword [ebp + 0x14]
sar eax, 1
mov esi, eax
jmp 0x4ad05845
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x4ad05862
call fcn.4ad1daee
xor eax, eax
jmp 0x4ad0587d
mov dword [ebp - 4], eax
jmp 0x4ad05870
cmp dword [ebp + 0xc], 2
jne 0x4ad0587a
push 1
call fcn.4ad07131
int3