Function at 0x4388a0
Capabilities:
Manipulate console buffer

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x7c
mov ebx, dword [esp + 0x94]
mov dword [esp], ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov dword [esp], eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__get_osfhandle]
mov dword [esp + 0x24], eax
cmp eax, 0xffffffff
je 0x438b18
mov dword [esp], ebx
mov esi, eax
call sym._fflush
lea eax, [esp + 0x4c]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
sub esp, 8
test eax, eax
je 0x438d98
mov eax, dword [esp + 0x90]
movzx ecx, byte [eax]
test ecx, ecx
je 0x438aa0
lea esi, [esi]
mov ebx, eax
lea esi, [esi]
lea eax, [ecx - 0x80]
mov edi, ebx
add ebx, 1
cmp eax, 0x1f
jbe 0x438d18
movzx ebp, byte [ebx]
cmp ecx, 0x1b
sete dl
mov eax, ebp
mov ecx, ebp
test ebp, ebp
je 0x438aa0
sub eax, 0x40
cmp al, 0x1f
ja 0x438910
test dl, dl
je 0x438910
lea ebx, [edi + 2]
mov esi, 2
movzx eax, byte [ebx]
test al, al
je 0x438b10
mov edi, ebx
jmp 0x43896b
movzx eax, byte [edi]
test al, al
je 0x438b10
sub eax, 0x40
mov edx, edi
add edi, 1
cmp eax, 0x3e
ja 0x438960
mov eax, ebx
mov dword [esp + 0x2c], edx
lea edx, [esp + 0x58]
sub eax, esi
sub eax, dword [esp + 0x90]
mov dword [esp + 0x30], edx
mov dword [esp + 0x28], eax
mov edx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
je 0x438a02
mov dword [esp + 0x34], ebp
mov ebp, edx
mov dword [esp + 0x38], ebx
mov ebx, esi
mov esi, dword [esp + 0x30]
mov dword [esp + 0x3c], edi
mov edi, dword [esp + 0x90]
jmp 0x4389c6
sub ebx, dword [esp + 0x58]
je 0x4389f6
mov eax, dword [esp + 0x28]
mov dword [esp + 0x58], ebx
mov dword [esp + 0x10], 0
sub eax, ebx
mov dword [esp + 0xc], esi
add eax, edi
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call ebp
sub esp, 0x14
test eax, eax
jne 0x4389c0
mov ebp, dword [esp + 0x34]
mov ebx, dword [esp + 0x38]
mov edi, dword [esp + 0x3c]
mov eax, dword [esp + 0x2c]
mov ecx, ebp
movzx edx, cl
movzx eax, byte [eax]
shl eax, 8
or edx, eax
cmp dx, 0x465b
je 0x438e9e
jg 0x438b28
cmp dx, 0x435b
je 0x438e10
jle 0x438bb0
cmp dx, 0x445b
je 0x438f20
cmp dx, 0x455b
jne 0x438a80
mov ebp, dword [esp + 0x2c]
cmp ebp, ebx
je 0x43920d
lea esi, [esp + 0x50]
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
mov dword [esp], ebx
call sym._strtol
mov esi, eax
cmp dword [esp + 0x50], ebp
je 0x439212
lea esi, [esi]
nop
mov dword [esp + 0x90], edi
mov eax, dword [esp + 0x90]
movzx ecx, byte [eax]
test ecx, ecx
jne 0x438908
lea esi, [esi]
mov eax, dword [esp + 0x90]
lea esi, [esp + 0x58]
mov dword [esp], eax
call sym._strlen
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, eax
test eax, eax
je 0x438b10
mov eax, esi
mov esi, ebx
mov ebx, edi
mov ebp, eax
jmp 0x438ad6
sub ebx, dword [esp + 0x58]
je 0x438b10
mov eax, edi
mov dword [esp + 0x58], ebx
sub eax, ebx
add eax, dword [esp + 0x90]
mov dword [esp + 0x10], 0
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0xc], ebp
mov dword [esp + 8], ebx
mov dword [esp], eax
call esi
sub esp, 0x14
test eax, eax
jne 0x438ad0
lea esi, [esi]
mov dword [esp + 0x24], 1
mov eax, dword [esp + 0x24]
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dx, 0x4b5b
je 0x439108
jle 0x438c08
cmp dx, 0x665b
je 0x439028
cmp dx, 0x6d5b
jne 0x438a80
mov edx, dword [esp + 0x2c]
cmp edx, ebx
je 0x439368
xor ecx, ecx
mov dword [esp + 0x28], edi
mov eax, ebx
xor ebp, ebp
lea esi, [esp + 0x50]
mov ebx, ecx
mov edi, edx
lea esi, [esi]
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
mov dword [esp], eax
call sym._strtol
mov edx, eax
mov eax, dword [esp + 0x50]
cmp byte [eax], 0x3b
je 0x438b97
cmp eax, edi
jne case.0x438ba0.38
cmp edx, 0x31
ja case.0x438ba0.2
jmp dword [edx*4 + 0x552c48]
cmp dx, 0x415b
je 0x438fa0
cmp dx, 0x425b
jne 0x438a80
mov ebp, dword [esp + 0x2c]
cmp ebp, ebx
je 0x4392ee
lea esi, [esp + 0x50]
mov dword [esp], ebx
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
call sym._strtol
mov ebx, eax
cmp dword [esp + 0x50], ebp
je 0x4392f3
mov dword [esp + 0x90], edi
jmp 0x438a87
cmp dx, 0x485b
je 0x439028
cmp dx, 0x4a5b
jne 0x438ca0
cmp dword [esp + 0x2c], ebx
je 0x439261
lea esi, [esp + 0x50]
mov dword [esp], ebx
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
call sym._strtol
mov ebx, eax
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x50], eax
jne 0x438a80
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
cmp ebx, 1
je 0x4394d9
cmp ebx, 2
je 0x4394bc
test ebx, ebx
je 0x439281
movsx edx, word [esp + 0x5a]
xor eax, eax
xor ebx, ebx
xor ecx, ecx
jmp 0x43929d
cmp dx, 0x475b
jne 0x438a80
mov ebp, dword [esp + 0x2c]
cmp ebp, ebx
je 0x4392b4
lea esi, [esp + 0x50]
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
mov dword [esp], ebx
call sym._strtol
mov esi, eax
cmp dword [esp + 0x50], ebp
jne 0x438a80
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
mov eax, esi
mov ebx, dword [esp + 0x5c]
sub eax, 1
jns 0x4392da
xor edx, edx
jmp 0x4392e6
sub ecx, 0x40
mov ebp, ecx
je 0x438aa0
mov esi, 1
jmp 0x438949
or ebp, 7
mov ebx, 0xffffffff
lea esi, [esi]
add eax, 1
cmp eax, edi
jne 0x438b70
mov edi, dword [esp + 0x28]
cmp bx, 0xffff
jne 0x4391dd
movzx eax, bp
test bp, 0x4000
je 0x438d78
mov edx, ebp
shl eax, 4
and bp, 0xff00
shr dx, 4
movzx eax, al
and edx, 0xf
or edx, ebp
or eax, edx
and eax, 0xbfff
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleTextAttribute]
sub esp, 8
mov dword [esp + 0x90], edi
jmp 0x438a87
mov eax, dword [esp + 0x90]
lea esi, [esp + 0x58]
mov dword [esp], eax
call sym._strlen
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, eax
test eax, eax
je 0x438b10
mov eax, esi
mov esi, ebx
mov ebx, edi
mov ebp, eax
jmp 0x438dd2
sub ebx, dword [esp + 0x58]
je 0x438b10
mov eax, edi
mov dword [esp + 0x58], ebx
sub eax, ebx
add eax, dword [esp + 0x90]
mov dword [esp + 0x10], 0
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0xc], ebp
mov dword [esp + 8], ebx
mov dword [esp], eax
call esi
sub esp, 0x14
test eax, eax
jne 0x438dc8
jmp 0x438b10
mov ebp, dword [esp + 0x2c]
cmp ebp, ebx
je 0x439494
lea esi, [esp + 0x50]
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
mov dword [esp], ebx
call sym._strtol
mov esi, eax
cmp dword [esp + 0x50], ebp
jne 0x438a80
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
movsx ecx, word [esp + 0x5c]
movsx edx, word [esp + 0x58]
mov ebx, dword [esp + 0x5c]
mov eax, edx
mov ebp, ecx
sub edx, ecx
add ebp, esi
cmp edx, esi
cmovg eax, ebp
mov bx, ax
mov eax, dword [esp + 0x24]
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
sub esp, 8
mov dword [esp + 0x90], edi
jmp 0x438a87
mov ebp, dword [esp + 0x2c]
cmp ebp, ebx
je 0x43948a
lea esi, [esp + 0x50]
mov dword [esp], ebx
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
call sym._strtol
mov ebx, eax
cmp dword [esp + 0x50], ebp
jne 0x438a80
mov esi, dword [esp + 0x24]
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
movsx edx, word [esp + 0x5e]
mov dword [esp], esi
mov eax, edx
sub eax, ebx
cmp edx, ebx
mov edx, 0
cmovg edx, eax
mov ebx, edx
shl ebx, 0x10
mov dword [esp + 4], ebx
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
sub esp, 8
jmp 0x438a80
mov ebp, dword [esp + 0x2c]
cmp ebp, ebx
je 0x4393ec
lea esi, [esp + 0x50]
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
mov dword [esp], ebx
call sym._strtol
mov esi, eax
cmp dword [esp + 0x50], ebp
jne 0x438a80
mov ebp, dword [esp + 0x24]
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
movsx edx, word [esp + 0x5c]
mov ebx, dword [esp + 0x5c]
mov dword [esp], ebp
mov eax, edx
sub eax, esi
cmp edx, esi
mov edx, 0
cmovle eax, edx
mov bx, ax
mov dword [esp + 4], ebx
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
sub esp, 8
jmp 0x438a80
mov ebp, dword [esp + 0x2c]
cmp ebp, ebx
je 0x4393e2
lea esi, [esp + 0x50]
mov dword [esp], ebx
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
call sym._strtol
mov ebx, eax
cmp dword [esp + 0x50], ebp
jne 0x438a80
mov esi, dword [esp + 0x24]
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
movsx edx, word [esp + 0x5e]
mov dword [esp], esi
mov eax, edx
sub eax, ebx
cmp edx, ebx
mov edx, 0
movzx ebx, word [esp + 0x5c]
cmovle eax, edx
shl eax, 0x10
or ebx, eax
mov dword [esp + 4], ebx
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
sub esp, 8
jmp 0x438a80
mov eax, dword [esp + 0x2c]
cmp eax, ebx
je 0x43949e
sub eax, ebx
mov dword [esp + 4], 0x3b
lea esi, [esp + 0x50]
mov dword [esp + 8], eax
mov dword [esp], ebx
call sym._memchr
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
mov ebp, eax
mov dword [esp], ebx
test eax, eax
je 0x439349
call sym._strtol
mov ebx, eax
cmp ebp, dword [esp + 0x50]
jne 0x438a80
mov dword [esp + 4], esi
lea esi, [ebp + 1]
mov dword [esp], esi
mov dword [esp + 8], 0xa
call sym._strtol
mov esi, eax
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x50], eax
jne 0x438a80
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
movsx eax, word [esp + 0x64]
lea edx, [ebx + eax - 1]
movsx eax, word [esp + 0x62]
lea ebx, [esi + eax - 1]
xor eax, eax
test edx, edx
js 0x4390e3
movsx esi, word [esp + 0x5a]
mov eax, esi
cmp edx, esi
cmovle eax, edx
xor edx, edx
test ebx, ebx
js 0x4390f5
movsx esi, word [esp + 0x58]
mov edx, esi
cmp ebx, esi
cmovle edx, ebx
shl eax, 0x10
movzx edx, dx
or edx, eax
mov ebx, edx
jmp 0x438e7e
cmp dword [esp + 0x2c], ebx
je 0x4393f6
lea esi, [esp + 0x50]
mov dword [esp], ebx
mov dword [esp + 8], 0xa
mov dword [esp + 4], esi
call sym._strtol
mov ebx, eax
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x50], eax
jne 0x438a80
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
movzx eax, word [esp + 0x5e]
test ebx, ebx
je 0x43941b
cmp ebx, 1
je 0x4394ad
movsx esi, word [esp + 0x58]
xor ebx, ebx
jmp 0x439429
and ebp, 0xffffff8f
mov ecx, ebp
or ecx, 0x40
test dl, 1
cmovne ebp, ecx
mov ecx, ebp
or ecx, 0x20
test dl, 2
cmovne ebp, ecx
mov ecx, ebp
or ecx, 0x10
and edx, 4
cmovne ebp, ecx
or ebx, 0x70
jmp case.0x438ba0.2
and ebp, 0xfffffff8
lea ecx, [edx - 0x1e]
mov dword [esp + 0x2c], ecx
mov ecx, ebp
or ecx, 4
test dl, 1
cmovne ebp, ecx
mov ecx, ebp
or ecx, 2
and edx, 2
cmove ebp, ecx
mov edx, ebp
or edx, 1
test byte [esp + 0x2c], 4
cmovne ebp, edx
or ebx, 7
jmp case.0x438ba0.2
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438d51
mov eax, ebx
not eax
and ax, word [esp + 0x60]
or ebp, eax
jmp 0x438d51
mov esi, 1
mov ebp, dword [esp + 0x24]
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
movsx ecx, word [esp + 0x5e]
movsx edx, word [esp + 0x5a]
mov dword [esp], ebp
mov eax, ecx
mov ebx, edx
sub edx, ecx
add eax, esi
cmp edx, esi
cmovg ebx, eax
shl ebx, 0x10
mov dword [esp + 4], ebx
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
sub esp, 8
jmp 0x438a80
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
movsx edx, word [esp + 0x5c]
movsx ecx, word [esp + 0x58]
movsx esi, word [esp + 0x5e]
mov ebx, edx
sub ecx, edx
movsx edx, word [esp + 0x68]
mov eax, esi
sub edx, esi
test edx, edx
js 0x438a80
movsx esi, word [esp + 0x58]
imul esi, edx
add esi, ecx
jmp 0x439429
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
mov ebx, dword [esp + 0x5c]
xor eax, eax
movsx esi, word [esp + 0x58]
mov edx, esi
cmp esi, eax
cmovge edx, eax
mov bx, dx
jmp 0x438e7e
mov ebx, 1
mov ebp, dword [esp + 0x24]
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
movsx ecx, word [esp + 0x5e]
movsx esi, word [esp + 0x5a]
mov dword [esp], ebp
mov edx, ecx
mov eax, esi
sub esi, ecx
add edx, ebx
cmp esi, ebx
movzx ebx, word [esp + 0x5c]
cmovg eax, edx
shl eax, 0x10
or ebx, eax
mov dword [esp + 4], ebx
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
sub esp, 8
jmp 0x438a80
call sym._strtol
mov esi, 1
mov ebx, eax
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x50], eax
jne 0x438a80
jmp 0x43909f
mov eax, 7
jmp 0x438d78
or bp, 0x8000
jmp case.0x438ba0.2
or ebp, 8
jmp case.0x438ba0.2
and ebp, 0xffffff8f
or ebx, 0x70
jmp case.0x438ba0.2
and bp, 0xbfff
or bh, 0x40
jmp case.0x438ba0.2
and bp, 0xff7f
or bl, 0x80
jmp case.0x438ba0.2
or ebp, 7
or ebx, 7
jmp case.0x438ba0.2
and bp, 0x7fff
or bx, 0x8000
jmp case.0x438ba0.2
and ebp, 0xfffffff7
or ebx, 8
jmp case.0x438ba0.2
or bp, 0x4000
jmp case.0x438ba0.2
or bp, 0x80
jmp case.0x438ba0.2
mov ebx, 1
jmp 0x438fd0
mov esi, 1
jmp 0x438f50
lea eax, [esp + 0x58]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x438a80
movzx eax, word [esp + 0x5e]
movsx edx, word [esp + 0x5c]
movsx esi, word [esp + 0x58]
mov ebx, edx
sub esi, edx
shl eax, 0x10
movzx ebx, bx
lea ebp, [esp + 0x54]
mov dword [esp + 8], esi
or ebx, eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], ebx
mov dword [esp + 4], 0x20
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_FillConsoleOutputCharacterW]
sub esp, 0x14
movzx eax, word [esp + 0x60]
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], ebx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 8], esi
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_FillConsoleOutputAttribute]
sub esp, 0x14
mov dword [esp + 0x90], edi
jmp 0x438a87
mov ebx, 1
jmp 0x438ece
mov esi, 1
jmp 0x438e40
mov esi, 1
mov ebx, 1
jmp 0x43909f
movsx esi, word [esp + 0x5c]
xor ebx, ebx
add esi, 1
jmp 0x439429
movsx esi, word [esp + 0x64]
movsx edx, word [esp + 0x68]
xor ecx, ecx
movzx ebx, word [esp + 0x62]
sub edx, esi
mov eax, esi
add edx, 1
jmp 0x43929d
movsx edx, word [esp + 0x5c]
movsx ebx, word [esp + 0x64]
lea ecx, [edx + 1]
movsx edx, word [esp + 0x5e]
mov eax, ebx
sub edx, ebx
xor ebx, ebx
jmp 0x43929d