Function at 0x40bb44
Capabilities:
Manipulate console buffer

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x54
mov eax, dword [0x4261d4]
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 - 0x44], ebx
xor edi, edi
mov ecx, ebx
mov dword [ebp - 0x48], edi
call fcn.00405945
test eax, eax
je 0x40bd3f
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 0x40bd3f
movsx eax, word [ebp - 0x10]
movsx edi, word [ebp - 0xc]
sub edi, eax
dec edi
mov dword [ebp - 0x48], edi
push dword [ebp - 0x3c]
and dword [ebp - 0x38], 0
mov ecx, esi
push dword [ebp + 8]
call fcn.0040bc40
mov ecx, eax
mov edx, 0x439800
mov dword [ebp - 0x3c], ecx
mov esi, ecx
mov dword [ebp - 0x40], edx
test ecx, ecx
je 0x41265c
test ebx, ebx
je 0x40bd46
cmp byte [0x441818], 0
jne 0x41d2cf
mov esi, 0xa0
cmp ecx, 0xa0
ja 0x40bbf1
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 0x4167d3
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 0x40bbcd
test eax, eax
jne 0x41d411
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401200
mov esp, ebp
pop ebp
ret 8
xor ebx, ebx
jmp 0x40bba5
lea ecx, [ebp - 0x4c]
push ecx
mov ecx, dword [ebp - 0x44]
lea eax, [esi + esi]
push eax
call fcn.004059c9
test eax, eax
je 0x41d403
lea eax, [esi + esi]
cmp dword [ebp - 0x4c], eax
je 0x40bc08
jmp 0x41d403
mov eax, dword [ebp - 0x38]
jmp 0x40bc20
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
jmp 0x40bc0a
mov ecx, dword [0x441b28]
cmp ecx, edi
jb 0x41d3a6
lea eax, [ebp - 0x1c]
xor esi, esi
push eax
push ebx
mov dword [0x441b28], esi
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x41d39d
push esi
lea eax, [ebp - 0x38]
push eax
push dword [0x441b30]
push dword [0x441b2c]
push ebx
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
test eax, eax
je 0x41d39d
push 0xfffffffffffffff6
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetStdHandle]
push eax
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_FlushConsoleInputBuffer]
lea eax, [ebp - 0x54]
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 - 0x54]
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 - 0x2e]
lea eax, [ebp - 0x38]
movsx esi, word [ebp - 0x34]
movsx edx, word [ebp - 0x1c]
imul esi, ecx
movsx ecx, word [ebp - 0x16]
imul edx, ecx
movsx ecx, word [ebp - 0x30]
push eax
mov eax, dword [ebp - 0x18]
push eax
sub esi, edx
cwde
add esi, ecx
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 0x41d3da
mov edi, dword [ebp - 0x48]
mov ecx, dword [0x441b28]
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 0x41d3d1
cmp ecx, edi
jae 0x41d3cb
mov ax, word [esi]
add esi, 2
cmp ax, 0xa
jne 0x41d3c6
inc ecx
cmp esi, dword [ebp - 0x50]
jb 0x41d3b5
mov dword [0x441b28], ecx
sub esi, edx
sar esi, 1
jmp 0x40bbf1
push dword [0x42611c]
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_EnterCriticalSection]
push dword [0x42611c]
mov dword [0x426124], 1
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x40bc28
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
mov dword [ebp - 0x38], eax
jmp 0x40bc20
cmp dword [ebp - 0x44], 2
jne 0x40bc28
xor ecx, ecx
inc ecx
call fcn.00409959
int3