Aktualizacja: 2025-10-02 23:11:12
This commit is contained in:
@@ -602,4 +602,25 @@ void HelpSystem::PrintWarning(const wchar_t* warning) noexcept
|
|||||||
|
|
||||||
// Restore original color after warning
|
// Restore original color after warning
|
||||||
SetConsoleTextAttribute(hConsole, originalColor);
|
SetConsoleTextAttribute(hConsole, originalColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HelpSystem::PrintUnknownCommandMessage(std::wstring_view command) noexcept
|
||||||
|
{
|
||||||
|
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||||
|
GetConsoleScreenBufferInfo(hConsole, &csbi);
|
||||||
|
WORD originalColor = csbi.wAttributes;
|
||||||
|
|
||||||
|
// Red color for the entire message block
|
||||||
|
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_INTENSITY);
|
||||||
|
|
||||||
|
std::wcout << L"\nCommand not found: \"" << command << L"\"\n\n";
|
||||||
|
std::wcout << L"To display help, use one of the following:\n";
|
||||||
|
std::wcout << L" kvc -h\n";
|
||||||
|
std::wcout << L" kvc help\n";
|
||||||
|
std::wcout << L" kvc | more (for paginated output)\n";
|
||||||
|
std::wcout << L" kvc help >> \"%USERPROFILE%\\Desktop\\help.txt\" (save to file)\n\n";
|
||||||
|
|
||||||
|
// Restore original color
|
||||||
|
SetConsoleTextAttribute(hConsole, originalColor);
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,7 @@ public:
|
|||||||
static void PrintExclusionTypes() noexcept;
|
static void PrintExclusionTypes() noexcept;
|
||||||
static void PrintPatternMatching() noexcept;
|
static void PrintPatternMatching() noexcept;
|
||||||
static void PrintTechnicalFeatures() noexcept;
|
static void PrintTechnicalFeatures() noexcept;
|
||||||
|
static void PrintUnknownCommandMessage(std::wstring_view command) noexcept;
|
||||||
static void PrintDefenderNotes() noexcept;
|
static void PrintDefenderNotes() noexcept;
|
||||||
static void PrintRegistryCommands() noexcept;
|
static void PrintRegistryCommands() noexcept;
|
||||||
static void PrintSecurityEngineCommands() noexcept;
|
static void PrintSecurityEngineCommands() noexcept;
|
||||||
|
|||||||
11
kvc/Kvc.cpp
11
kvc/Kvc.cpp
@@ -1024,12 +1024,11 @@ int wmain(int argc, wchar_t* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR(L"Unknown command: %s", command.data());
|
HelpSystem::PrintUnknownCommandMessage(command);
|
||||||
HelpSystem::PrintUsage(argv[0]);
|
return 1;
|
||||||
return 1;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (const std::exception& e)
|
catch (const std::exception& e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ bool OffsetFinder::FindKernelPsInitialSystemProcessOffset() noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_offsetMap[Offset::KernelPsInitialSystemProcess] = offset;
|
m_offsetMap[Offset::KernelPsInitialSystemProcess] = offset;
|
||||||
SUCCESS(L"Found PsInitialSystemProcess offset: 0x%x", offset);
|
DEBUG(L"Found PsInitialSystemProcess offset: 0x%x", offset);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ bool OffsetFinder::FindProcessUniqueProcessIdOffset() noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_offsetMap[Offset::ProcessUniqueProcessId] = offset.value();
|
m_offsetMap[Offset::ProcessUniqueProcessId] = offset.value();
|
||||||
SUCCESS(L"Found UniqueProcessId offset: 0x%x", offset.value());
|
DEBUG(L"Found UniqueProcessId offset: 0x%x", offset.value());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ bool OffsetFinder::FindProcessProtectionOffset() noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_offsetMap[Offset::ProcessProtection] = offsetA.value();
|
m_offsetMap[Offset::ProcessProtection] = offsetA.value();
|
||||||
SUCCESS(L"Found ProcessProtection offset: 0x%x", offsetA.value());
|
DEBUG(L"Found ProcessProtection offset: 0x%x", offsetA.value());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user