Function at 0x41f5d8
Capabilities:
Manipulate console buffer

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x54
mov eax, dword [0x4261d4]
xor eax, esp
mov dword [esp + 0x50], eax
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
push 0xfffffffffffffff5
mov edi, edx
mov dword [esp + 0x30], ecx
mov dword [esp + 0x1c], esi
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetStdHandle]
mov dword [esp + 0x14], eax
cmp eax, 0xffffffff
jne 0x41f61c
push 1
call dword [sym.imp.msvcrt.dll__get_osfhandle]
pop ecx
mov dword [esp + 0x14], eax
cmp byte [0x426004], 0
je 0x41fa01
push 0x20
pop ecx
cmp word [0x426010], cx
jae 0x41fa01
cmp word [0x42600c], cx
jae 0x41fa01
lea ecx, [esp + 0x44]
push ecx
push eax
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x41fa01
mov cl, byte [0x42600c]
xor edx, edx
mov esi, dword [esp + 0x48]
inc edx
xor eax, eax
shl edx, cl
mov cl, byte [0x426010]
inc eax
xor ebx, ebx
shl eax, cl
or edx, eax
mov dword [esp + 0x24], esi
mov dword [esp + 0x34], 0x10
mov dword [esp + 0x28], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x40], ebx
call fcn.004249e1
mov dword [0x441b10], ebx
mov dword [0x441b18], ebx
mov dword [0x441b1c], ebx
mov dword [0x441b14], ebx
push 0x4261a4
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_AcquireSRWLockShared]
lea eax, [esp + 0x34]
push eax
push dword [esp + 0x1c]
push dword [ebp + 8]
push edi
push dword [esp + 0x3c]
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_ReadConsoleW]
push 0x4261a4
mov dword [esp + 0x10], eax
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_ReleaseSRWLockShared]
cmp dword [0x426124], 0
mov eax, dword [esp + 0x18]
mov ecx, dword [eax]
mov dword [esp + 0x30], ecx
je 0x41f72f
push dword [0x42611c]
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_EnterCriticalSection]
push dword [0x42611c]
xor eax, eax
mov dword [0x426124], eax
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_LeaveCriticalSection]
test ebx, ebx
je 0x41f729
push ebx
xor eax, eax
push eax
call dword [sym.imp.api_ms_win_core_heap_l1_2_0.dll_GetProcessHeap]
push eax
call dword [sym.imp.api_ms_win_core_heap_l1_2_0.dll_HeapFree]
xor eax, eax
mov ebx, eax
jmp 0x41f731
xor eax, eax
cmp dword [esp + 0xc], 0
je 0x41f771
mov ecx, dword [esp + 0x18]
or edx, 0xffffffff
or dword [esp + 0x10], 0xffffffff
mov dword [esp + 0x1c], eax
cmp dword [ecx], 0
jbe 0x41f771
movzx ecx, word [edi + eax*2]
cmp ecx, 0xd
je 0x41f7a3
cmp cx, word [0x426010]
je 0x41f79d
cmp cx, word [0x42600c]
je 0x41f78f
mov ecx, dword [esp + 0x18]
inc eax
cmp eax, dword [ecx]
jb 0x41f74d
test ebx, ebx
je 0x41f786
push ebx
xor eax, eax
push eax
call dword [sym.imp.api_ms_win_core_heap_l1_2_0.dll_GetProcessHeap]
push eax
call dword [sym.imp.api_ms_win_core_heap_l1_2_0.dll_HeapFree]
mov eax, dword [esp + 0xc]
jmp 0x41fa29
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], 1
jmp 0x41f7a9
mov dword [esp + 0x10], eax
jmp 0x41f7ae
mov edx, eax
mov eax, dword [esp + 0x10]
cmp edx, 0xffffffff
jne 0x41f771
cmp eax, 0xffffffff
je 0x41f771
mov ecx, dword [esp + 0x18]
mov dword [ecx], eax
xor ecx, ecx
mov word [edi + eax*2], cx
test ebx, ebx
je 0x41f7fe
mov ecx, ebx
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x41f7ef
test dx, dx
je 0x41f7e9
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x41f7ef
add eax, 4
add ecx, 4
test dx, dx
jne 0x41f7c7
xor ecx, ecx
mov eax, ecx
jmp 0x41f7f6
sbb eax, eax
or eax, 1
xor ecx, ecx
mov dword [esp + 0xc], ecx
test eax, eax
je 0x41f806
mov dword [esp + 0xc], 1
cmp dword [esp + 0x1c], 0
jne 0x41f8b7
cmp dword [esp + 0x10], 2
jbe 0x41f8b7
push 3
push 0x41fa40
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x41f8af
push 3
push 0x41fa48
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x41f8af
push 3
push 0x41fa50
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x41f8af
push 6
push 0x41fa58
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x41f8af
push 6
push 0x41fa68
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x41f8af
push 6
push 0x41fa78
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x41f8af
push 6
push 0x41fa88
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x41f8b7
mov dword [esp + 0x1c], 1
mov al, byte [esp + 0x40]
mov ecx, edi
push dword [esp + 0xc]
mov edx, dword [ebp + 8]
not al
push dword [esp + 0x20]
movzx eax, al
shr eax, 4
and eax, 1
push eax
push dword [esp + 0x1c]
call fcn.0042479f
test eax, eax
je 0x41f976
lea eax, [esp + 0x44]
push eax
push dword [esp + 0x18]
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x41f91a
mov ax, word [esp + 0x24]
xor edx, edx
movsx ecx, word [esp + 0x44]
cwde
add eax, dword [esp + 0x10]
div ecx
mov ecx, dword [esp + 0x4a]
sub ecx, eax
mov word [esp + 0x26], cx
mov esi, dword [esp + 0x24]
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [esp + 0x28]
jne 0x41f91f
sub ecx, edx
push esi
push dword [esp + 0x18]
sar ecx, 1
mov dword [esp + 0x28], ecx
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_SetConsoleCursorPosition]
lea eax, [esp + 0x30]
push eax
push esi
push dword [esp + 0x38]
push 0x20
push dword [esp + 0x24]
call dword [sym.imp.api_ms_win_core_console_l2_1_0.dll_FillConsoleOutputCharacterW]
xor eax, eax
push eax
lea eax, [esp + 0x24]
push eax
push dword [esp + 0x28]
push edi
push dword [esp + 0x24]
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x38], eax
jmp 0x41f9a1
call fcn.00406c17
test al, al
je 0x41f987
push 0xffffffffffffffff
call dword [sym.imp.ext_ms_win_cmd_util_l1_1_0.dll_MessageBeepStub]
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [esp + 0x28]
jne 0x41f98c
sub ecx, edx
sar ecx, 1
mov dword [esp + 0x38], ecx
test ebx, ebx
je 0x41f9b8
push ebx
xor ebx, ebx
push ebx
call dword [sym.imp.api_ms_win_core_heap_l1_2_0.dll_GetProcessHeap]
push eax
call dword [sym.imp.api_ms_win_core_heap_l1_2_0.dll_HeapFree]
jmp 0x41f9ba
xor ebx, ebx
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x41f9bf
sub ecx, edx
sar ecx, 1
lea eax, [ecx + 1]
mov dword [esp + 0xc], eax
add eax, eax
push eax
push ebx
call dword [sym.imp.api_ms_win_core_heap_l1_2_0.dll_GetProcessHeap]
push eax
call dword [sym.imp.api_ms_win_core_heap_l1_2_0.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x41f9fd
mov edx, dword [esp + 0xc]
mov ecx, ebx
push edi
call fcn.00401da3
jmp 0x41f6b1
xor eax, eax
jmp 0x41fa29
mov ebx, 0x4261a4
push ebx
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_AcquireSRWLockShared]
push 0
push esi
push dword [ebp + 8]
push edi
push dword [esp + 0x3c]
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_ReadConsoleW]
push ebx
mov esi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_ReleaseSRWLockShared]
mov eax, esi
mov ecx, dword [esp + 0x5c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00401200
mov esp, ebp
pop ebp
ret 8