[Console] Detect invalid consoles
This commit is contained in:
parent
d602d0c7c5
commit
0385ed0def
@ -621,6 +621,13 @@ namespace Components
|
|||||||
}
|
}
|
||||||
else if (Dedicated::IsEnabled()/* || ZoneBuilder::IsEnabled()*/)
|
else if (Dedicated::IsEnabled()/* || ZoneBuilder::IsEnabled()*/)
|
||||||
{
|
{
|
||||||
|
DWORD type = GetFileType(GetStdHandle(STD_INPUT_HANDLE));
|
||||||
|
if (type != FILE_TYPE_CHAR)
|
||||||
|
{
|
||||||
|
MessageBoxA(nullptr, "Console not supported, please use '-stdout' or '-console' flag!", "ERRROR", MB_ICONERROR);
|
||||||
|
TerminateProcess(GetCurrentProcess(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
Utils::Hook::Nop(0x60BB58, 11);
|
Utils::Hook::Nop(0x60BB58, 11);
|
||||||
|
|
||||||
Utils::Hook(0x4305E0, Console::Create, HOOK_JUMP).install()->quick();
|
Utils::Hook(0x4305E0, Console::Create, HOOK_JUMP).install()->quick();
|
||||||
|
Loading…
Reference in New Issue
Block a user