Function at 0x40f7e0
Capabilities:
Manipulate console buffer

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, ecx
push esi
push ebx
sub esp, 0x5c
mov esi, dword [ebp + 8]
cmp byte [ecx], 0
je 0x40f978
mov dword [esp], 0x52555b
call fcn.0042a500
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40f852
mov eax, esi
call fcn.0040f550
lea eax, [ebp - 0x39]
mov dword [esp + 4], eax
lea ecx, [ebp - 0x30]
mov dword [esp], 0x525559
call fcn.004e3a40
lea eax, [ebp - 0x30]
sub esp, 8
call fcn.0040f550
mov eax, dword [ebp - 0x30]
lea ebx, [eax - 0xc]
cmp ebx, 0x51ef30
jne 0x40fa21
mov byte [edi + 1], 1
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 8
lea eax, [ebp - 0x30]
mov dword [esp + 4], eax
mov eax, dword [edi + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
movsx eax, word [ebp - 0x30]
sub esp, 8
mov dword [esp + 8], eax
lea eax, [ebp - 0x38]
mov dword [esp], eax
mov dword [esp + 4], esi
call fcn.0040f580
lea eax, [ebp - 0x38]
mov ecx, esi
mov dword [esp], eax
call fcn.004e25a0
mov eax, dword [ebp - 0x38]
lea ebx, [eax - 0xc]
sub esp, 4
cmp ebx, 0x51ef30
jne 0x40fa44
movzx edx, word [ebp - 0x30]
movzx ecx, word [ebp - 0x2c]
movzx eax, word [ebp - 0x2a]
mov dword [ebp - 0x50], 0x10000
movsx ebx, dx
mov word [ebp - 0x38], cx
test ebx, ebx
lea ecx, [edx + ecx - 1]
mov word [ebp - 0x50], dx
mov word [ebp - 0x36], ax
mov word [ebp - 0x34], cx
mov word [ebp - 0x32], ax
mov dword [ebp - 0x4c], 0
jne 0x40f9e0
xor ebx, ebx
test dx, dx
mov eax, dword [ebp - 0x4c]
je 0x40f92b
mov dword [ebp - 0x54], edi
mov edi, esi
mov esi, eax
nop
mov edx, dword [edi]
mov ecx, 0x20
cmp ebx, dword [edx - 0xc]
jae 0x40f910
mov ecx, dword [edx - 4]
test ecx, ecx
js 0x40f90c
mov ecx, edi
call fcn.004e1cf0
mov edx, dword [edi]
movzx ecx, byte [edx + ebx]
mov byte [esi], cl
movzx edx, word [ebp - 0x28]
add ebx, 1
add esi, 4
mov word [esi - 2], dx
movsx edx, word [ebp - 0x30]
cmp edx, ebx
ja 0x40f8f0
mov edi, dword [ebp - 0x54]
lea eax, [ebp - 0x38]
mov esi, dword [ebp - 0x4c]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x50]
mov dword [esp + 0xc], 0
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov eax, dword [edi + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WriteConsoleOutputW]
mov byte [edi + 1], 0
sub esp, 0x14
test esi, esi
je 0x40f848
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call fcn.00513970
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 8
lea ecx, [ebp - 0x30]
mov dword [esp], esi
call fcn.004e3ae0
lea ecx, [ebp - 0x30]
sub esp, 4
mov dword [esp + 4], 1
mov dword [esp], 0x525559
call fcn.004e27e0
lea eax, [ebp - 0x30]
sub esp, 8
call fcn.0040f550
mov eax, dword [ebp - 0x30]
lea ebx, [eax - 0xc]
cmp ebx, 0x51ef30
je 0x40f848
sub eax, 4
call fcn.00515d18
test eax, eax
jg 0x40f848
lea eax, [ebp - 0x38]
mov ecx, ebx
mov dword [esp], eax
call fcn.004e2310
push eax
jmp 0x40f848
cmp ebx, 0x3fffffff
ja 0x40fa1c
lea eax, [ebx*4]
mov dword [esp], eax
call fcn.00513a20
mov dword [ebp - 0x4c], eax
lea esi, [esi]
xor edx, edx
xor ecx, ecx
mov word [eax], dx
add eax, 4
mov word [eax - 2], cx
sub ebx, 1
jne 0x40fa00
movzx edx, word [ebp - 0x30]
jmp 0x40f8de
call fcn.0050e0f0
sub eax, 4
call fcn.00515d18
test eax, eax
jg 0x40f844
lea eax, [ebp - 0x38]
mov ecx, ebx
mov dword [esp], eax
call fcn.004e2310
push eax
jmp 0x40f844
sub eax, 4
call fcn.00515d18
test eax, eax
nop
jg 0x40f8a1
lea eax, [ebp - 0x39]
mov ecx, ebx
mov dword [esp], eax
call fcn.004e2310
push ebx
jmp 0x40f8a1