注意:我对禁用WER 不感兴趣,我对WER未启动的崩溃场景感兴趣,尽管它应该和Windows"默默地"终止应用程序.
在Windows XP上,编写一个C或C++应用程序(在用户模式下)是非常简单的,它会以这样的方式混淆自己的地址空间,当最终引发访问冲突(或其他未处理的Win32异常)时,Windows XP将会只是默默地终止进程而不通知用户:
...
void stackbreaker() {
printf("%s\n", __FUNCTION__);
// global/static buffer
static char buf[128] = "In a hole in the ground there lived a hobbit. And it burrowed through your stack. It even built a round door into you function.";
// Get address on the stack
char local;
char* stack = &local;
// nuke the stack:
memcpy(stack - 64, buf, sizeof(buf));
// Kaboom. No user defined unhandled exception filter will …Run Code Online (Sandbox Code Playgroud) winapi unhandled-exception visual-c++ windows-7 windows-error-reporting