模拟蓝屏
我正在尝试制作一个程序来定期记录一大堆事情。 具体原因是,如果出现蓝屏,开发人员可以回去检查很多环境,看看当时发生了什么。
我的问题是,他们是导致蓝屏的一种方法吗? 也许通过 windowsAPI 调用(也许是零内存?)。
无论如何,如果你能想出一种方法来导致蓝屏,我将不胜感激。
我正在测试的计算机就是为了接受这样的东西而设计的,哈哈。
顺便说一句,我使用的语言是C\C++。 谢谢
I am trying to make a program that records a whole bunch of things periodically.
The specific reason is that if it bluescreens, a developer can go back and check a lot of the environment and see what was going on around that time.
My problem, is their a way to cause a bluescreen?
Maybe with a windowsAPI call (ZeroMemory maybe?).
Anywhoo, if you can think of a way to cause a bluescreen on call I would be thankful.
The computer I am testing this on is designed to take stuff like this haha.
by the way the language I am using is C\C++.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
您可以将计算机配置为按击键 (Ctrl-ScrollLock) 时崩溃
由于有时这在某些带有 USB 键盘的系统上不起作用,您还可以获取 Windows 调试工具,安装内核调试器,并使用“
.kb/244139”。 crash
”命令强制进行错误检查。You can configure a machine to crash on a keystroke (Ctrl-ScrollLock)
Since it appears that there are times when that won't work on some systems with USB keyboards, you can also get the Debugging Tools for Windows, install the kernel debugger, and use the "
.crash
" command to force a bugcheck.为了导致 BSOD,在内核模式下运行的驱动程序需要导致它。 如果您确实想这样做,您可以编写一个向用户模式公开 KeBugCheck 的驱动程序。
http://msdn.microsoft.com/en-us/library/ms801640。 aspx
感谢下面的 Andrew 指出了这个实用程序:
http://download.sysinternals .com/files/NotMyFault.zip
In order to cause a BSOD, a driver running in kernel mode needs to cause it. If you really want to do this, you can write a driver which exposes KeBugCheck to usermode.
http://msdn.microsoft.com/en-us/library/ms801640.aspx
Thanks to Andrew below for pointing this utility out:
http://download.sysinternals.com/files/NotMyFault.zip
如果你终止 csrss 进程,你很快就会出现蓝屏。
If you kill the csrss process you'll get a blue-screen rather quickly.
如果你想模拟蓝屏等严重崩溃,你几乎必须拔掉电源线。 不建议。
如果发生崩溃,任何未保存到持久存储的内容都将丢失。 如果您想模拟崩溃以进行日志记录,请在记录器中写入“终止开关”,以停止日志记录。 现在,您可以通过终止日志记录并确保拥有实际崩溃时所需的数据来模拟崩溃。
If you want to simulate a hard crash such as a bluescreen, you'd pretty much have to yank the power cord. NOT recommended.
In case of a crash, anything not saved to persistent storage will be lost. If you want to simulate a crash for purposes of logging, write a "kill switch" into your logger, which stops the logging. Now you can simulate a crash by killing the logging and making sure you have the data you would have wanted in case of an actual crash.
首先,我建议您使用虚拟机来测试此 BSOD< /a> 上。 这将允许您保留备份,以防 BSOD 对系统造成一些损坏。 以下是有关如何生成 BSOD 只需按 CTRL+SCROLLLOCK+SCROLLLOCK< /a>.
有 Windows API 可以生成一个吗? 不,根据这篇文章。 尽管如此,如果您使用无效数据调用某些 API,它们仍然可能导致内核内部崩溃,从而导致 BSOD。
First of all, I would advise you to use a Virtual Machine to test this BSOD on. This will allow you to keep a backup just in case the BSOD does some damage to the system. Here's a tip on how to generate a BSOD simply by pressing CTRL+SCROLLLOCK+SCROLLLOCK.
Is there a Windows API to generate one? No, according to this article. Still, if you would call certain API's with invalid data, they could still cause a crash inside the kernel, which would result in your BSOD.
我不确定你要测试什么。 由于您的程序定期运行,因此在系统运行时检查信息是否按照您指定的频率转储就足够了吗? 您是否检查蓝屏后信息是否保留? 根据您转储它的方式(以及是否刷新缓冲区),这可能不是必需的。
I'm not sure exactly what you'd be testing. Since your program runs periodically, surely it's enough to check that the information is being dumped at the frequency that you specify while the system is running? Are you checking that the information stays around after the blue screen? Depending on how you are dumping it (and whether you are flushing buffers), this may not be necessary.
如果您不想编写代码(驱动程序、IOCTL...),您可以使用 DiskCryptor。 请注意,不需要磁盘加密。
只需要安装驱动即可:
然后使用DC控制台生成bsod:
If you dont want to write code (driver, IOCTL...) you can use DiskCryptor. Note that no disk encrypting is need.
Just need to install the driver:
And then generate a bsod using the DC console:
以批评者身份运行进程并退出 http://waleedassar.blogspot.co.uk/2012 /03/rtlsetprocessisritic.html
Run process as critic and exit http://waleedassar.blogspot.co.uk/2012/03/rtlsetprocessiscritical.html