Function at 0x413730
Capabilities:
Manipulate console buffer

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x440
mov eax, dword [0x581900]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x404]
push esi
mov esi, dword [ebp + 0xc]
push 0x400
push 0
push eax
mov dword [ebp - 0x430], ebx
call fcn.004e69c0
push ebx
call fcn.004a75a0
add esp, 0x10
test eax, eax
jne 0x413bb1
call fcn.0040ed60
test eax, eax
je 0x413bb1
mov eax, dword [0x5884e8]
add eax, dword [0x5884f0]
mov word [ebp - 0x40c], ax
movzx eax, word [0x5884f2]
add ax, word [0x5884ea]
mov word [ebp - 0x40a], ax
mov eax, dword [0x5884ec]
sub eax, dword [0x5884f4]
mov word [ebp - 0x408], ax
movzx eax, word [0x5884ee]
sub ax, word [0x5884f6]
mov word [ebp - 0x406], ax
push dword [ebp - 0x408]
push dword [ebp - 0x40c]
call fcn.00457d30
add esp, 8
test eax, eax
js 0x413b9e
push dword [ebp - 0x408]
push dword [ebp - 0x40c]
call fcn.00457cf0
add esp, 8
test eax, eax
js 0x413b9e
lea eax, [ebp - 0x40c]
push eax
call fcn.004571b0
add esp, 4
test eax, eax
jne 0x413b9e
push esi
push ebx
push 0xffffffffffffffff
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.00413620
push 0
push 0x510e70
push 0x510e78
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.004a89e0
lea ecx, [ebp - 0x404]
add esp, 0x28
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x413860
sub ecx, edx
xor eax, eax
mov dx, word [0x5880d6]
test ecx, ecx
mov dword [ebp - 0x438], ecx
mov cx, word [0x5880d4]
mov dword [ebp - 0x420], eax
jle 0x413b65
mov si, word [ebp - 0x40c]
push edi
nop word [eax + eax]
lea eax, [ebp + eax - 0x404]
mov dword [ebp - 0x434], eax
mov al, byte [eax]
cmp al, 0xd
jne 0x4138c2
mov cx, si
mov word [0x5880d4], cx
jmp 0x413b4b
cmp al, 0xa
jne 0x4138db
inc dx
mov dword [ebp - 0x428], 0
mov word [0x5880d6], dx
jmp 0x4138ea
mov dword [ebp - 0x428], 1
cmp cx, si
jge 0x4138f4
mov cx, si
mov word [0x5880d4], cx
mov ax, word [ebp - 0x40a]
cmp dx, ax
jge 0x41390a
mov dx, ax
mov word [0x5880d6], dx
cmp cx, word [ebp - 0x408]
jle 0x413926
mov cx, si
inc dx
mov word [0x5880d4], cx
mov word [0x5880d6], dx
mov di, word [ebp - 0x406]
cmp dx, di
jle 0x413ac6
mov ebx, dword [ebp - 0x40a]
mov ax, word [ebp - 0x408]
dec ebx
cmp dword [0x587bec], 0
mov dword [ebp - 0x41c], 0
mov dword [ebp - 0x418], 0
mov word [ebp - 0x41c], si
mov word [ebp - 0x41a], bx
mov byte [ebp - 0x418], 0x20
mov word [ebp - 0x424], ax
mov word [ebp - 0x422], di
je 0x413996
call fcn.004d9850
sub eax, dword [0x587bf0]
cmp eax, 0xfa0
jb 0x4139c0
mov edi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
push 0xfffffffffffffff5
call edi
mov dword [0x587bec], eax
cmp eax, 0xffffffff
jne 0x4139b4
mov dword [0x587bec], 0
call fcn.004d9850
mov dword [0x587bf0], eax
jmp 0x4139c6
mov edi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
lea eax, [ebp - 0x43c]
push eax
push dword [ebp - 0x424]
lea eax, [ebp - 0x414]
push 1
push eax
push dword [0x587bec]
call dword [sym.imp.KERNEL32.dll_ReadConsoleOutputAttribute]
cmp dword [0x587bec], 0
mov ax, word [ebp - 0x414]
mov word [ebp - 0x416], ax
je 0x413a11
call fcn.004d9850
sub eax, dword [0x587bf0]
cmp eax, 0xfa0
jb 0x413a33
push 0xfffffffffffffff5
call edi
mov dword [0x587bec], eax
cmp eax, 0xffffffff
jne 0x413a29
mov dword [0x587bec], 0
call fcn.004d9850
mov dword [0x587bf0], eax
lea eax, [ebp - 0x418]
push eax
push dword [ebp - 0x41c]
lea eax, [ebp - 0x40c]
push eax
push eax
push dword [0x587bec]
call dword [sym.imp.KERNEL32.dll_ScrollConsoleScreenBufferA]
test eax, eax
jne 0x413aaa
cmp dword [0x5884fc], eax
jne 0x413aa0
push str._GetLastError_
movsx eax, bx
push eax
movsx eax, si
push eax
movsx eax, word [ebp - 0x408]
push eax
movsx eax, word [ebp - 0x406]
push eax
movsx eax, word [ebp - 0x40c]
push eax
movsx eax, word [ebp - 0x40a]
push eax
push dword [ebp - 0x430]
push str.:4:vCrintf__s__encountered_a_problem:_ScrollConsoleScreenBuffer_t_d_l_d_b_d_r_d__x_d__y_d__FAILED:__s
call fcn.00424fd0
add esp, 0x24
mov dword [0x5884fc], 1
mov dx, word [ebp - 0x406]
mov si, word [ebp - 0x40c]
mov cx, word [0x5880d4]
mov word [0x5880d6], dx
cmp dword [ebp - 0x428], 0
je 0x413b4b
mov eax, dword [ebp - 0x434]
movsx ebx, cx
inc cx
mov word [0x5880d4], cx
movsx edi, dx
mov al, byte [eax]
mov byte [ebp - 0x410], al
test ebx, ebx
js 0x413b4b
test edi, edi
js 0x413b4b
call fcn.0040e080
cmp ebx, eax
jge 0x413b36
call fcn.0040e1f0
cmp edi, eax
jge 0x413b36
lea eax, [ebp - 0x440]
mov word [ebp - 0x42c], bx
push eax
mov word [ebp - 0x42a], di
lea eax, [ebp - 0x410]
push dword [ebp - 0x42c]
push 1
push eax
call fcn.0040deb0
push eax
call dword [sym.imp.KERNEL32.dll_WriteConsoleOutputCharacterA]
mov cx, word [0x5880d4]
mov dx, word [0x5880d6]
mov si, word [ebp - 0x40c]
mov eax, dword [ebp - 0x420]
inc eax
mov dword [ebp - 0x420], eax
cmp eax, dword [ebp - 0x438]
jl 0x4138a0
pop edi
movsx eax, dx
push eax
movsx ecx, cx
push ecx
call fcn.00410800
add esp, 8
cmp dword [0x58579c], 0
jne 0x413b88
mov dword [0x5884f8], 0
mov eax, dword [ebp - 0x420]
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e50dc
mov esp, ebp
pop ebp
ret
cmp dword [0x58579c], 0
jne 0x413bb1
mov dword [0x5884f8], 0
mov ecx, dword [ebp - 4]
or eax, 0xffffffff
pop esi
xor ecx, ebp
pop ebx
call fcn.004e50dc
mov esp, ebp
pop ebp
ret