Function at 0x404a90
Capabilities:
Manipulate console buffer

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
push ebx
push esi
push edi
push 0xfffffffffffffff5
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp dword [0x24c21f8], 0
mov esi, eax
je 0x404b0b
cmp dword [0x4b8000], 0x3a4
jne 0x404b0b
mov ecx, str.Terminal
mov eax, 0x4b8084
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x404aed
test dx, dx
je 0x404ae9
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x404aed
add eax, 4
add ecx, 4
test dx, dx
jne 0x404ac7
xor eax, eax
jmp 0x404af2
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x404b0b
mov eax, dword [0x4b60e0]
mov ecx, dword [0x4b60dc]
push eax
push ecx
call fcn.00402f80
add esp, 8
lea edx, [esp + 0x20]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x26]
test cx, cx
jne 0x404b32
movsx ebx, ax
lea edx, [edi - 1]
cmp ebx, edx
jle 0x404ddc
movsx edx, word [esp + 0x2a]
movsx ebx, word [esp + 0x2e]
sub ebx, edx
inc ebx
mov edx, ebx
mov ebx, dword [ebp + 8]
cmp edx, ebx
jne 0x404d4d
movsx edx, word [esp + 0x30]
movsx ecx, cx
sub edx, ecx
inc edx
cmp edx, edi
jne 0x404d4d
mov eax, dword [0x4b8038]
mov ecx, dword [0x4b8008]
lea edx, [esp + 0x2a]
push edx
push eax
push ecx
push 0x24c2200
push esi
call dword [sym.imp.KERNEL32.dll_ReadConsoleOutputA]
xor edx, edx
xor eax, eax
mov word [esp + 0x18], dx
mov word [esp + 0x1a], ax
lea ecx, [ebx - 1]
lea eax, [esp + 0x18]
push eax
mov word [esp + 0x20], cx
mov ecx, dword [0x4b8038]
lea edx, [edi - 1]
push ecx
mov word [esp + 0x26], dx
mov edx, dword [0x4b8008]
push edx
push 0x24c2200
push esi
call dword [sym.imp.KERNEL32.dll_WriteConsoleOutputA]
mov eax, dword [esp + 0x26]
mov ecx, dword [esp + 0x2c]
cwde
lea edx, [edi - 1]
cmp eax, edx
mov dword [esp + 0x14], eax
jle 0x404c0d
mov ax, word [esp + 0x24]
mov word [esp + 0x10], ax
mov eax, dword [esp + 0x14]
movsx ecx, cx
sub eax, ecx
cmp edx, eax
mov word [esp + 0x12], dx
jl 0x404bef
mov word [esp + 0x12], ax
mov edx, dword [esp + 0x10]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
mov ecx, dword [esp + 0x2c]
mov byte [0x4b800e], 1
mov byte [0x4b8033], 0
movsx eax, word [esp + 0x2a]
movsx edx, word [esp + 0x2e]
sub edx, eax
lea eax, [edx + 1]
cmp eax, ebx
mov dword [esp + 0x14], eax
jl 0x404c28
mov dword [esp + 0x14], ebx
movsx eax, word [esp + 0x30]
movsx edx, cx
sub eax, edx
inc eax
cmp eax, edi
jl 0x404c39
mov eax, edi
xor edx, edx
lea eax, [eax + ecx - 1]
mov word [esp + 0x1a], cx
lea ecx, [esp + 0x18]
mov word [esp + 0x18], dx
mov edx, dword [esp + 0x14]
push ecx
push 1
dec edx
push esi
mov word [esp + 0x28], dx
mov word [esp + 0x2a], ax
call dword [sym.imp.KERNEL32.dll_SetConsoleWindowInfo]
mov word [esp + 0x10], bx
mov word [esp + 0x12], di
mov edx, dword [esp + 0x10]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_SetConsoleScreenBufferSize]
xor ecx, ecx
mov word [esp + 0x1a], cx
lea ecx, [esp + 0x18]
xor eax, eax
push ecx
mov word [esp + 0x1c], ax
push 1
lea edx, [ebx - 1]
lea eax, [edi - 1]
push esi
mov word [esp + 0x28], dx
mov word [esp + 0x2a], ax
call dword [sym.imp.KERNEL32.dll_SetConsoleWindowInfo]
test eax, eax
jne 0x404ccd
push 5
push eax
push eax
push eax
push eax
push eax
call fcn.00402a00
push eax
call dword [sym.imp.USER32.dll_SetWindowPos]
lea edx, [esp + 0x18]
push edx
push 1
push esi
call dword [sym.imp.KERNEL32.dll_SetConsoleWindowInfo]
mov word [0x4b8008], bx
movsx esi, bx
mov word [0x4b800a], di
movsx ebx, di
xor edi, edi
lea edx, [edi + 7]
mov dword [0x4b8bdc], esi
mov dword [0x4b802c], ebx
mov dword [0x25f2560], edi
call fcn.00404e70
mov eax, ebx
imul eax, esi
add eax, eax
cmp eax, 0x8000
jl 0x404d10
mov eax, 0x8000
cmp eax, 0x4000
mov ecx, dword [0x4b80c8]
lea edx, [eax + ecx]
mov ecx, dword [0x25f24a0]
mov dword [0x24c21d4], edx
lea edx, [eax + ecx]
mov dword [0x4b8020], edx
jle 0x404de4
mov eax, 0x8000
mov dword [0x4b80dc], 1
jmp 0x404e23
movsx edx, ax
lea ecx, [edi - 1]
cmp edx, ecx
jle 0x404bbe
mov edx, eax
xor ecx, ecx
sub edx, edi
mov word [esp + 0x1e], ax
inc edx
lea eax, [esp + 0x18]
push eax
mov word [esp + 0x1c], cx
mov ecx, dword [0x4b8038]
push ecx
mov word [esp + 0x22], dx
mov edx, dword [0x4b8008]
push edx
push 0x24c2200
dec ebx
push esi
mov word [esp + 0x30], bx
call dword [sym.imp.KERNEL32.dll_ReadConsoleOutputA]
xor eax, eax
xor ecx, ecx
mov word [esp + 0x18], ax
lea eax, [esp + 0x18]
push eax
mov word [esp + 0x1e], cx
mov ecx, dword [0x4b8038]
lea edx, [edi - 1]
push ecx
mov word [esp + 0x26], dx
mov edx, dword [0x4b8008]
push edx
push 0x24c2200
push esi
mov word [esp + 0x30], bx
call dword [sym.imp.KERNEL32.dll_WriteConsoleOutputA]
mov eax, dword [esp + 0x26]
mov ebx, dword [ebp + 8]
jmp 0x404bbe
mov ebx, dword [ebp + 8]
jmp 0x404bc2
cmp eax, 0x2000
jle 0x404dfc
mov eax, 0x4000
mov dword [0x4b80dc], 2
jmp 0x404e23
cmp eax, 0x1000
jle 0x404e14
mov eax, 0x2000
mov dword [0x4b80dc], 4
jmp 0x404e23
mov eax, 0x1000
mov dword [0x4b80dc], 8
mov word [0x4b944c], ax
mov al, bl
mov dword [0x25f24cc], edi
mov dword [0x25f24d0], edi
pop edi
lea ecx, [esi*8 - 8]
mov word [0x4b944a], si
lea edx, [ebx*8 - 8]
dec al
pop esi
mov byte [0x4b9484], al
mov dword [0x25f24c4], ecx
mov dword [0x25f24c8], edx
mov byte [0x26112b2], 1
pop ebx
mov esp, ebp
pop ebp
ret