Function at 0x40bbf5
Capabilities:
Manipulate console buffer

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x824
mov eax, dword [0x5385d0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
xor ebx, ebx
push 0x7fe
mov dword [ebp - 0x81c], eax
lea eax, [ebp - 0x806]
push ebx
push eax
mov word [ebp - 0x808], bx
call fcn.004b7880
xor eax, eax
xor ecx, ecx
add esp, 0xc
cmp byte [ebp + 0x14], bl
lea edi, [ebp - 0x816]
setne cl
stosw word es:[edi], ax
mov edi, dword [ebp + 0xc]
mov eax, 0x400
mov dword [ebp - 0x80c], ebx
sub eax, ecx
cmp edi, eax
mov dword [ebp - 0x810], ebx
mov dword [ebp - 0x814], ebx
jl 0x40bc6d
mov eax, 0x3ff
sub eax, ecx
mov edi, eax
call fcn.0040d58e
lea ebx, [ebp - 0x810]
lea esi, [ebp - 0x80c]
mov dword [ebp - 0x820], eax
call fcn.0040d2d7
cmp byte [ebp + 0x14], 0
mov ax, word [ebp - 0x80c]
mov word [ebp - 0x818], ax
mov ax, word [ebp - 0x810]
mov word [ebp - 0x816], ax
je 0x40bcac
inc edi
test edi, edi
jle 0x40be2d
lea eax, [ebp - 0x814]
push eax
push dword [ebp - 0x818]
lea eax, [ebp - 0x808]
push edi
push eax
push dword [ebp - 0x820]
call dword [sym.imp.KERNEL32.dll_ReadConsoleOutputAttribute]
test eax, eax
je 0x40be61
cmp dword [ebp - 0x814], 0
je 0x40be61
cmp dword [ebp - 0x814], edi
je 0x40bd0e
push edi
push dword [ebp - 0x814]
push str.:8:ReadConsoleOutputAttribute___FAILED:_Read__ld__not__ld.
call fcn.00418e96
mov eax, dword [ebp - 0x814]
add esp, 0xc
mov edi, eax
xor eax, eax
cmp dword [ebp + 0x10], eax
je 0x40bd29
test edi, edi
jle 0x40bd3c
or word [ebp + eax*2 - 0x808], 8
inc eax
cmp eax, edi
jl 0x40bd19
jmp 0x40bd3c
test edi, edi
jle 0x40bd3c
and word [ebp + eax*2 - 0x808], 0xfff7
inc eax
cmp eax, edi
jl 0x40bd2d
cmp byte [ebp + 0x14], 0
je 0x40bd4e
lea eax, [ebp + eax*2 - 0x80a]
and word [eax], 0xfff7
lea eax, [ebp - 0x814]
push eax
push dword [ebp - 0x818]
lea eax, [ebp - 0x808]
push edi
push eax
push dword [ebp - 0x820]
call dword [sym.imp.KERNEL32.dll_WriteConsoleOutputAttribute]
mov esi, dword [sym.imp.KERNEL32.dll_WriteConsoleOutputCharacterA]
lea eax, [ebp - 0x814]
push eax
push dword [ebp - 0x818]
xor eax, eax
cmp byte [ebp + 0x14], al
mov ecx, edi
setne al
sub ecx, eax
push ecx
push dword [ebp - 0x81c]
push dword [ebp - 0x820]
call esi
call fcn.0040d4f6
and dword [ebp - 0x81c], 0
test edi, edi
mov ebx, eax
jle 0x40be2d
cmp byte [ebp + 0x14], 0
je 0x40bdf7
lea eax, [edi - 1]
cmp dword [ebp - 0x81c], eax
jne 0x40bdf7
mov ax, word [ebp - 0x80c]
mov word [ebp - 0x818], ax
mov ax, word [ebp - 0x810]
mov word [ebp - 0x816], ax
lea eax, [ebp - 0x814]
push eax
push dword [ebp - 0x818]
lea eax, [ebp + 0x14]
push 1
push eax
push dword [ebp - 0x820]
call esi
inc dword [ebp - 0x80c]
cmp dword [ebp - 0x80c], ebx
jl 0x40be1f
call fcn.0040d3dd
and dword [ebp - 0x80c], 0
inc dword [ebp - 0x810]
cmp dword [ebp - 0x810], eax
jge 0x40be51
inc dword [ebp - 0x81c]
cmp dword [ebp - 0x81c], edi
jl 0x40bdaf
push dword [ebp - 0x810]
push dword [ebp - 0x80c]
call fcn.0040d211
pop ecx
pop ecx
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004b7140
leave
ret
dec eax
dec ebx
mov dword [ebp - 0x810], eax
mov dword [ebp - 0x80c], ebx
jmp 0x40be2d
or eax, 0xffffffff
jmp 0x40be42