WinDBG - 如何设置要传递到应用程序的所有异常? [英] WinDBG - how to set all exception to be passed into app?

查看:18
本文介绍了WinDBG - 如何设置要传递到应用程序的所有异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将所有异常行为设置为传递给应用程序而不出现在调试器中?

How can I set all exceptions behavior to pass to application and not appear in debugger?

我使用的是 IDA Pro 6.6 和 WinDbg.

I'm using IDA Pro 6.6 and WinDbg.

推荐答案

一次对所有异常类型这样做有点尴尬

It's a bit awkward to do that for all exception types at once

.foreach(exc {sx}) {.catch{sxd ${exc}}}

它的作用:

  • {sx}:列出所有异常类型(以及您实际上不想要的当前设置)
  • exc:赋值一个变量
  • .foreach(...) {...}:将其切成单个单词并执行命令
  • sxd ${exc}:禁用变量 exc
  • .catch{...}:忽略所有来自设置信息的错误信息
  • {sx}: list all exception types (and current settings, which you actually don't want)
  • exc: assign a variable
  • .foreach(...) {...}: cut it into pieces of single words and execute a command
  • sxd ${exc}: disable whatever is in variable exc
  • .catch{...}: ignore all the error messages which come from the settings information

上述方法的优点是它与 WinDbg 版本无关.如果引入了新的异常代码,它仍然有效.

The advantage of the above approach is that it is WinDbg version independent. If new exception codes are introduced, it will still work.

使用 PyKd 可以避免处理不需要的文本.将以下脚本保存到文件 sdx.py 中并运行 !py sxd.py:

Processing of unwanted text can be avoided with PyKd. Save the following script into a file sdx.py and run !py sxd.py:

from pykd import *

sx = dbgCommand("sx")
for s in sx.splitlines():
    ex = s[:4]
    if  not ex=="" or ex.isspace():
        print("sxd "+ex)
        dbgCommand("sxd "+ex)

另一个选项是手动处理所有异常:

Another option is processing all the exceptions manually:

.foreach(exc {.echo "ct et cpr epr ld ud ser ibp iml out av asrt aph bpe bpec eh clr clrn cce cc dm dbce gp ii ip dz iov ch hc lsq isc 3c svh sse ssec sbo sov vs vcpp wkd rto rtt wob wos *"}) {.catch{sxd ${exc}}}

但是,如果WinDbg中有新的异常代码,则必须将它们添加到.echo命令中.

However, if there are new exception codes in WinDbg, you have to add them to the .echo command.

这篇关于WinDBG - 如何设置要传递到应用程序的所有异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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