Function at 0x40790c
Capabilities:
Manipulate console buffer
Terminate process

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x54
mov eax, dword [0x42e0b4]
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.00409a11
test eax, eax
je 0x4079f9
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 0x4079f9
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.00407e93
mov ecx, eax
mov edx, 0x440af0
mov dword [ebp - 0x3c], ecx
mov esi, ecx
mov dword [ebp - 0x40], edx
test ecx, ecx
je 0x407a2f
test ebx, ebx
je 0x407a00
cmp byte [0x44905b], 0
jne 0x41ab9c
mov esi, 0xa0
cmp ecx, 0xa0
ja 0x4079b5
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 0x407a27
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 0x407995
test eax, eax
jne 0x41accf
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00416b30
leave
ret 8
xor ebx, ebx
jmp 0x40796d
lea ecx, [ebp - 0x54]
push ecx
mov ecx, dword [ebp - 0x48]
lea eax, [esi + esi]
push eax
call fcn.00409b3b
test eax, eax
je 0x407a1c
lea eax, [esi + esi]
cmp dword [ebp - 0x54], eax
je 0x4079c8
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [ebp - 0x38], eax
jmp 0x4079e0
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
jmp 0x4079ca
mov eax, dword [ebp - 0x38]
jmp 0x4079e0
mov ecx, dword [0x44950c]
cmp ecx, edi
jb 0x41ac73
lea eax, [ebp - 0x1c]
xor esi, esi
push eax
push ebx
mov dword [0x44950c], esi
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x41ac6a
push esi
lea eax, [ebp - 0x38]
push eax
push dword [0x449504]
push dword [0x449508]
push ebx
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
test eax, eax
je 0x41ac6a
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 0x41aca6
mov edi, dword [ebp - 0x44]
mov ecx, dword [0x44950c]
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 0x41ac9d
cmp ecx, edi
jae 0x41ac97
movzx eax, word [esi]
add esi, 2
cmp eax, 0xa
jne 0x41ac92
inc ecx
cmp esi, dword [ebp - 0x50]
jb 0x41ac82
mov dword [0x44950c], ecx
sub esi, edx
sar esi, 1
jmp 0x4079b5
push dword [0x4325a4]
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_EnterCriticalSection]
push dword [0x4325a4]
mov dword [0x43259c], 1
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x4079e8
cmp dword [ebp - 0x48], 2
jne 0x4079e8
push 0
call fcn.00411e70
test eax, eax
je 0x41acd9
push 1
call dword [sym.imp.msvcrt.dll_exit]
int3