Invoke Blue Screen of Death using Managed Code

后端 未结 11 2187
轮回少年
轮回少年 2020-12-30 01:25

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

11条回答
  •  -上瘾入骨i
    2020-12-30 02:03

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

    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.aspx http://msdn.microsoft.com/en-us/library/ms801645.aspx

    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.

    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.

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

    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.

提交回复
热议问题