Function at 0x4127d1
Capabilities:
Manipulate console buffer

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x54
mov eax, dword [0x4310b4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov ebx, edx
mov dword [ebp - 0x3c], eax
push edi
mov esi, ecx
mov dword [ebp - 0x48], ebx
xor edi, edi
mov ecx, ebx
mov dword [ebp - 0x44], edi
call fcn.00408f90
test eax, eax
je 0x4128be
push ebx
call dword [sym.imp.msvcrt.dll__get_osfhandle]
mov ebx, eax
lea eax, [ebp - 0x1c]
pop ecx
push eax
push ebx
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x4128be
movsx eax, word [ebp - 0x10]
movsx edi, word [ebp - 0xc]
sub edi, eax
dec edi
mov dword [ebp - 0x44], edi
push dword [ebp - 0x3c]
and dword [ebp - 0x38], 0
mov ecx, esi
push dword [ebp + 8]
call fcn.00412107
mov ecx, eax
mov edx, 0x443b58
mov dword [ebp - 0x3c], ecx
mov esi, ecx
mov dword [ebp - 0x40], edx
test ecx, ecx
je 0x4128f4
test ebx, ebx
je 0x4128c5
cmp byte [0x44c133], 0
jne 0x422111
mov esi, 0xa0
cmp ecx, 0xa0
ja 0x41287a
mov esi, ecx
push 0
lea eax, [ebp - 0x38]
push eax
push esi
push edx
push ebx
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
test eax, eax
je 0x4128ec
xor eax, eax
mov edx, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x3c]
sub ecx, esi
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x3c], ecx
lea edx, [edx + esi*2]
mov dword [ebp - 0x40], edx
jne 0x41285a
test eax, eax
jne 0x422244
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00417b90
leave
ret 8
xor ebx, ebx
jmp 0x412832
lea ecx, [ebp - 0x54]
push ecx
mov ecx, dword [ebp - 0x48]
lea eax, [esi + esi]
push eax
call fcn.004090c0
test eax, eax
je 0x4128e1
lea eax, [esi + esi]
cmp dword [ebp - 0x54], eax
je 0x41288d
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [ebp - 0x38], eax
jmp 0x4128a5
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
jmp 0x41288f
mov eax, dword [ebp - 0x38]
jmp 0x4128a5
mov ecx, dword [0x44c5dc]
cmp ecx, edi
jb 0x4221e8
lea eax, [ebp - 0x1c]
xor esi, esi
push eax
push ebx
mov dword [0x44c5dc], esi
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x4221df
push esi
lea eax, [ebp - 0x38]
push eax
push dword [0x44c5d4]
push dword [0x44c5d8]
push ebx
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
test eax, eax
je 0x4221df
push 0xfffffffffffffff6
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetStdHandle]
push eax
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_FlushConsoleInputBuffer]
lea eax, [ebp - 0x4c]
push eax
push ebx
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_GetConsoleMode]
push esi
push ebx
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
call dword [sym.imp.msvcrt.dll__getch]
push dword [ebp - 0x4c]
movzx edi, ax
push ebx
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
lea eax, [ebp - 0x34]
push eax
push ebx
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
movsx ecx, word [ebp - 0x16]
lea eax, [ebp - 0x38]
movsx edx, word [ebp - 0x1c]
movsx esi, word [ebp - 0x34]
imul edx, ecx
movsx ecx, word [ebp - 0x2e]
push eax
mov eax, dword [ebp - 0x18]
imul esi, ecx
push eax
cwde
sub esi, edx
add esi, eax
movsx eax, word [ebp - 0x30]
add esi, eax
push esi
push 0x20
push ebx
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_FillConsoleOutputCharacterW]
push dword [ebp - 0x18]
push ebx
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_SetConsoleCursorPosition]
cmp edi, 3
je 0x42221b
mov edi, dword [ebp - 0x44]
mov ecx, dword [0x44c5dc]
mov edx, dword [ebp - 0x40]
mov eax, dword [ebp - 0x3c]
mov esi, edx
lea eax, [edx + eax*2]
mov dword [ebp - 0x50], eax
cmp edx, eax
jae 0x422212
cmp ecx, edi
jae 0x42220c
movzx eax, word [esi]
add esi, 2
cmp eax, 0xa
jne 0x422207
inc ecx
cmp esi, dword [ebp - 0x50]
jb 0x4221f7
mov dword [0x44c5dc], ecx
sub esi, edx
sar esi, 1
jmp 0x41287a
push dword [0x43561c]
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_EnterCriticalSection]
push dword [0x43561c]
mov dword [0x435614], 1
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x4128ad
cmp dword [ebp - 0x48], 2
jne 0x4128ad
push 0
call fcn.00411c10
test eax, eax
je 0x42224e
push 1
call dword [sym.imp.msvcrt.dll_exit]
int3