Function at 0x412112
Capabilities:
Manipulate console buffer

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x824
mov eax, dword [0x5f2e68]
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.005306b0
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 0x41218a
mov eax, 0x3ff
sub eax, ecx
mov edi, eax
call fcn.00414d12
lea ebx, [ebp - 0x810]
lea esi, [ebp - 0x80c]
mov dword [ebp - 0x820], eax
call fcn.00414880
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 0x4121c9
inc edi
test edi, edi
jle 0x41234a
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 0x41237e
cmp dword [ebp - 0x814], 0
je 0x41237e
cmp dword [ebp - 0x814], edi
je 0x41222b
push edi
push dword [ebp - 0x814]
push str.:8:ReadConsoleOutputAttribute___FAILED:_Read__ld__not__ld.
call fcn.0042b70b
mov eax, dword [ebp - 0x814]
add esp, 0xc
mov edi, eax
xor eax, eax
cmp dword [ebp + 0x10], eax
je 0x412246
test edi, edi
jle 0x412259
or word [ebp + eax*2 - 0x808], 8
inc eax
cmp eax, edi
jl 0x412236
jmp 0x412259
test edi, edi
jle 0x412259
and word [ebp + eax*2 - 0x808], 0xfff7
inc eax
cmp eax, edi
jl 0x41224a
cmp byte [ebp + 0x14], 0
je 0x41226b
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.00414c7a
and dword [ebp - 0x81c], 0
test edi, edi
mov ebx, eax
jle 0x41234a
cmp byte [ebp + 0x14], 0
je 0x412314
lea eax, [edi - 1]
cmp dword [ebp - 0x81c], eax
jne 0x412314
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 0x41233c
call fcn.00414b61
and dword [ebp - 0x80c], 0
inc dword [ebp - 0x810]
cmp dword [ebp - 0x810], eax
jge 0x41236e
inc dword [ebp - 0x81c]
cmp dword [ebp - 0x81c], edi
jl 0x4122cc
push dword [ebp - 0x810]
push dword [ebp - 0x80c]
call fcn.004147ba
pop ecx
pop ecx
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.005317e7
leave
ret
dec eax
dec ebx
mov dword [ebp - 0x810], eax
mov dword [ebp - 0x80c], ebx
jmp 0x41234a
or eax, 0xffffffff
jmp 0x41235f