Function at 0x40785c
Capabilities:
Manipulate console buffer
Terminate process

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x54
mov eax, dword [0x42d0b4]
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.00409951
test eax, eax
je 0x407949
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 0x407949
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.00407de3
mov ecx, eax
mov edx, 0x43fae0
mov dword [ebp - 0x3c], ecx
mov esi, ecx
mov dword [ebp - 0x40], edx
test ecx, ecx
je 0x40797f
test ebx, ebx
je 0x407950
cmp byte [0x448047], 0
jne 0x41aa3a
mov esi, 0xa0
cmp ecx, 0xa0
ja 0x407905
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 0x407977
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 0x4078e5
test eax, eax
jne 0x41ab6d
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00416ad0
leave
ret 8
xor ebx, ebx
jmp 0x4078bd
lea ecx, [ebp - 0x54]
push ecx
mov ecx, dword [ebp - 0x48]
lea eax, [esi + esi]
push eax
call fcn.00409a7b
test eax, eax
je 0x40796c
lea eax, [esi + esi]
cmp dword [ebp - 0x54], eax
je 0x407918
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [ebp - 0x38], eax
jmp 0x407930
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
jmp 0x40791a
mov eax, dword [ebp - 0x38]
jmp 0x407930
mov ecx, dword [0x4484fc]
cmp ecx, edi
jb 0x41ab11
lea eax, [ebp - 0x1c]
xor esi, esi
push eax
push ebx
mov dword [0x4484fc], esi
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x41ab08
push esi
lea eax, [ebp - 0x38]
push eax
push dword [0x4484f4]
push dword [0x4484f8]
push ebx
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
test eax, eax
je 0x41ab08
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 0x41ab44
mov edi, dword [ebp - 0x44]
mov ecx, dword [0x4484fc]
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 0x41ab3b
cmp ecx, edi
jae 0x41ab35
movzx eax, word [esi]
add esi, 2
cmp eax, 0xa
jne 0x41ab30
inc ecx
cmp esi, dword [ebp - 0x50]
jb 0x41ab20
mov dword [0x4484fc], ecx
sub esi, edx
sar esi, 1
jmp 0x407905
push dword [0x431594]
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_EnterCriticalSection]
push dword [0x431594]
mov dword [0x43158c], 1
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x407938
cmp dword [ebp - 0x48], 2
jne 0x407938
push 0
call fcn.00411df0
test eax, eax
je 0x41ab77
push 1
call dword [sym.imp.msvcrt.dll_exit]
int3