Function at 0x407e40
Capabilities:
Manipulate console buffer

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x84c
cmp byte [0x414605], 0
mov edi, dword [esp + 0x870]
je 0x407e72
mov eax, dword [0x412040]
mov esi, dword [eax + 0x20]
lea ebx, [esi - 1]
cmp ebx, dword [esp + 0x864]
je 0x4081ba
lea eax, [esp + 0x36]
mov dword [esp + 8], eax
lea eax, [esp + 0x34]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x860]
shr eax, 0x18
mov dword [esp], eax
call sym._pair_content
cmp byte [0x414605], 0
mov eax, 1
jne 0x407eb5
cmp word [esp + 0x34], 0xf
jg 0x407eb5
xor eax, eax
cmp word [esp + 0x36], 0xf
setg al
mov edx, dword [0x412040]
test byte [edx + 0x6e], 0x40
je 0x408080
test dword [esp + 0x860], 0x400000
je 0x408080
xor edx, edx
cmp byte [0x412301], 0
je 0x40821d
and dword [esp + 0x860], 0xffa9ffff
mov ebp, 1
test dword [esp + 0x860], 0x800000
je 0x407f10
or word [esp + 0x34], 8
nop
lea esi, [esi]
test edx, edx
je 0x407f1a
or word [esp + 0x36], 8
test eax, eax
lea ebx, [esp + 0x40]
je 0x407fa0
mov edx, dword [esp + 0x86c]
test edx, edx
jle 0x408131
movzx eax, byte [0x412dc2]
xor edx, edx
lea ebx, [esp + 0x40]
mov esi, 0x20
mov byte [esp + 0x2f], al
movzx eax, byte [0x412301]
mov byte [esp + 0x2e], al
jmp 0x407f73
test ebp, ebp
je 0x407f60
cmp byte [esp + 0x2e], 0
cmovne eax, esi
mov byte [ebx + edx], al
add edx, 1
cmp edx, dword [esp + 0x86c]
je 0x408135
mov eax, dword [edi + edx*4]
mov ecx, eax
and ecx, 0x1ff80
cmp ecx, 0x10000
jne 0x407f54
and eax, 0x7f
cmp byte [esp + 0x2f], 0
mov eax, dword [eax*4 + 0x40e180]
je 0x407f54
cmp ax, 0x1f
ja 0x407f54
lea esi, [esi]
movsx eax, word [esp + 0x34]
movsx edx, word [esp + 0x36]
test dword [esp + 0x860], 0x200000
movzx eax, word [eax + eax + 0x412da0]
movzx edx, word [edx + edx + 0x412da0]
mov word [esp + 0x34], ax
mov word [esp + 0x36], dx
jne 0x4080ab
mov esi, edx
shl esi, 4
or esi, eax
mov eax, esi
or ax, 0x8000
test dword [esp + 0x860], 0x100000
cmovne esi, eax
mov eax, esi
or ah, 8
test dword [esp + 0x860], 0x40000
cmovne esi, eax
mov eax, esi
or ah, 0x10
test dword [esp + 0x860], 0x20000
cmovne esi, eax
mov eax, dword [esp + 0x86c]
test eax, eax
jle 0x4080c0
movzx eax, byte [0x412301]
xor edx, edx
mov byte [esp + 0x2e], al
jmp 0x40805a
test ebp, ebp
je 0x408045
cmp byte [esp + 0x2e], 0
mov ecx, 0x20
cmovne eax, ecx
mov word [ebx + edx*4 + 2], si
mov word [ebx + edx*4], ax
add edx, 1
cmp edx, dword [esp + 0x86c]
je 0x4080c0
mov eax, dword [edi + edx*4]
mov ecx, eax
and ecx, 0x1ff80
cmp ecx, 0x10000
jne 0x408034
and eax, 0x7f
mov eax, dword [eax*4 + 0x40e180]
jmp 0x408034
mov edx, dword [esp + 0x860]
xor ebp, ebp
and edx, 0x400000
test dword [esp + 0x860], 0x800000
je 0x407f10
or word [esp + 0x34], 8
jmp 0x407f10
shl eax, 4
mov esi, eax
or esi, edx
jmp 0x407fdc
movzx edi, word [esp + 0x864]
movzx eax, word [esp + 0x86c]
movzx esi, word [esp + 0x86c]
mov dword [esp + 0xc], 0
mov dword [esp + 4], ebx
mov word [esp + 0x3e], di
mov word [esp + 0x3a], di
or eax, 0x10000
movzx edi, word [esp + 0x868]
mov dword [esp + 8], eax
mov eax, dword [0x40e384]
lea edx, [esi + edi - 1]
mov word [esp + 0x38], di
mov dword [esp], eax
mov word [esp + 0x3c], dx
lea edx, [esp + 0x38]
mov dword [esp + 0x10], edx
call dword [sym.imp.KERNEL32.dll_WriteConsoleOutputA]
sub esp, 0x14
add esp, 0x84c
pop ebx
pop esi
pop edi
pop ebp
ret
lea ebx, [esp + 0x40]
movzx edx, word [esp + 0x868]
mov eax, dword [esp + 0x864]
shl eax, 0x10
or eax, edx
mov dword [esp + 4], eax
mov eax, dword [0x40e384]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
sub esp, 8
mov eax, dword [esp + 0x860]
mov dword [esp + 8], eax
movsx eax, word [esp + 0x36]
mov dword [esp + 4], eax
movsx eax, word [esp + 0x34]
mov dword [esp], eax
call sym.__set_ansi_color
mov eax, dword [esp + 0x86c]
mov dword [esp + 4], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov eax, dword [0x40e384]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WriteConsoleA]
sub esp, 0x14
add esp, 0x84c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [esp + 0x868]
add edx, dword [esp + 0x86c]
cmp edx, dword [eax + 0x24]
jne 0x407e72
mov esi, dword [esp + 0x86c]
sub esi, 1
jne 0x408232
lea eax, [edi + esi*4]
add esi, dword [esp + 0x868]
mov dword [esp + 0xc], 1
mov dword [esp + 4], ebx
mov byte [0x414605], 0
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x860]
mov dword [esp + 8], esi
mov dword [esp], eax
call sym.__new_packet
mov byte [0x414605], 1
jmp 0x408126
and dword [esp + 0x860], 0xffbfffff
mov ebp, 1
jmp 0x40808f
mov eax, dword [esp + 0x868]
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], esi
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x860]
mov dword [esp], eax
call sym.__new_packet
jmp 0x4081dd