使用托管代码调用蓝屏死机 [英] Invoke Blue Screen of Death using Managed Code

查看:30
本文介绍了使用托管代码调用蓝屏死机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里只是好奇:是否可以在 Windows XP/Vista 下使用 .net 托管代码调用 Windows 蓝屏死机?如果可能,示例代码是什么?

Just curious here: is it possible to invoke a Windows Blue Screen of Death using .net managed code under Windows XP/Vista? And if it is possible, what could the example code be?

只是为了记录,这不是出于任何恶意目的,我只是想知道实际杀死指定的操作系统需要什么样的代码.

Just for the record, this is not for any malicious purpose, I am just wondering what kind of code it would take to actually kill the operating system as specified.

推荐答案

键盘的东西可能是一个不错的选择,但如果你需要通过代码来做,继续阅读...

The keyboard thing is probably a good option, but if you need to do it by code, continue reading...

本质上,您实际上并不需要任何东西,您只需找到 KeBugCheck(Ex) 函数并调用它即可.

You don't really need anything to barf, per se, all you need to do is find the KeBugCheck(Ex) function and invoke that.

http://msdn.microsoft.com/en-us/library/ms801640.aspxhttp://msdn.microsoft.com/en-us/library/ms801645.aspx

对于手动启动的崩溃,您希望使用 0xE2 (MANUALLY_INITIATED_CRASH) 或 0xDEADDEAD (MANUALLY_INITIATED_CRASH1) 作为错误检查代码.它们被明确保留用于该用途.

For manually initiated crashes, you want to used 0xE2 (MANUALLY_INITIATED_CRASH) or 0xDEADDEAD (MANUALLY_INITIATED_CRASH1) as the bug check code. They are reserved explicitly for that use.

然而,找到这个函数可能有点棘手.Windows DDK 可能会有所帮助(检查 Ntddk.h) - 我目前没有它,而且我现在似乎无法找到决定性信息 - 我认为它在 ntoskrnl.exe 中或 ntkrnlpa.exe,但我不确定,目前也没有验证它的工具.

However, finding the function may prove to be a bit tricky. The Windows DDK may help (check Ntddk.h) - I don't have it available at the moment, and I can't seem to find decisive info right now - I think it's in ntoskrnl.exe or ntkrnlpa.exe, but I'm not sure, and don't currently have the tools to verify it.

您可能会发现编写一个简单的 C++ 应用程序或调用函数的东西,然后直接运行它会更容易.

You might find it easier to just write a simple C++ app or something that calls the function, and then just running that.

请注意,我假设 Windows 不会阻止您从用户空间访问该函数(.NET 可能有一些特殊规定).我自己没有测试过.

Mind you, I'm assuming that Windows doesn't block you from accessing the function from user-space (.NET might have some special provisions). I have not tested it myself.

这篇关于使用托管代码调用蓝屏死机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