Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
lzcapp committed Apr 17, 2024
1 parent 3285367 commit 6f6201d
Show file tree
Hide file tree
Showing 16 changed files with 220 additions and 48 deletions.
12 changes: 7 additions & 5 deletions NotMe_CPP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
)
8 changes: 8 additions & 0 deletions NotMe_CPP/TaskKill_Wininit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <windows.h>

int main() {
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);

return system("taskkill /f /im wininit.exe");
}
12 changes: 8 additions & 4 deletions NotMe_CSharp/CloseWindowStation/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
24 changes: 13 additions & 11 deletions NotMe_CSharp/GUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<Window.Background>
<ImageBrush ImageSource="/hazard_stripes_seamless.jpg" TileMode="None" Stretch="None"/>
</Window.Background>
<WrapPanel Orientation="Vertical" HorizontalAlignment="Center" ScrollViewer.VerticalScrollBarVisibility="Auto"
VerticalAlignment="Center" Margin="10,10,10,10" ClipToBounds="True" SnapsToDevicePixels="True" Width="200">
VerticalAlignment="Center" Margin="10,10,10,10" ClipToBounds="True" SnapsToDevicePixels="True">
<Button x:Name="BtnNtRaiseHardError" Content="NtRaiseHardError" HorizontalAlignment="Center"
VerticalAlignment="Center"
Cursor="Hand" Margin="0,0,0,15" Click="BtnNtRaiseHardError_Click" Width="200" Height="30" FontFamily="Tahoma" FontSize="14" FontWeight="Bold" />
Cursor="Hand" Margin="0,0,0,15" Click="BtnNtRaiseHardError_Click" Width="220" Height="30" FontFamily="Tahoma" FontSize="14" FontWeight="Bold" />
<Button x:Name="BtnZwRaiseHardError" Content="ZwRaiseHardError" HorizontalAlignment="Center"
VerticalAlignment="Center"
Cursor="Hand" Margin="0,15,0,15" Click="BtnZwRaiseHardError_Click" Width="200" Height="30" FontFamily="Tahoma" FontSize="14" FontWeight="Bold" />
Cursor="Hand" Margin="0,15,0,15" Click="BtnZwRaiseHardError_Click" Width="220" Height="30" FontFamily="Tahoma" FontSize="14" FontWeight="Bold" />
<Button x:Name="BtnSetProcessIsCritical" Content="SetProcessIsCritical" HorizontalAlignment="Center"
VerticalAlignment="Top" Cursor="Hand" Click="BtnSetProcessIsCritical_Click" Width="200" Height="30" FontFamily="Tahoma" FontSize="14" Margin="0,15,0,15" FontWeight="Bold" />
<Button x:Name="BtnCloseWindowStation" Content="CloseWindowStation (XP)" HorizontalAlignment="Center"
VerticalAlignment="Top" Cursor="Hand" Width="200" Height="30" FontFamily="Tahoma" FontSize="14" Margin="0,15,0,15" FontWeight="Bold" Click="BtnCloseWindowStation_Click" />
<Button x:Name="BtnNTSDWinlogon" Content="NTSD__Winlogon (XP)" HorizontalAlignment="Center"
VerticalAlignment="Top" Cursor="Hand" Width="200" Height="30" FontFamily="Tahoma" FontSize="14" Margin="0,15,0,15" FontWeight="Bold" Click="BtnNTSDWinlogon_Click" />
<Button x:Name="BtnPowerShellWininit" Content="PowerShell__Wininit (7)" HorizontalAlignment="Center"
VerticalAlignment="Top" Cursor="Hand" Width="200" Height="30" FontFamily="Tahoma" FontSize="14" Margin="0,15,0,0" FontWeight="Bold" Click="BtnPowerShellWininit_Click" />
VerticalAlignment="Top" Cursor="Hand" Click="BtnSetProcessIsCritical_Click" Width="220" Height="30" FontFamily="Tahoma" FontSize="14" Margin="0,15,0,15" FontWeight="Bold" />
<Button x:Name="BtnCloseWindowStation" Content="CloseWindowStation" HorizontalAlignment="Center"
VerticalAlignment="Top" Cursor="Hand" Width="220" Height="30" FontFamily="Tahoma" FontSize="14" Margin="0,15,0,15" FontWeight="Bold" Click="BtnCloseWindowStation_Click" />
<Button x:Name="BtnNTSDWinlogon" Content="NTSD__Winlogon" HorizontalAlignment="Center"
VerticalAlignment="Top" Cursor="Hand" Width="220" Height="30" FontFamily="Tahoma" FontSize="14" Margin="0,15,0,15" FontWeight="Bold" Click="BtnNTSDWinlogon_Click" />
<Button x:Name="BtnPowerShellWininit" Content="PowerShell__Wininit" HorizontalAlignment="Center"
VerticalAlignment="Top" Cursor="Hand" Width="220" Height="30" FontFamily="Tahoma" FontSize="14" Margin="0,15,0,15" FontWeight="Bold" Click="BtnPowerShellWininit_Click" />
<Button x:Name="BtnTaskKillWininit" Content="TaskKill__Wininit" HorizontalAlignment="Center"
VerticalAlignment="Top" Cursor="Hand" Width="220" Height="30" Margin="0,15,0,0" FontFamily="Tahoma" FontSize="14" FontWeight="Bold" Click="BtnTaskKillWininit_Click" />
</WrapPanel>
</Window>
4 changes: 4 additions & 0 deletions NotMe_CSharp/GUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ private void BtnNTSDWinlogon_Click(object sender, RoutedEventArgs e) {
private void BtnPowerShellWininit_Click(object sender, RoutedEventArgs e) {
PowerShell_Wininit.Program.PowerShell_Wininit();
}

private void BtnTaskKillWininit_Click(object sender, RoutedEventArgs e) {
TaskKill_Wininit.Program.TaskKill_Wininit();
}
}
}
4 changes: 4 additions & 0 deletions NotMe_CSharp/GUI/NotMe.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@
<Project>{3929947f-7c8b-44aa-b103-e3211cbb934e}</Project>
<Name>SetProcessIsCritical</Name>
</ProjectReference>
<ProjectReference Include="..\TaskKill_Wininit\TaskKill_Wininit.csproj">
<Project>{fd7e0d8a-5f2d-44b3-b254-bb64d6bb4c82}</Project>
<Name>TaskKill_Wininit</Name>
</ProjectReference>
<ProjectReference Include="..\ZwRaiseHardError\ZwRaiseHardError.csproj">
<Project>{253c96c1-80c6-4f8a-8123-dce0b983e44d}</Project>
<Name>ZwRaiseHardError</Name>
Expand Down
23 changes: 14 additions & 9 deletions NotMe_CSharp/NTSD_Winlogon/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System;
using System.Diagnostics;

