From 6f6201d31802dd267edf066b3b1da835f504d82f Mon Sep 17 00:00:00 2001 From: Laurence Luo Date: Wed, 17 Apr 2024 16:56:30 +0800 Subject: [PATCH] Update --- NotMe_CPP/CMakeLists.txt | 12 ++-- NotMe_CPP/TaskKill_Wininit.cpp | 8 +++ NotMe_CSharp/CloseWindowStation/Program.cs | 12 ++-- NotMe_CSharp/GUI/MainWindow.xaml | 24 ++++---- NotMe_CSharp/GUI/MainWindow.xaml.cs | 4 ++ NotMe_CSharp/GUI/NotMe.csproj | 4 ++ NotMe_CSharp/NTSD_Winlogon/Program.cs | 23 ++++--- NotMe_CSharp/NotMe_CSharp.sln | 6 ++ NotMe_CSharp/NtRaiseHardError/Program.cs | 8 ++- NotMe_CSharp/PowerShell_Wininit/Program.cs | 25 ++++---- NotMe_CSharp/SetProcessIsCritical/Program.cs | 14 +++-- NotMe_CSharp/TaskKill_Wininit/Program.cs | 27 +++++++++ .../Properties/AssemblyInfo.cs | 36 +++++++++++ .../TaskKill_Wininit/TaskKill_Wininit.csproj | 57 ++++++++++++++++++ NotMe_CSharp/TaskKill_Wininit/icon.ico | Bin 0 -> 102308 bytes NotMe_CSharp/ZwRaiseHardError/Program.cs | 8 ++- 16 files changed, 220 insertions(+), 48 deletions(-) create mode 100644 NotMe_CPP/TaskKill_Wininit.cpp create mode 100644 NotMe_CSharp/TaskKill_Wininit/Program.cs create mode 100644 NotMe_CSharp/TaskKill_Wininit/Properties/AssemblyInfo.cs create mode 100644 NotMe_CSharp/TaskKill_Wininit/TaskKill_Wininit.csproj create mode 100644 NotMe_CSharp/TaskKill_Wininit/icon.ico diff --git a/NotMe_CPP/CMakeLists.txt b/NotMe_CPP/CMakeLists.txt index 8b5a6d8..bd4bd99 100644 --- a/NotMe_CPP/CMakeLists.txt +++ b/NotMe_CPP/CMakeLists.txt @@ -11,20 +11,18 @@ add_executable(AllinOne AllinOne.cpp rc.rc) add_executable(NTSD_Winlogon NTSD_Winlogon.cpp rc.rc) -add_executable(PowerShell_Wininit PowerShell_Wininit.cpp rc.rc) +add_executable(TaskKill_Wininit TaskKill_Wininit.cpp rc.rc) add_executable(NtRaiseHardError NtRaiseHardError.cpp rc.rc) add_executable(ZwRaiseHardError ZwRaiseHardError.cpp rc.rc) +add_executable(PowerShell_Wininit PowerShell_Wininit.cpp rc.rc) + add_executable(CloseWindowStation CloseWindowStation.cpp rc.rc) add_executable(SetProcessIsCritical SetProcessIsCritical.cpp rc.rc) add_custom_command(TARGET SetProcessIsCritical POST_BUILD - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/.cmake - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/CMakeFiles - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/CMakeScripts - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/Testing COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/CMakeCache.txt COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/cmake_install.cmake COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/Makefile @@ -33,4 +31,8 @@ add_custom_command(TARGET SetProcessIsCritical POST_BUILD COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/CTestCustom.cmake COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/cmake_install.cmake COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/Trigger-BSOD.cbp + COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/.cmake + COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/CMakeFiles + COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/CMakeScripts + COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/Testing ) \ No newline at end of file diff --git a/NotMe_CPP/TaskKill_Wininit.cpp b/NotMe_CPP/TaskKill_Wininit.cpp new file mode 100644 index 0000000..b0565d9 --- /dev/null +++ b/NotMe_CPP/TaskKill_Wininit.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + HWND hWnd = GetConsoleWindow(); + ShowWindow(hWnd, SW_HIDE); + + return system("taskkill /f /im wininit.exe"); +} \ No newline at end of file diff --git a/NotMe_CSharp/CloseWindowStation/Program.cs b/NotMe_CSharp/CloseWindowStation/Program.cs index 38b85bd..03dd60a 100644 --- a/NotMe_CSharp/CloseWindowStation/Program.cs +++ b/NotMe_CSharp/CloseWindowStation/Program.cs @@ -23,10 +23,14 @@ private static void Main() { } public static void CloseWindowStation() { - const uint dwDesiredAccess = (uint)(GENERIC_READ | GENERIC_WRITE); - IntPtr hWinSta = CreateWindowStation("WindowStation", 0, dwDesiredAccess, IntPtr.Zero); - SetHandleInformation(hWinSta, HANDLE_FLAG_PROTECT_FROM_CLOSE, HANDLE_FLAG_PROTECT_FROM_CLOSE); - CloseWindowStation(hWinSta); + try { + const uint dwDesiredAccess = (uint)(GENERIC_READ | GENERIC_WRITE); + IntPtr hWinSta = CreateWindowStation("WindowStation", 0, dwDesiredAccess, IntPtr.Zero); + SetHandleInformation(hWinSta, HANDLE_FLAG_PROTECT_FROM_CLOSE, HANDLE_FLAG_PROTECT_FROM_CLOSE); + CloseWindowStation(hWinSta); + } catch (Exception) { + // ignored + } } } } \ No newline at end of file diff --git a/NotMe_CSharp/GUI/MainWindow.xaml b/NotMe_CSharp/GUI/MainWindow.xaml index 4ec15b1..3073bc3 100644 --- a/NotMe_CSharp/GUI/MainWindow.xaml +++ b/NotMe_CSharp/GUI/MainWindow.xaml @@ -4,25 +4,27 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" - Title="MainWindow" Width="250" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Height="400"> + Title="MainWindow" Width="300" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Height="470"> + VerticalAlignment="Center" Margin="10,10,10,10" ClipToBounds="True" SnapsToDevicePixels="True">