Function at 0x40a65c
Capabilities:
Manipulate console buffer

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x824
mov eax, dword [0x5345d0]
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.004b53e0
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 0x40a6d4
mov eax, 0x3ff
sub eax, ecx
mov edi, eax
call fcn.0040bff5
lea ebx, [ebp - 0x810]
lea esi, [ebp - 0x80c]
mov dword [ebp - 0x820], eax
call fcn.0040bd3e
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 0x40a713
inc edi
test edi, edi
jle 0x40a894
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 0x40a8c8
cmp dword [ebp - 0x814], 0
je 0x40a8c8
cmp dword [ebp - 0x814], edi
je 0x40a775
push edi
push dword [ebp - 0x814]
push str.:8:ReadConsoleOutputAttribute___FAILED:_Read__ld__not__ld.
call fcn.004178df
mov eax, dword [ebp - 0x814]
add esp, 0xc
mov edi, eax
xor eax, eax
cmp dword [ebp + 0x10], eax
je 0x40a790
test edi, edi
jle 0x40a7a3
or word [ebp + eax*2 - 0x808], 8
inc eax
cmp eax, edi
jl 0x40a780
jmp 0x40a7a3
test edi, edi
jle 0x40a7a3
and word [ebp + eax*2 - 0x808], 0xfff7
inc eax
cmp eax, edi
jl 0x40a794
cmp byte [ebp + 0x14], 0
je 0x40a7b5
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.0040bf5d
and dword [ebp - 0x81c], 0
test edi, edi
mov ebx, eax
jle 0x40a894
cmp byte [ebp + 0x14], 0
je 0x40a85e
lea eax, [edi - 1]
cmp dword [ebp - 0x81c], eax
jne 0x40a85e
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 0x40a886
call fcn.0040be44
and dword [ebp - 0x80c], 0
inc dword [ebp - 0x810]
cmp dword [ebp - 0x810], eax
jge 0x40a8b8
inc dword [ebp - 0x81c]
cmp dword [ebp - 0x81c], edi
jl 0x40a816
push dword [ebp - 0x810]
push dword [ebp - 0x80c]
call fcn.0040bc78
pop ecx
pop ecx
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004b4c95
leave
ret
dec eax
dec ebx
mov dword [ebp - 0x810], eax
mov dword [ebp - 0x80c], ebx
jmp 0x40a894
or eax, 0xffffffff
jmp 0x40a8a9