Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e46999dc7 | |||
| 1005734137 |
@@ -0,0 +1,5 @@
|
||||
## TODO
|
||||
|
||||
Write build instructions but basically you need [Visual Studio 2005](archive.org/details/en_vs_2005_pro_dvd_202303) and the [Windows XP DDK](https://winworldpc.com/download/3d08c385-0c18-c39a-11c3-a4e284a2c3a5). Then import the project and you should be able to build it.
|
||||
|
||||
Idk I don't wanna make a clean slate just to test this case rn.
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NtRaiseHardError", "NtRaiseHardError\NtRaiseHardError.vcproj", "{47BDCBBC-954F-4560-A875-BD2F4BA71573}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{47BDCBBC-954F-4560-A875-BD2F4BA71573}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{47BDCBBC-954F-4560-A875-BD2F4BA71573}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{47BDCBBC-954F-4560-A875-BD2F4BA71573}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{47BDCBBC-954F-4560-A875-BD2F4BA71573}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,70 @@
|
||||
// NtRaiseHardError.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
EXTERN_C NTSTATUS NTAPI RtlAdjustPrivilege(ULONG Privilege, BOOLEAN Enable, BOOLEAN Client, PBOOLEAN WasEnabled);
|
||||
EXTERN_C NTSTATUS NTAPI NtRaiseHardError(NTSTATUS ErrorStatus, ULONG Params, ULONG UnicodeStringParameterMask, PULONG_PTR Parameters, ULONG ValidResponseOptions, PULONG Response);
|
||||
|
||||
ULONG evil(NTSTATUS option, NTSTATUS responseType) {
|
||||
BOOLEAN fuck;
|
||||
ULONG resp;
|
||||
/*UNICODE_STRING Message;
|
||||
ANSI_STRING MSG;
|
||||
RtlInitUnicodeString(&Message, L"Puneet Ballabh");
|
||||
ULONG_PTR p[]={(ULONG_PTR)&Message,(ULONG_PTR)&Message,0x0,0x0}; */ // Parameters not implemennted yet
|
||||
NTSTATUS privilege = RtlAdjustPrivilege(19, true, false, &fuck);
|
||||
if (privilege != STATUS_SUCCESS) {
|
||||
printf("\nERROR: Could not get privilege to shutdown system. This is needed for this program");
|
||||
printf("\nError code: %d (0x%x)", privilege, privilege);
|
||||
printf("\n");
|
||||
Sleep(5000);
|
||||
return privilege;
|
||||
}
|
||||
|
||||
const NTSTATUS limit = 0xC0000000, success = 0x00000000;
|
||||
if (responseType == 0x6 && (option >= limit && option <= success))
|
||||
{
|
||||
int confirmation = MessageBox(NULL, L"An Error value was specified and the response has been set to OptionShutdownSystem.\r\n !!! THIS WILL RESULT IN A BLUE SCREEN !!!\r\nAre you sure you want to continue?", L"WARNING", MB_YESNO|MB_ICONWARNING);
|
||||
if (confirmation != 0x6) {
|
||||
printf("\nConfirmation refused, closing...");
|
||||
Sleep(2000);
|
||||
return confirmation;
|
||||
}
|
||||
}
|
||||
Sleep(2000);
|
||||
NTSTATUS herror = NtRaiseHardError(option, 0x0, 0x0, 0x0, responseType, &resp);
|
||||
|
||||
printf("\nHard error result: %d (0x%x)", herror, herror);
|
||||
printf("\nResponse: %d (0x%x)", resp, resp);
|
||||
printf("\nClosing automatically in 5 seconds...");
|
||||
printf("\n");
|
||||
Sleep(5000);
|
||||
return resp;
|
||||
}
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
int cfrm = 100;
|
||||
printf("Welcome to NtRaiseHardError Generator\n");
|
||||
printf("Version 1.0. Currently missing any kind of parameter specifiers");
|
||||
Sleep(1000);
|
||||
NTSTATUS value,response = 0xFFFFFFFF;
|
||||
|
||||
|
||||
printf("\n\nFirst you need to specify the error you wanna generate\nTo see a complete list of errors, find all the statuses defined in ntstatus.h for your Windows version.");
|
||||
printf("\nAs a rule of thumb: \n 0x0??????? -> Success codes\n 0x4??????? -> Information codes\n 0x8??????? -> Warning codes\n 0xC??????? -> Error codes");
|
||||
|
||||
printf("\n\nEnter NTSTATUS hex code: 0x");
|
||||
scanf("%lx%*c", &value);
|
||||
printf("\nNow give a response option. \nValid options:\n0x0: OptionAbortRetryIgnore\n0x1: OptionOk\n0x2: OptionOkCancel\n0x3: OptionRetryCancel\n0x4: OptionYesNo\n0x5: OptionYesNoCancel\n0x6: OptionShutdownSystem (DANGEROUS)\n0x7: OptionOkNoWait (spawns message in tray)\n0x8: OptionCancelTryContinue\nInvalid Options default to 0x1");
|
||||
printf("\n\nEnter response option: 0x");
|
||||
scanf("%x%*c", &response);
|
||||
if (response < 0x0 || response > 0x8)
|
||||
response = 0x1;
|
||||
|
||||
printf("\nWaiting for 4 seconds to allow user to close in case of mistake");
|
||||
Sleep(4000);
|
||||
return evil(value, response);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="NtRaiseHardError"
|
||||
ProjectGUID="{47BDCBBC-954F-4560-A875-BD2F4BA71573}"
|
||||
RootNamespace="NtRaiseHardError"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="C:\WINDDK\2600\lib\wxp\i386\ntdll.lib libCMT.lib"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
IgnoreDefaultLibraryNames="libCMT.lib"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="C:\WINDDK\2600\lib\wxp\i386\ntdll.lib libCMT.lib"
|
||||
LinkIncremental="1"
|
||||
IgnoreDefaultLibraryNames="libCMT.lib"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\NtRaiseHardError.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -0,0 +1,33 @@
|
||||
========================================================================
|
||||
CONSOLE APPLICATION : NtRaiseHardError Project Overview
|
||||
========================================================================
|
||||
|
||||
AppWizard has created this NtRaiseHardError application for you.
|
||||
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your NtRaiseHardError application.
|
||||
|
||||
|
||||
NtRaiseHardError.vcproj
|
||||
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
Application Wizard.
|
||||
|
||||
NtRaiseHardError.cpp
|
||||
This is the main application source file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named NtRaiseHardError.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" comments to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// NtRaiseHardError.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
||||
@@ -0,0 +1,20 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windows.h>
|
||||
#undef WIN32_NO_STATUS
|
||||
#define _WIN32_WINNT 0x0500
|
||||
#include <winternl.h>
|
||||
#include <ntstatus.h>
|
||||
#include <winnt.h>
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
@@ -1,3 +1,21 @@
|
||||
# NtRaiseHardError
|
||||
|
||||
make your NT hard
|
||||
A way to generate "hard errors" in all Windows NT versions (works from Windows NT 3.51 all the way to Windows 11).
|
||||
|
||||
Currently, it can signal any NTSTATUS and can use any one of the 8 possible responses.
|
||||
|
||||
## Error on Windows 10
|
||||
|
||||
<img src="pictures/error.png">
|
||||
|
||||
## BSOD on Windows XP
|
||||
|
||||
<img src="pictures/bsod.png">
|
||||
|
||||
## Building
|
||||
|
||||
Read [here](BUILDING.md)
|
||||
|
||||
## TODO
|
||||
|
||||
Add the ability to supply parameters to NtRaiseHardError in order to customize the messages.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Reference in New Issue
Block a user