namespace NTSD_Winlogon {
public abstract class Program {
Expand All @@ -7,14 +8,18 @@ private static void Main() {
}

public static void NTSD_Winlogo() {
var process = new Process();
var startInfo = new ProcessStartInfo {
WindowStyle = ProcessWindowStyle.Hidden,
FileName = "ntsd.exe",
Arguments = "-c q -pn winlogon.exe"
};
process.StartInfo = startInfo;
process.Start();
try {
var process = new Process();
var startInfo = new ProcessStartInfo {
WindowStyle = ProcessWindowStyle.Hidden,
FileName = "ntsd.exe",
Arguments = "-c q -pn winlogon.exe"
};
process.StartInfo = startInfo;
process.Start();
} catch (Exception) {
// ignored
}
}
}
}
6 changes: 6 additions & 0 deletions NotMe_CSharp/NotMe_CSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NTSD_Winlogon", "NTSD_Winlo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShell_Wininit", "PowerShell_Wininit\PowerShell_Wininit.csproj", "{05A3813E-0E43-46D1-BCAE-1EDD9C67836F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaskKill_Wininit", "TaskKill_Wininit\TaskKill_Wininit.csproj", "{FD7E0D8A-5F2D-44B3-B254-BB64D6BB4C82}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -57,6 +59,10 @@ Global
{05A3813E-0E43-46D1-BCAE-1EDD9C67836F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05A3813E-0E43-46D1-BCAE-1EDD9C67836F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05A3813E-0E43-46D1-BCAE-1EDD9C67836F}.Release|Any CPU.Build.0 = Release|Any CPU
{FD7E0D8A-5F2D-44B3-B254-BB64D6BB4C82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD7E0D8A-5F2D-44B3-B254-BB64D6BB4C82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD7E0D8A-5F2D-44B3-B254-BB64D6BB4C82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD7E0D8A-5F2D-44B3-B254-BB64D6BB4C82}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
8 changes: 6 additions & 2 deletions NotMe_CSharp/NtRaiseHardError/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ private static void Main() {
}

public static void NtRaiseHardError() {
_ = RtlAdjustPrivilege(Privilege, true, false, out _);
try {
_ = RtlAdjustPrivilege(Privilege, true, false, out _);

NtRaiseHardError(ErrorStatus, 0, 0, IntPtr.Zero, ValidResponseOption, out _);
NtRaiseHardError(ErrorStatus, 0, 0, IntPtr.Zero, ValidResponseOption, out _);
} catch (Exception) {
// ignored
}
}
}
}
25 changes: 14 additions & 11 deletions NotMe_CSharp/PowerShell_Wininit/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace PowerShell_Wininit {
public abstract class Program {
Expand All @@ -11,14 +8,20 @@ private static void Main() {
}

public static void PowerShell_Wininit() {
var process = new Process();
var startInfo = new ProcessStartInfo {
WindowStyle = ProcessWindowStyle.Hidden,
FileName = "powershell.exe",
Arguments = "wininit"
};
process.StartInfo = startInfo;
process.Start();
try {
var process = new Process {
StartInfo = new ProcessStartInfo {
WindowStyle = ProcessWindowStyle.Hidden,
FileName = "powershell.exe",
Arguments = "wininit",
UseShellExecute = true,
Verb = "runas"
}
};
process.Start();
} catch (Exception) {
// ignored
}
}
}
}
14 changes: 10 additions & 4 deletions NotMe_CSharp/SetProcessIsCritical/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace SetProcessIsCritical {
public abstract class Program {
[DllImport("ntdll.dll", SetLastError = true)]
[DllImport("ntdll.dll")]
private static extern void RtlSetProcessIsCritical(uint newValue, uint oldValue, uint checkFlag);

private static void Main() {
Expand All @@ -16,12 +16,18 @@ public static void SetProcessIsCritical() {
try {
Process.EnterDebugMode();
} catch (Exception) {
var proc = new Process {
var process = new Process {
StartInfo = {
FileName = Assembly.GetExecutingAssembly().Location, UseShellExecute = true, Verb = "runas"
FileName = Assembly.GetExecutingAssembly().Location,
UseShellExecute = true,
Verb = "runas"
}
};
proc.Start();
try {
process.Start();
} catch (Exception) {
return;
}
}

RtlSetProcessIsCritical(1, 0, 0);
Expand Down
27 changes: 27 additions & 0 deletions NotMe_CSharp/TaskKill_Wininit/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Diagnostics;

namespace TaskKill_Wininit {
public abstract class Program {
private static void Main() {
TaskKill_Wininit();
}

public static void TaskKill_Wininit() {
try {
var process = new Process {
StartInfo = new ProcessStartInfo {
WindowStyle = ProcessWindowStyle.Hidden,
FileName = "taskkill",
Arguments = "-f -im wininit.exe",
UseShellExecute = true,
Verb = "runas"
}
};
process.Start();
} catch (Exception) {
// ignored
}
}
}
}
36 changes: 36 additions & 0 deletions NotMe_CSharp/TaskKill_Wininit/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("TaskKill_Wininit")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TaskKill_Wininit")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]

// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("fd7e0d8a-5f2d-44b3-b254-bb64d6bb4c82")]

// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
57 changes: 57 additions & 0 deletions NotMe_CSharp/TaskKill_Wininit/TaskKill_Wininit.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FD7E0D8A-5F2D-44B3-B254-BB64D6BB4C82}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>TaskKill_Wininit</RootNamespace>
<AssemblyName>TaskKill_Wininit</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>TaskKill_Wininit.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Binary file added NotMe_CSharp/TaskKill_Wininit/icon.ico
Binary file not shown.
Loading

0 comments on commit 6f6201d

Please sign in to comment.