Function at 0x4091a7
Capabilities:
Manipulate console buffer

Disassembly:
sub esp, 0x820
mov eax, dword [0x459bdc]
xor eax, esp
mov dword [esp + 0x81c], eax
cmp byte [0x45e230], 0
push ebx
mov ebx, dword [esp + 0x838]
push ebp
mov ebp, dword [esp + 0x830]
push esi
push edi
mov edi, dword [esp + 0x840]
mov dword [esp + 0x1c], ebx
je 0x409244
mov ecx, dword [0x45c5b0]
mov eax, dword [ecx + 0x20]
dec eax
cmp ebp, eax
jne 0x409244
mov esi, dword [esp + 0x83c]
lea eax, [edi + esi]
cmp eax, dword [ecx + 0x24]
jne 0x409244
sub edi, 1
je 0x409216
push ebx
push edi
push esi
push ebp
push dword [esp + 0x844]
call fcn.004091a7
add esp, 0x14
lea eax, [ebx + edi*4]
mov byte [0x45e230], 0
push eax
xor ebx, ebx
lea eax, [edi + esi]
inc ebx
push ebx
push eax
push ebp
push dword [esp + 0x844]
call fcn.004091a7
add esp, 0x14
mov byte [0x45e230], bl
jmp 0x4094b1
mov ebx, dword [esp + 0x834]
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x1c]
mov dword [esp + 0x18], ebx
push eax
mov eax, ebx
shr eax, 0x18
push eax
call fcn.00408939
mov si, word [esp + 0x2c]
xor edx, edx
xor ecx, ecx
add esp, 0xc
inc edx
cmp byte [0x45e230], cl
jne 0x40928c
push 0x10
pop eax
cmp word [esp + 0x18], ax
jge 0x40928c
mov byte [esp + 0x13], cl
cmp si, ax
jl 0x409290
mov byte [esp + 0x13], dl
mov eax, dword [0x45c5b0]
mov eax, dword [eax + 0x6c]
and eax, ebx
bt eax, 0x16
jae 0x4092c2
and ebx, 0xffbfffff
mov byte [esp + 0x12], dl
mov dword [esp + 0x14], ebx
cmp byte [0x45d034], cl
je 0x4092c6
and ebx, 0xffe9ffff
mov dword [esp + 0x14], ebx
jmp 0x4092c6
mov byte [esp + 0x12], cl
mov ax, word [esp + 0x18]
push 8
pop edx
test ebx, 0x800000
je 0x4092de
or ax, dx
mov word [esp + 0x18], ax
test ebx, 0x400000
je 0x4092ee
or si, dx
mov word [esp + 0x20], si
cmp byte [esp + 0x13], cl
je 0x409380
mov edx, ecx
test edi, edi
jle 0x409346
mov esi, dword [esp + 0x1c]
mov bl, byte [esp + 0x12]
push 0x20
pop ebp
mov ecx, dword [esi + edx*4]
mov eax, ecx
and eax, 0x1ff80
cmp eax, 0x10000
jne 0x409324
and ecx, 0x7f
mov ecx, dword [ecx*4 + 0x4599c0]
test bl, bl
je 0x409332
cmp byte [0x45d034], 0
cmovne ecx, ebp
mov byte [esp + edx + 0x2c], cl
inc edx
cmp edx, edi
jl 0x409309
mov ebx, dword [esp + 0x14]
mov ebp, dword [esp + 0x838]
mov eax, dword [esp + 0x83c]
push eax
push ebp
call fcn.0040911a
push ebx
push dword [esp + 0x2c]
push dword [esp + 0x28]
call fcn.004094ca
add esp, 0x14
xor eax, eax
push eax
push eax
push edi
lea eax, [esp + 0x38]
push eax
push dword [0x459008]
call dword [sym.imp.KERNEL32.dll_WriteConsoleA]
jmp 0x4094b1
cwde
movzx eax, word [eax*2 + 0x45e260]
mov dword [esp + 0x18], eax
mov ecx, eax
movsx eax, si
movzx eax, word [eax*2 + 0x45e260]
mov dword [esp + 0x20], eax
mov edx, eax
test ebx, 0x200000
je 0x4093b2
shl ecx, 4
or ecx, edx
movzx esi, cx
jmp 0x4093ba
shl edx, 4
or edx, ecx
movzx esi, dx
mov eax, esi
mov edx, ebx
or eax, 0x8000
and edx, 0x100000
movzx ecx, ax
movzx eax, si
mov esi, ebx
cmove ecx, eax
movzx edx, cx
mov eax, edx
or eax, 0x800
and esi, 0x40000
movzx ecx, ax
mov eax, edx
cmove ecx, eax
movzx edx, cx
mov eax, edx
or eax, 0x1000
and ebx, 0x20000
movzx ecx, ax
mov eax, edx
cmove ecx, eax
movzx eax, cx
mov dword [esp + 0x14], eax
test edi, edi
jle 0x40945c
mov esi, dword [esp + 0x1c]
xor ecx, ecx
push 0x20
pop ebx
mov ebp, eax
mov edx, dword [esi + ecx*4]
mov eax, edx
and eax, 0x1ff80
cmp eax, 0x10000
jne 0x409435
and edx, 0x7f
mov edx, dword [edx*4 + 0x4599c0]
cmp byte [esp + 0x12], 0
je 0x409446
cmp byte [0x45d034], 0
cmovne edx, ebx
mov word [esp + ecx*4 + 0x2e], bp
mov word [esp + ecx*4 + 0x2c], dx
inc ecx
cmp ecx, edi
jl 0x40941a
mov ebp, dword [esp + 0x838]
xor eax, eax
movzx ecx, di
mov dword [esp + 0x1c], eax
xor ebx, ebx
mov eax, dword [esp + 0x83c]
inc ebx
movzx eax, ax
mov word [esp + 0x14], cx
dec ecx
mov word [esp + 0x24], ax
add eax, ecx
mov word [esp + 0x28], ax
lea eax, [esp + 0x24]
push eax
push dword [esp + 0x20]
mov word [esp + 0x1e], bx
lea eax, [esp + 0x34]
push dword [esp + 0x1c]
mov word [esp + 0x36], bp
push eax
push dword [0x459008]
mov word [esp + 0x3a], bp
call dword [sym.imp.KERNEL32.dll_WriteConsoleOutputA]
mov ecx, dword [esp + 0x82c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040cfd1
add esp, 0x820
ret