Function at 0x462140
Capabilities:
Manipulate console buffer

Disassembly:
mov eax, dword [esp + 0x1c]
sub esp, 0x18
cmp eax, 3
push ebx
push ebp
push esi
push edi
je 0x4624fa
mov ebp, dword [0x49fc04]
mov dword [esp + 0x20], ebp
mov eax, dword [ebp + 0x14]
mov dword [esp + 0x10], eax
mov eax, dword [0x49ad1c]
test eax, eax
je 0x4621b2
mov eax, dword [0x4b55a4]
test eax, eax
jne 0x4621b2
mov esi, dword [esp + 0x2c]
test esi, esi
jne 0x4621a7
mov ecx, dword [ebp + 0x10]
mov edi, dword [esp + 0x30]
imul ecx, dword [ebp + 0xc]
cmp edi, ecx
jne 0x4621ab
mov ecx, dword [esp + 0x34]
xor eax, eax
test edi, edi
jle 0x4621bc
mov dl, byte [ecx]
inc ecx
cmp dl, 0x20
jne 0x4621ab
inc eax
cmp eax, edi
jl 0x462198
jmp 0x4621ba
mov edi, dword [esp + 0x30]
call fcn.004613d0
jmp 0x4621ba
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x30]
test edi, edi
je 0x4624d5
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x34]
mov ebp, edi
lea ebx, [eax + esi*4]
mov eax, dword [esp + 0x10]
lea edx, [esi + ecx]
mov ecx, dword [eax + 0xc]
mov dword [esp + 0x24], edx
mov dword [esp + 0x38], ecx
call fcn.004610d0
test eax, eax
je 0x4622c5
mov edx, dword [esp + 0x10]
mov byte [esp + 0x14], 0
mov eax, dword [edx + 0x1c]
cmp byte [eax + esi], 2
jne 0x46221e
mov eax, esi
cdq
idiv dword [esp + 0x38]
test edx, edx
jle 0x46221e
mov eax, dword [esp + 0x10]
mov eax, dword [eax + 0x1c]
mov cl, byte [eax + esi - 1]
lea eax, [esi - 1]
cmp cl, 2
jne 0x462220
mov eax, esi
mov edx, dword [esp + 0x10]
mov ecx, esi
sub ecx, eax
mov edx, dword [edx + 0x1c]
add ecx, edi
add edx, eax
add ecx, eax
mov dword [esp + 0x34], edx
mov edx, dword [esp + 0x10]
mov edi, dword [edx + 4]
add edi, eax
cmp eax, ecx
jge 0x46229a
sub ecx, eax
mov dword [esp + 0x1c], ecx
mov eax, dword [esp + 0x14]
and eax, 0xff
dec eax
je 0x46227d
mov al, byte [edi]
push eax
call dword [sym.imp.KERNEL32.dll_IsDBCSLeadByte]
test eax, eax
je 0x46226f
mov eax, dword [esp + 0x34]
mov byte [esp + 0x14], 1
mov byte [eax], 1
jmp 0x462289
mov eax, dword [esp + 0x34]
mov byte [esp + 0x14], 0
mov byte [eax], 0
jmp 0x462289
mov eax, dword [esp + 0x34]
mov byte [esp + 0x14], 2
mov byte [eax], 2
inc eax
inc edi
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x1c]
dec eax
mov dword [esp + 0x1c], eax
jne 0x462248
mov ecx, dword [esp + 0x30]
lea eax, [esi + ecx]
cdq
idiv dword [esp + 0x38]
test edx, edx
jle 0x4622c1
mov edx, dword [esp + 0x10]
mov eax, dword [edx + 0x1c]
add eax, esi
cmp byte [eax + ecx - 1], 1
jne 0x4622c1
mov eax, ecx
inc eax
mov dword [esp + 0x30], eax
mov edi, dword [esp + 0x30]
mov ecx, dword [esp + 0x38]
mov eax, esi
cdq
idiv ecx
mov word [esp + 0x32], ax
mov eax, esi
cdq
idiv ecx
mov ecx, dword [esp + 0x24]
mov word [esp + 0x30], dx
mov eax, dword [esp + 0x30]
lea edx, [esp + 0x18]
push edx
mov edx, dword [0x4b558c]
push eax
push edi
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteConsoleOutputCharacterA]
mov esi, dword [ebx]
add ebx, 4
mov ecx, esi
call fcn.004639a0
dec ebp
mov dword [esp + 0x34], eax
test esi, esi
jne 0x46233d
mov ecx, dword [esp + 0x10]
and eax, 0xffff
test ebp, ebp
mov edx, dword [ecx + 0x20]
mov edi, 1
mov eax, dword [edx + eax*4 + 0x10]
mov dword [ebx - 4], eax
jle 0x462353
cmp dword [ebx], 0
jne 0x462353
inc edi
mov dword [ebx], eax
dec ebp
add ebx, 4
test ebp, ebp
jg 0x46232b
jmp 0x462353
test ebp, ebp
mov edi, 1
jle 0x462353
cmp esi, dword [ebx]
jne 0x462353
inc edi
dec ebp
add ebx, 4
test ebp, ebp
jg 0x462346
mov ecx, dword [esp + 0x2c]
mov esi, dword [esp + 0x38]
mov eax, ecx
cdq
idiv esi
mov word [esp + 0x32], ax
mov eax, ecx
cdq
idiv esi
mov eax, dword [0x4b559c]
test eax, eax
mov word [esp + 0x30], dx
je 0x4623eb
movsx ecx, dx
mov eax, esi
sub eax, ecx
cmp edi, eax
jle 0x4623eb
mov ecx, dword [esp + 0x30]
lea edx, [esp + 0x18]
mov esi, edi
push edx
mov edx, dword [esp + 0x38]
push ecx
sub esi, eax
push eax
mov eax, dword [0x4b558c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_FillConsoleOutputAttribute]
inc word [esp + 0x32]
mov word [esp + 0x30], 0
test esi, esi
jle 0x462408
mov eax, dword [esp + 0x38]
cmp eax, esi
jle 0x4623c1
mov eax, esi
xor esi, esi
jmp 0x4623c3
sub esi, eax
mov edx, dword [esp + 0x30]
lea ecx, [esp + 0x18]
push ecx
mov ecx, dword [0x4b558c]
push edx
push eax
mov eax, dword [esp + 0x40]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FillConsoleOutputAttribute]
inc word [esp + 0x32]
test esi, esi
jg 0x4623b3
jmp 0x462408
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
lea edx, [esp + 0x18]
push edx
mov edx, dword [0x4b558c]
push eax
push edi
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_FillConsoleOutputAttribute]
mov ecx, dword [esp + 0x2c]
add ecx, edi
test ebp, ebp
mov dword [esp + 0x2c], ecx
jg 0x4622fa
mov edi, dword [0x4b558c]
mov eax, dword [0x4b55cc]
cmp edi, eax
je 0x46243c
push edi
mov dword [0x4b55cc], edi
call dword [sym.imp.KERNEL32.dll_SetConsoleActiveScreenBuffer]
mov edi, dword [0x4b558c]
mov ebp, dword [esp + 0x20]
mov eax, dword [esp + 0x44]
test eax, eax
jle 0x4624fa
movsx ecx, word [0x4b52a6]
mov eax, dword [esp + 0x40]
mov esi, dword [0x4b52ac]
cmp ecx, eax
mov ecx, dword [esp + 0x3c]
jne 0x46247d
movsx edx, word [0x4b52a4]
cmp edx, ecx
jne 0x46247d
mov ebx, dword [esp + 0x10]
xor edx, edx
mov dl, byte [ebx + 0x1a]
cmp edx, esi
je 0x4624fa
mov word [0x4b52a4], cx
mov word [0x4b52a6], ax
cmp eax, dword [ebp + 0xc]
jge 0x4624e0
cmp ecx, dword [ebp + 0x10]
jge 0x4624e0
mov eax, dword [esp + 0x10]
mov cl, byte [eax + 0x1a]
test cl, cl
je 0x4624e0
test esi, esi
jne 0x4624bf
push 0x4b52a8
push edi
mov dword [0x4b52ac], 1
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorInfo]
mov edi, dword [0x4b558c]
mov ecx, dword [0x4b52a4]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov edi, dword [0x4b558c]
jmp 0x462440
test esi, esi
je 0x4624fa
push 0x4b52a8
push edi
mov dword [0x4b52ac], 0
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorInfo]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret