核弹!!!.exe
2026-07-07 23:19:22
发布于:四川
事先声明
将源码放入C++即可
ai写的
请在虚拟机上测试并保存文件
源码(800):
注意#define ENABLE_SIMULATION_MODE 如果设为1就不会蓝屏
/*
* ============================================================================
* 项目名称: BlueScreenTrigger Professional v6.9.4
* 文件名称: main.cpp
* 功能描述: 触发 Windows 系统蓝屏(BSOD),仅供研究 Windows 内核机制。
* 本程序采用动态加载 ntdll.dll 的方式调用未公开 API,
* 模拟系统级错误,最终导致系统崩溃重启。
* 作者: c+++++++++++++++++++++++++++++
* 版本: 6.9.4 Build 2025
* 编译环境: Dev-C++ 5.11 (MinGW 4.9.2) 或更高版本
* 注意事项: 执行前请保存所有工作!本程序不承担任何数据损失责任。
* ============================================================================
*/
#include <conio.h> // 用于 _kbhit() 和 _getch()
#include <windows.h>
#include <iostream>
#include <string>
#include <vector>
#include <ctime>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cctype>
#include <cstdarg> // 用于 va_list
// ============================================================================
// 宏定义区(用于增加代码量和可读性)
// ============================================================================
#define VERSION_MAJOR 6
#define VERSION_MINOR 9
#define VERSION_BUILD 4
#define VERSION_REVISION 2025
#define PROGRAM_NAME "BlueScreenTrigger"
#define PROGRAM_AUTHOR "DarkCoder"
#define PROGRAM_WEBSITE "https://example.com/bsod"
#define ERROR_CODE_BASE 0xC0000000
#define STATUS_FLOAT_ERROR (ERROR_CODE_BASE | 0x008E) // 0xC000008E
#define MAX_RETRY_COUNT 3
#define DEFAULT_TIMEOUT_MS 5000
#define WARNING_MESSAGE_LEN 512
// 条件编译开关(可用于不同调试级别)
#define ENABLE_VERBOSE_LOGGING 1
#define ENABLE_SIMULATION_MODE 0
// 如果设为1,则不会真正蓝屏,仅演示
#define ENABLE_RANDOM_DELAY 0
// ============================================================================
// 类型重定义(避免依赖 winternl.h)
// ============================================================================
typedef long NTSTATUS;
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
// ============================================================================
// 辅助工具类:字符串操作、时间、随机数等
// ============================================================================
class StringHelper {
public:
static std::string ToUpper(const std::string& str) {
std::string result = str;
std::transform(result.begin(), result.end(), result.begin(), ::toupper);
return result;
}
static std::string Trim(const std::string& str) {
size_t first = str.find_first_not_of(" \t\n\r");
if (first == std::string::npos) return "";
size_t last = str.find_last_not_of(" \t\n\r");
return str.substr(first, last - first + 1);
}
static std::string Format(const char* fmt, ...) {
char buffer[1024];
va_list args;
va_start(args, fmt);
vsnprintf(buffer, sizeof(buffer), fmt, args);
va_end(args);
return std::string(buffer);
}
};
class TimeHelper {
public:
static std::string GetCurrentTimeStr() {
time_t now = time(NULL);
struct tm* tm_info = localtime(&now);
char buffer[64];
strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", tm_info);
return std::string(buffer);
}
static DWORD GetTickCountSim() {
return GetTickCount();
}
};
class RandomHelper {
public:
static void InitSeed() {
srand((unsigned int)time(NULL));
}
static int RandomInt(int min, int max) {
return min + rand() % (max - min + 1);
}
static std::string RandomHexString(int length) {
static const char* hex_chars = "0123456789ABCDEF";
std::string result;
for (int i = 0; i < length; ++i) {
result += hex_chars[rand() % 16];
}
return result;
}
};
// ============================================================================
// 模拟加密/解密类(实际只是异或运算,增加代码量)
// ============================================================================
class SimpleCrypto {
private:
unsigned char m_key[32];
int m_keyLength;
public:
SimpleCrypto() {
m_keyLength = 32;
for (int i = 0; i < 32; ++i) {
m_key[i] = (unsigned char)(i * 7 + 13);
}
}
explicit SimpleCrypto(const unsigned char* key, int len) {
m_keyLength = (len > 32) ? 32 : len;
for (int i = 0; i < m_keyLength; ++i) {
m_key[i] = key[i];
}
}
std::vector<unsigned char> Encrypt(const std::vector<unsigned char>& data) {
std::vector<unsigned char> result;
result.resize(data.size());
for (size_t i = 0; i < data.size(); ++i) {
result[i] = data[i] ^ m_key[i % m_keyLength];
}
return result;
}
std::vector<unsigned char> Decrypt(const std::vector<unsigned char>& data) {
return Encrypt(data);
}
std::string EncryptString(const std::string& plain) {
std::vector<unsigned char> data(plain.begin(), plain.end());
std::vector<unsigned char> encrypted = Encrypt(data);
return std::string(encrypted.begin(), encrypted.end());
}
std::string DecryptString(const std::string& cipher) {
std::vector<unsigned char> data(cipher.begin(), cipher.end());
std::vector<unsigned char> decrypted = Decrypt(data);
return std::string(decrypted.begin(), decrypted.end());
}
};
// ============================================================================
// 系统信息收集类(获取 Windows 版本、CPU 信息等)
// ============================================================================
class SystemInfo {
private:
std::string m_osVersion;
std::string m_cpuArch;
DWORD m_cpuCores;
DWORD m_memoryMB;
public:
SystemInfo() {
m_cpuCores = 0;
m_memoryMB = 0;
Collect();
}
void Collect() {
OSVERSIONINFOEX osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
#pragma warning(push)
#pragma warning(disable: 4996)
if (GetVersionEx((LPOSVERSIONINFO)&osvi)) {
std::stringstream ss;
ss << "Windows " << osvi.dwMajorVersion << "." << osvi.dwMinorVersion
<< " (Build " << osvi.dwBuildNumber << ")";
m_osVersion = ss.str();
} else {
m_osVersion = "Unknown";
}
#pragma warning(pop)
SYSTEM_INFO si;
GetSystemInfo(&si);
m_cpuCores = si.dwNumberOfProcessors;
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
m_cpuArch = "x64";
} else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) {
m_cpuArch = "x86";
} else {
m_cpuArch = "Unknown";
}
MEMORYSTATUSEX mem;
mem.dwLength = sizeof(mem);
GlobalMemoryStatusEx(&mem);
m_memoryMB = (DWORD)(mem.ullTotalPhys / (1024 * 1024));
}
std::string GetOSVersion() const { return m_osVersion; }
std::string GetCPUArch() const { return m_cpuArch; }
DWORD GetCPUCores() const { return m_cpuCores; }
DWORD GetMemoryMB() const { return m_memoryMB; }
std::string GetFullReport() const {
std::stringstream ss;
ss << "========================================\n";
ss << " SYSTEM INFORMATION REPORT\n";
ss << "========================================\n";
ss << "OS Version : " << m_osVersion << "\n";
ss << "CPU Arch : " << m_cpuArch << "\n";
ss << "CPU Cores : " << m_cpuCores << "\n";
ss << "Total RAM : " << m_memoryMB << " MB\n";
ss << "========================================\n";
return ss.str();
}
};
// ============================================================================
// 日志记录类
// ============================================================================
enum LogLevel {
LOG_DEBUG,
LOG_INFO,
LOG_WARNING,
LOG_ERROR,
LOG_FATAL
};
class Logger {
private:
std::string m_logFileName;
bool m_consoleOutput;
bool m_fileOutput;
LogLevel m_minLevel;
public:
Logger(const std::string& filename = "bsod.log", bool console = true, bool file = false)
: m_logFileName(filename), m_consoleOutput(console), m_fileOutput(file), m_minLevel(LOG_INFO) {
}
void SetLevel(LogLevel level) { m_minLevel = level; }
void Log(LogLevel level, const std::string& message) {
if (level < m_minLevel) return;
std::string prefix;
switch (level) {
case LOG_DEBUG: prefix = "[DEBUG]"; break;
case LOG_INFO: prefix = "[INFO] "; break;
case LOG_WARNING: prefix = "[WARN] "; break;
case LOG_ERROR: prefix = "[ERROR]"; break;
case LOG_FATAL: prefix = "[FATAL]"; break;
default: prefix = "[UNKN] "; break;
}
std::string fullMsg = TimeHelper::GetCurrentTimeStr() + " " + prefix + " " + message;
if (m_consoleOutput) {
std::cout << fullMsg << std::endl;
}
if (m_fileOutput) {
std::ofstream file(m_logFileName.c_str(), std::ios::app);
if (file.is_open()) {
file << fullMsg << std::endl;
file.close();
}
}
}
void Debug(const std::string& msg) { Log(LOG_DEBUG, msg); }
void Info(const std::string& msg) { Log(LOG_INFO, msg); }
void Warn(const std::string& msg) { Log(LOG_WARNING, msg); }
void Error(const std::string& msg) { Log(LOG_ERROR, msg); }
void Fatal(const std::string& msg) { Log(LOG_FATAL, msg); }
};
// ============================================================================
// 进度条类
// ============================================================================
class ProgressBar {
private:
int m_total;
int m_current;
int m_width;
char m_fillChar;
char m_emptyChar;
public:
ProgressBar(int total, int width = 50, char fill = '#', char empty = '-')
: m_total(total), m_current(0), m_width(width), m_fillChar(fill), m_emptyChar(empty) {}
void Update(int value) {
if (value > m_total) value = m_total;
m_current = value;
Draw();
}
void Draw() {
float ratio = (float)m_current / m_total;
int filled = (int)(ratio * m_width);
std::cout << "[";
for (int i = 0; i < m_width; ++i) {
if (i < filled) std::cout << m_fillChar;
else std::cout << m_emptyChar;
}
std::cout << "] " << (int)(ratio * 100) << "%\r";
std::cout.flush();
}
void Complete() {
Update(m_total);
std::cout << std::endl;
}
};
// ============================================================================
// 蓝屏触发核心类
// ============================================================================
typedef NTSTATUS (NTAPI *RtlAdjustPrivilegeFunc)(ULONG, BOOLEAN, BOOLEAN, PBOOLEAN);
typedef NTSTATUS (NTAPI *NtRaiseHardErrorFunc)(NTSTATUS, ULONG, ULONG, PULONG_PTR, ULONG, PULONG);
class BlueScreenTrigger {
private:
HMODULE m_hNtdll;
RtlAdjustPrivilegeFunc m_RtlAdjustPrivilege;
NtRaiseHardErrorFunc m_NtRaiseHardError;
Logger* m_logger;
bool m_initialized;
public:
BlueScreenTrigger(Logger* logger = NULL)
: m_hNtdll(NULL), m_RtlAdjustPrivilege(NULL), m_NtRaiseHardError(NULL),
m_logger(logger), m_initialized(false) {}
~BlueScreenTrigger() {}
bool Initialize() {
if (m_initialized) return true;
if (m_logger) m_logger->Info("Loading ntdll.dll ...");
m_hNtdll = GetModuleHandleA("ntdll.dll");
if (!m_hNtdll) {
if (m_logger) m_logger->Error("Failed to get ntdll.dll handle");
return false;
}
if (m_logger) m_logger->Info("Resolving function addresses ...");
m_RtlAdjustPrivilege = (RtlAdjustPrivilegeFunc)GetProcAddress(m_hNtdll, "RtlAdjustPrivilege");
m_NtRaiseHardError = (NtRaiseHardErrorFunc)GetProcAddress(m_hNtdll, "NtRaiseHardError");
if (!m_RtlAdjustPrivilege || !m_NtRaiseHardError) {
if (m_logger) m_logger->Error("Failed to resolve functions");
return false;
}
m_initialized = true;
if (m_logger) m_logger->Info("Initialization successful");
return true;
}
bool Trigger() {
if (!m_initialized) {
if (m_logger) m_logger->Error("Trigger not initialized");
return false;
}
if (m_logger) m_logger->Warn("Attempting to enable shutdown privilege ...");
BOOLEAN oldValue;
NTSTATUS status = m_RtlAdjustPrivilege(19, TRUE, FALSE, &oldValue);
if (!NT_SUCCESS(status)) {
if (m_logger) m_logger->Error("Failed to enable shutdown privilege (status: 0x" +
StringHelper::Format("%08X", status) + ")");
return false;
}
if (m_logger) m_logger->Info("Shutdown privilege enabled successfully");
if (m_logger) m_logger->Fatal("Raising hard error to trigger BSOD ...");
ULONG response;
status = m_NtRaiseHardError(STATUS_FLOAT_ERROR, 0, 0, NULL, 6, &response);
if (m_logger) m_logger->Error("NtRaiseHardError returned unexpectedly (status: 0x" +
StringHelper::Format("%08X", status) + ")");
return false;
}
bool Simulate() {
if (m_logger) m_logger->Info("Simulation mode: would trigger BSOD here");
std::cout << "\n[SIMULATION] BlueScreenTrigger::Trigger() would be called now.\n";
std::cout << " Error Code: " << std::hex << STATUS_FLOAT_ERROR << std::dec << "\n";
return true;
}
};
// ============================================================================
// 数学计算函数(增加代码量)
// ============================================================================
namespace MathUtils {
long long Factorial(int n) {
if (n <= 1) return 1;
return n * Factorial(n - 1);
}
long long Fibonacci(int n) {
if (n <= 1) return n;
long long a = 0, b = 1;
for (int i = 2; i <= n; ++i) {
long long c = a + b;
a = b;
b = c;
}
return b;
}
bool IsPrime(int n) {
if (n <= 1) return false;
if (n == 2) return true;
if (n % 2 == 0) return false;
for (int i = 3; i * i <= n; i += 2) {
if (n % i == 0) return false;
}
return true;
}
int RandomPrime(int min, int max) {
int num;
do {
num = RandomHelper::RandomInt(min, max);
} while (!IsPrime(num));
return num;
}
unsigned int CRC32(const unsigned char* data, size_t len) {
unsigned int crc = 0xFFFFFFFF;
for (size_t i = 0; i < len; ++i) {
crc ^= data[i];
for (int j = 0; j < 8; ++j) {
if (crc & 1) crc = (crc >> 1) ^ 0xEDB88320;
else crc >>= 1;
}
}
return ~crc;
}
std::string SimpleHash(const std::string& input) {
unsigned int hash = 0;
for (size_t i = 0; i < input.size(); ++i) {
hash = (hash * 31 + input[i]) & 0xFFFFFFFF;
}
std::stringstream ss;
ss << std::hex << std::setw(8) << std::setfill('0') << hash;
return ss.str();
}
}
// ============================================================================
// 控制台装饰类
// ============================================================================
class ConsoleDecorator {
public:
static void SetColor(WORD color) {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, color);
}
static void SetForegroundColor(int colorIndex) {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(hConsole, &csbi);
WORD attributes = csbi.wAttributes;
attributes = (attributes & 0xFFF0) | (colorIndex & 0x0F);
SetConsoleTextAttribute(hConsole, attributes);
}
static void SetBackgroundColor(int colorIndex) {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(hConsole, &csbi);
WORD attributes = csbi.wAttributes;
attributes = (attributes & 0xFF0F) | ((colorIndex & 0x0F) << 4);
SetConsoleTextAttribute(hConsole, attributes);
}
static void ResetColor() {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, 7);
}
static void ShowTitle(const std::string& title) {
SetColor(0x0E);
std::cout << "\n========== " << title << " ==========\n";
ResetColor();
}
static void ShowWarning(const std::string& message) {
SetColor(0x0C);
std::cout << "\n[!] WARNING: " << message << "\n";
ResetColor();
}
static void ShowSuccess(const std::string& message) {
SetColor(0x0A);
std::cout << "[+] " << message << "\n";
ResetColor();
}
static void ShowInfo(const std::string& message) {
SetColor(0x0B);
std::cout << "[*] " << message << "\n";
ResetColor();
}
static void ShowError(const std::string& message) {
SetColor(0x0C);
std::cout << "[-] ERROR: " << message << "\n";
ResetColor();
}
};
// ============================================================================
// 拆弹类(密码24位,时间20秒,星号实时显示)
// ============================================================================
// ============================================================================
// 拆弹类(密码24位,时间20秒,星号实时显示,无延迟)
// ============================================================================
// 拆弹类(密码30位,时间20秒,星号实时显示,超低延迟)
// ============================================================================
class BombDefuser {
private:
std::string m_password;
int m_timeLimit;
Logger* m_logger;
HANDLE m_hOut;
COORD m_starPos;
int m_passwordLength; // 密码固定长度
// 生成指定位数的随机数字密码
void GeneratePassword(int length) {
m_passwordLength = length;
m_password = "";
for (int i = 0; i < length; ++i) {
m_password += ('0' + RandomHelper::RandomInt(0, 9));
}
if (m_logger) {
m_logger->Debug("Generated password: " + m_password);
}
}
static std::string ToString(int value) {
std::stringstream ss;
ss << value;
return ss.str();
}
// 刷新星号显示(实时)
void RefreshStars(const std::string& userInput) {
SetConsoleCursorPosition(m_hOut, m_starPos);
// 输出所有星号
for (size_t i = 0; i < userInput.size(); ++i) {
std::cout << '*';
}
// 用空格覆盖多余部分(最大密码长度)
for (size_t i = userInput.size(); i < (size_t)m_passwordLength; ++i) {
std::cout << ' ';
}
// 光标回到起始位置,便于后续继续输入
SetConsoleCursorPosition(m_hOut, m_starPos);
// 强制刷新输出缓冲区
std::cout.flush();
}
// 更新倒计时显示(第一行)
void UpdateTimer(int remaining, const COORD& basePos) {
COORD timePos = basePos;
SetConsoleCursorPosition(m_hOut, timePos);
std::cout << "Time remaining: " << remaining << " seconds ";
std::cout.flush();
}
public:
BombDefuser(int timeLimit = 20, Logger* logger = NULL)
: m_timeLimit(timeLimit), m_logger(logger), m_hOut(NULL), m_passwordLength(30) {
GeneratePassword(30); // 密码长度固定为30位
}
bool StartDefuse() {
ConsoleDecorator::ShowWarning("=== BOMB DEFUSAL MODE ACTIVATED ===");
ConsoleDecorator::ShowInfo("You have " + ToString(m_timeLimit) + " seconds to enter the correct code!");
ConsoleDecorator::ShowInfo("Enter the following code to disarm the bomb:");
ConsoleDecorator::SetColor(0x0E);
std::cout << "\n CODE: " << m_password << "\n\n";
ConsoleDecorator::ResetColor();
ConsoleDecorator::ShowInfo("Type the code and press ENTER. Hurry!");
std::string userInput;
bool done = false;
int remaining = m_timeLimit;
m_hOut = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO cursorInfo;
GetConsoleCursorInfo(m_hOut, &cursorInfo);
BOOL oldVisible = cursorInfo.bVisible;
cursorInfo.bVisible = FALSE;
SetConsoleCursorInfo(m_hOut, &cursorInfo);
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(m_hOut, &csbi);
COORD basePos = csbi.dwCursorPosition;
// 第一行:倒计时
std::cout << "Time remaining: " << remaining << " seconds \n";
// 第二行:输入提示
std::cout << "Enter code: " << std::flush;
// 记录星号起始位置
m_starPos = basePos;
m_starPos.Y += 1;
std::string prompt = "Enter code: ";
m_starPos.X += (SHORT)prompt.size();
// 初始显示空星号
RefreshStars(userInput);
// ---------- 使用 GetTickCount 实现高频率轮询 ----------
DWORD startTime = GetTickCount();
DWORD lastTick = startTime;
while (remaining > 0 && !done) {
// 检查是否过了一秒
DWORD now = GetTickCount();
if (now - lastTick >= 1000) {
lastTick = now;
remaining--;
UpdateTimer(remaining, basePos);
// 如果剩余时间为0,退出循环(后面会处理失败)
if (remaining == 0) {
break;
}
}
// 处理键盘输入(非阻塞)—— 实时响应
if (_kbhit()) {
char ch = _getch();
if (ch == '\r') { // Enter 提交
if (userInput == m_password) {
ConsoleDecorator::ShowSuccess("SUCCESS! Bomb disarmed!");
if (m_logger) m_logger->Info("Bomb defused successfully");
done = true;
break;
} else {
ConsoleDecorator::ShowWarning("Wrong code! Try again.");
userInput.clear();
RefreshStars(userInput);
continue;
}
} else if (ch == '\b') { // 退格
if (!userInput.empty()) {
userInput.erase(userInput.size() - 1);
RefreshStars(userInput); // 立即刷新
}
} else if (ch >= 32 && ch <= 126) { // 可打印字符
userInput.push_back(ch);
RefreshStars(userInput); // ★ 立即刷新,无延迟
}
}
// 极短延迟,保持低 CPU 占用(1ms 几乎无感知)
Sleep(1);
}
std::cout << std::endl;
cursorInfo.bVisible = oldVisible;
SetConsoleCursorInfo(m_hOut, &cursorInfo);
if (!done) {
ConsoleDecorator::ShowError("Time's up! Bomb exploded!");
if (m_logger) m_logger->Fatal("Defusal failed - triggering BSOD");
return false;
} else {
return true;
}
}
};
// ============================================================================
// 主函数
// ============================================================================
int main() {
RandomHelper::InitSeed();
Logger logger("bsod_trigger.log", true, false);
logger.Info("Program started");
logger.Debug("Random seed initialized");
ConsoleDecorator::SetColor(0x0A);
std::cout << "==================================================\n";
std::cout << " " << PROGRAM_NAME << " v" << VERSION_MAJOR << "."
<< VERSION_MINOR << "." << VERSION_BUILD << "\n";
std::cout << " " << PROGRAM_AUTHOR << " (C) " << VERSION_REVISION << "\n";
std::cout << "==================================================\n";
ConsoleDecorator::ResetColor();
SystemInfo sysInfo;
ConsoleDecorator::ShowInfo("Collecting system information ...");
std::cout << sysInfo.GetFullReport() << std::endl;
ConsoleDecorator::ShowInfo("Performing pre-flight checks ...");
ProgressBar progress(100);
for (int i = 0; i <= 100; ++i) {
int dummy = MathUtils::Factorial(i % 10);
dummy += MathUtils::Fibonacci(i % 15);
if (i % 10 == 0) {
std::stringstream ss;
ss << "Checkpoint " << i;
logger.Debug(ss.str());
}
progress.Update(i);
Sleep(10);
}
progress.Complete();
logger.Info("Pre-flight checks completed");
ConsoleDecorator::ShowWarning("This program will trigger a REAL Blue Screen of Death (BSOD)!");
ConsoleDecorator::ShowWarning("ALL UNSAVED DATA WILL BE LOST. The system will restart.");
ConsoleDecorator::ShowWarning("Make sure you have saved all your work before proceeding.");
ConsoleDecorator::SetColor(0x0C);
std::cout << "\n Are you sure you want to continue? (y/N): ";
ConsoleDecorator::ResetColor();
std::string confirm;
std::getline(std::cin, confirm);
if (confirm != "y" && confirm != "Y") {
ConsoleDecorator::ShowInfo("User cancelled. Exiting safely.");
logger.Info("Program cancelled by user");
return 0;
}
// ========== 拆弹环节(密码24位,时间20秒) ==========
BombDefuser defuser(30, &logger); // 时间改为20秒
bool defused = defuser.StartDefuse();
if (defused) {
ConsoleDecorator::ShowInfo("Bomb successfully defused. Exiting safely.");
logger.Info("Program terminated by user defusal.");
return 0;
}
ConsoleDecorator::ShowWarning("Initiating BSOD now...");
// 加密测试
unsigned char key[16] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10};
SimpleCrypto crypto(key, 16);
std::string plainText = "This is a test message to be encrypted before BSOD.";
std::string cipher = crypto.EncryptString(plainText);
std::string decrypted = crypto.DecryptString(cipher);
logger.Debug("Encryption test: " + plainText + " -> " + cipher);
std::string hash = MathUtils::SimpleHash(cipher);
logger.Debug("Hash of cipher: " + hash);
logger.Info("Writing final log entry before crash ...");
logger.Fatal("Triggering BSOD now!");
ConsoleDecorator::SetColor(0x0C);
std::cout << "\n[!!!] TRIGGERING BLUE SCREEN ...\n";
ConsoleDecorator::ResetColor();
BlueScreenTrigger trigger(&logger);
if (!trigger.Initialize()) {
logger.Error("Failed to initialize BSOD trigger. Exiting.");
return 1;
}
#if ENABLE_SIMULATION_MODE
trigger.Simulate();
#else
trigger.Trigger();
#endif
logger.Info("Program exited unexpectedly.");
return 0;
}
全部评论 1
别用,我帮你们试过了
昨天 来自 江西
2用了怎么恢复
昨天 来自 浙江
1强行关机再开机就恢复了
昨天 来自 江西
1hhh
昨天 来自 四川
2




















有帮助,赞一个