Function at 0x1001654
Capabilities:
Manipulate console buffer

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x48c
mov eax, dword [0x1007008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
xor ebx, ebx
push edi
mov esi, 0x1f8
push esi
mov dword [ebp - 0x424], eax
lea eax, [ebp - 0x214]
push ebx
push eax
mov dword [ebp - 0x418], ebx
mov dword [ebp - 0x448], ebx
mov dword [ebp - 0x420], ebx
mov dword [ebp - 0x438], ebx
mov dword [ebp - 0x218], ebx
call sub.msvcrt.dll_memset
xor eax, eax
mov dword [ebp - 0x1c], ebx
lea edi, [ebp - 0x18]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push esi
stosd dword es:[edi], eax
lea eax, [ebp - 0x410]
push ebx
push eax
mov dword [ebp - 0x41c], ebx
mov dword [ebp - 0x414], ebx
call sub.msvcrt.dll_memset
add esp, 0x18
xor eax, eax
push 9
mov word [ebp - 0x42c], ax
lea edi, [ebp - 0x42a]
stosw word es:[edi], ax
pop ecx
mov word [ebp - 0x474], ax
lea edi, [ebp - 0x470]
push ebx
mov dword [ebp - 0x434], ebx
mov dword [ebp - 0x440], ebx
mov dword [ebp - 0x428], ebx
mov dword [ebp - 0x430], ebx
rep stosd dword es:[edi], eax
call dword [sym.imp.KERNEL32.dll_SetThreadUILanguage]
push ebx
push ebx
xor edi, edi
inc edi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_HeapSetInformation]
cmp dword [ebp - 0x424], ebx
jne 0x100174f
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.01001e85
push 0x20001
call dword [sym.imp.msvcrt.dll___iob_func]
add eax, 0x40
push eax
call fcn.0100378c
jmp 0x1001c95
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x448]
push eax
lea eax, [ebp - 0x438]
push eax
push dword [ebp - 0x424]
push dword [ebp + 8]
call fcn.0100139e
test eax, eax
jne 0x1001796
push 0x20001
call dword [sym.imp.msvcrt.dll___iob_func]
add eax, 0x40
push eax
call fcn.0100378c
jmp 0x1001c90
cmp dword [ebp - 0x448], ebx
jne 0x10017b6
cmp dword [ebp - 0x420], ebx
jne 0x10017ae
cmp dword [ebp - 0x438], ebx
je 0x10017c4
cmp dword [ebp - 0x420], edi
je 0x10017c4
cmp dword [ebp - 0x438], edi
jne 0x10017f3
cmp dword [ebp + 8], 2
jbe 0x10017ec
push 0x9b
call fcn.01003774
push eax
call dword [sym.imp.msvcrt.dll___iob_func]
add eax, 0x40
push eax
call fcn.01002866
mov ebx, edi
call fcn.010026fa
mov eax, ebx
jmp 0x1001c97
call fcn.01001370
jmp 0x10017e0
mov esi, dword [sym.imp.msvcrt.dll__errno]
call esi
mov dword [eax], ebx
push 0xa
lea eax, [ebp - 0x434]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
mov dword [ebp - 0x43c], eax
cmp dword [ebp - 0x434], ebx
je 0x1001838
push ebx
push dword [ebp - 0x434]
call fcn.0100207b
test eax, eax
jne 0x1001c76
call esi
cmp dword [eax], 0x22
je 0x1001c76
mov eax, dword [ebp - 0x43c]
inc eax
cmp eax, 0x186a0
ja 0x1001c76
lea eax, [ebp - 0x418]
push eax
call fcn.01001355
test eax, eax
je 0x10017de
mov esi, dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
cmp dword [ebp - 0x420], edi
jne 0x10018a5
push edi
push 0x1001572
call esi
test eax, eax
jne 0x10018a5
push 0x10001
call dword [sym.imp.msvcrt.dll___iob_func]
add eax, 0x40
push eax
call fcn.0100378c
call fcn.010026fa
push ebx
push ebx
call esi
jmp 0x1001c95
call fcn.010015b3
cmp eax, edi
jne 0x10018ca
push 0x259
call fcn.01003774
push eax
call dword [sym.imp.msvcrt.dll___iob_func]
add eax, 0x40
push eax
call fcn.01002866
jmp 0x1001897
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edi, eax
lea eax, [ebp - 0x428]
push eax
push edi
mov dword [ebp - 0x444], edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
jne 0x1001911
push 0x10001
call dword [sym.imp.msvcrt.dll___iob_func]
add eax, 0x40
push eax
call fcn.0100378c
call fcn.010026fa
push ebx
push ebx
call esi
xor eax, eax
inc eax
jmp 0x1001c97
and dword [ebp - 0x428], 0xffffffe1
push dword [ebp - 0x428]
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test eax, eax
je 0x10018ec
lea eax, [ebp - 0x430]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetNumberOfConsoleInputEvents]
test eax, eax
je 0x10018ec
push edi
call dword [sym.imp.KERNEL32.dll_FlushConsoleInputBuffer]
test eax, eax
je 0x10018ec
mov edi, dword [ebp - 0x43c]
cmp edi, 0xffffffff
jne 0x100198e
cmp dword [ebp - 0x420], ebx
jne 0x1001960
push 0x97
jmp 0x1001965
push 0x9d
call fcn.01003774
mov edi, dword [sym.imp.msvcrt.dll___iob_func]
push eax
call edi
add eax, 0x20
push eax
call fcn.01002866
mov eax, dword [ebp - 0x418]
inc eax
mov dword [ebp - 0x424], eax
jmp 0x1001ae1
mov eax, dword [ebp - 0x418]
add eax, edi
cmp edi, 0xa
mov dword [ebp - 0x424], eax
jge 0x10019ad
mov dword [ebp - 0x41c], 1
jmp 0x10019e6
cmp edi, 0x64
jge 0x10019be
mov dword [ebp - 0x41c], 2
jmp 0x10019e6
cmp edi, 0x3e8
jge 0x10019d2
mov dword [ebp - 0x41c], 3
jmp 0x10019e6
xor eax, eax
cmp edi, 0x2710
setge al
add eax, 4
mov dword [ebp - 0x41c], eax
push 0xc
push dword [ebp - 0x41c]
lea eax, [ebp - 0x1c]
push 0x10011dc
push eax
call fcn.01002d58
test eax, eax
jne 0x1001a0a
push 0x20001
jmp 0x10018f1
mov ecx, 0x1fc
lea eax, [ebp - 0x218]
mov byte [eax], bl
inc eax
dec ecx
jne 0x1001a15
push edi
push dword [ebp - 0x41c]
push 0x98
call fcn.01003774
push eax
lea eax, [ebp - 0x218]
push 0xfe
push eax
call fcn.010015f5
add esp, 0x14
cmp eax, ebx
jge 0x1001a59
movzx eax, ax
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.01001e85
jmp 0x10018ec
mov edi, dword [sym.imp.msvcrt.dll___iob_func]
lea eax, [ebp - 0x218]
push eax
call edi
add eax, 0x20
push eax
call fcn.01002866
push 0x16
pop ecx
lea eax, [ebp - 0x48c]
mov byte [eax], bl
inc eax
dec ecx
jne 0x1001a7a
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 0x440], eax
cmp eax, ebx
je 0x1001aa0
lea ecx, [ebp - 0x48c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
mov ax, word [ebp - 0x488]
mov word [ebp - 0x42c], ax
mov ax, word [ebp - 0x486]
mov word [ebp - 0x42a], ax
cmp dword [ebp - 0x420], ebx
jne 0x1001acb
push 0xa0
jmp 0x1001ad0
push 0x9f
call fcn.01003774
push eax
call edi
add eax, 0x20
push eax
call fcn.01002866
lea eax, [ebp - 0x430]
push eax
push 2
lea eax, [ebp - 0x474]
push eax
push dword [ebp - 0x444]
call dword [sym.imp.KERNEL32.dll_PeekConsoleInputW]
test eax, eax
je 0x1001c6a
cmp dword [ebp - 0x430], ebx
jbe 0x1001b84
lea eax, [ebp - 0x430]
push eax
push 2
lea eax, [ebp - 0x474]
push eax
push dword [ebp - 0x444]
call dword [sym.imp.KERNEL32.dll_ReadConsoleInputW]
test eax, eax
je 0x1001c6a
push 0x10
pop eax
cmp ax, word [ebp - 0x474]
je 0x1001b84
push 0x11
pop eax
cmp ax, word [ebp - 0x46a]
je 0x1001b84
cmp ax, word [ebp - 0x468]
je 0x1001b84
cmp dword [ebp - 0x464], 1
je 0x1001b84
cmp dword [ebp - 0x464], 4
je 0x1001b84
cmp dword [ebp - 0x470], ebx
je 0x1001b84
push 0x12
pop eax
cmp ax, word [ebp - 0x46a]
je 0x1001b84
cmp dword [ebp - 0x420], ebx
je 0x1001c3e
cmp dword [ebp - 0x43c], 0xffffffff
je 0x1001c24
mov eax, dword [ebp - 0x418]
mov dword [ebp - 0x44c], eax
lea eax, [ebp - 0x418]
push eax
call fcn.01001355
test eax, eax
je 0x1001900
mov edx, dword [ebp - 0x418]
cmp dword [ebp - 0x44c], edx
je 0x1001c24
mov ecx, 0x1fc
lea eax, [ebp - 0x218]
mov byte [eax], bl
inc eax
dec ecx
jne 0x1001bca
mov eax, dword [ebp - 0x424]
sub eax, edx
push eax
push dword [ebp - 0x41c]
lea eax, [ebp - 0x1c]
push eax
push 0x10011cc
lea eax, [ebp - 0x218]
push 0xfe
push eax
call fcn.010015f5
add esp, 0x18
cmp eax, ebx
jl 0x1001c5b
push dword [ebp - 0x42c]
push dword [ebp - 0x440]
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
lea eax, [ebp - 0x218]
push eax
call edi
add eax, 0x20
push eax
call fcn.01002866
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x424]
cmp dword [ebp - 0x418], eax
jl 0x1001ae1
push 0x10011c8
call edi
add eax, 0x20
push eax
call fcn.01002866
call fcn.010026fa
push ebx
push ebx
call esi
xor eax, eax
jmp 0x1001c97
movzx eax, ax
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.01001e85
push 0x10001
call edi
jmp 0x10018f7
push 0x258
call fcn.01003774
push eax
call dword [sym.imp.msvcrt.dll___iob_func]
add eax, 0x40
push eax
call fcn.01002866
call fcn.010026fa
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.01005712
leave
ret