使用 WinDbg 查找模块的基地址

发布于 2025-01-16 12:19:46 字数 51 浏览 1 评论 0原文

如何确定 WinDbg 中特定模块(例如 ntoskrnl.exe)的基地址?这可能吗?

How can I determine the base address of a particular module (say, for instance, ntoskrnl.exe) in WinDbg? Is that possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十秒萌定你 2025-01-23 12:19:46

lm(列表模块)显示 DLL 的信息。您可以使用lm m按名称进行过滤,例如

0:000> lm m ntdll
Browse full module list
start    end        module name
77b90000 77d33000   ntdll      (pdb symbols)          d:\debug\symbols\wntdll.pdb\1074039C87B27BF997A06A9E2B1C84E61\wntdll.pdb

“start”列中的数字是基地址。您可以使用 !lmi 确认这只是一个不同的术语。该命令的输出明确提到“基地址”:

0:000> !lmi ntdll
Loaded Module Info: [ntdll] 
         Module: ntdll
   Base Address: 77b90000
[...]

事实上,模块本身的名称可以用作基地址,因此您实际上不需要复制/粘贴、键入或记住基地址。例如,

0:000> db 77b90000 L2
77b90000  4d 5a                                            MZ

您也可以使用

0:000> db ntdll L2
77b90000  4d 5a                                            MZ

(实际上 !lmi 的示例已经使用了该技巧)

lm (list modules) shows the information for DLLs. You can filter by name using lm m <name>, e.g.

0:000> lm m ntdll
Browse full module list
start    end        module name
77b90000 77d33000   ntdll      (pdb symbols)          d:\debug\symbols\wntdll.pdb\1074039C87B27BF997A06A9E2B1C84E61\wntdll.pdb

The number in the "start" column is the base address. You can confirm that it's just a different term by using !lmi. The output of that command explicitly mentions "Base address":

0:000> !lmi ntdll
Loaded Module Info: [ntdll] 
         Module: ntdll
   Base Address: 77b90000
[...]

In fact, the name of the module itself can be used as the base address, so you don't actually need to copy/paste, type or remember the base address. E.g. instead of

0:000> db 77b90000 L2
77b90000  4d 5a                                            MZ

you can also use

0:000> db ntdll L2
77b90000  4d 5a                                            MZ

(actually the example with !lmi used that trick already)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文