debugging - 如何查找ucrtbase.dll中指定偏移处执行的代码?

标签 debugging

查看此评论 Windows c++ service faulting on ucrtbase.dll when starting

(从帖子复制)

ucrtbase + 7350e is the int 0x29 instruction in the CRT's abort function. This is the __fastfail intrinsic for a KERNEL_SECURITY_CHECK_FAILURE with the code FAST_FAIL_FATAL_APP_EXIT (7). The interrupt gets serviced by KiRaiseSecurityCheckFailure, which raises STATUS_STACK_BUFFER_OVERRUN (0xC0000409)

从调试的角度来看,那里提供的信息很有用(在学术上很有用,发生溢出不是运行时的错,他只是报告它的不幸的人),该用户如何确定这一点? p>

我意识到提供了 C 语言运行时的一些代码,但是如何从偏移量转换到源文件?

我有一个类似的问题,我正在尝试在这里查找:

Fault Module Name:  ucrtbase.dll
Fault Module Version:   10.0.14393.2097
Fault Module Timestamp: 5a820a13
Exception Offset:   000000000006eabe
Exception Code: c0000409

我正在 ucrtbase + 6eade 寻找代码

最佳答案

即使应用程序未在调试器下运行或内存转储不可用,也可以知道应用程序发生故障的行。它可能不会告诉您失败的原因,但它至少会给您一个开始调查的点。

应用程序失败后,查看 Windows 事件日志中是否有如下条目:

Faulting application yourapp.exe, version 1.0.0.0, time stamp 0x49e0238,
Faulting module yourmodule.dll, version 1.1.0.0, time stamp 0x09ec5a57,
Exception code 0xc0000005,
Fault offset 0x000000000051000e,
Faulting process id 0x00,  Faulting application start time 0x00
...

使用windbg.exe -z c:\yourmodule.dll加载出现故障的模块(确保有符号!) 列出加载的模块(在本例中为 yourmodule.dll)

0:000> lm
start             end                 module name
00000000`00300000 00000000`00425000   yourmodule    (private pdb symbols)  c:\yourmodule.pdb

通过将事件查看器中报告的“故障偏移量”添加到模块的“起始”地址来查找崩溃的行

0:000> ln 300000+5100e
c:\sources\myclass.cpp(130)+0x14

如果您的符号与生产中的模块不完全匹配,您可以在windbg中尝试命令“.symopt +0x40”;这将减少限制。

关于debugging - 如何查找ucrtbase.dll中指定偏移处执行的代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51251391/

相关文章:

c# - 在 Racket 上实现 RC4

typescript - 在Webstorm中从Docker容器远程调试Koa应用程序(Typescript)

javascript - 当 FF 正常时如何调试损坏的 IE 8

debugging - 除了测试现有测试的覆盖率之外,是否还有软件故障注入(inject)的用途?

java - 使用 >>、>、>|、||、|<、<、<< 进行可视化调试

c++ - 委托(delegate)断言

c - strcmp 不给 0,但两个参数相同

debugging - 如何调试 htaccess 重写脚本

wcf - Visual Studio : edit xaml while debugging (without stopping debugging)

debugging - 如何不忘记删除代码中的调试行