gpt4 book ai didi

windows - 为什么 dumpbin 中可执行文件的入口点地址与 WinDbg 不同?

转载 作者:可可西里 更新时间:2023-11-01 11:23:19 28 4
gpt4 key购买 nike

我想了解加载可执行文件的机制,所以我用 notepad.exe 做了两个不同的测试

1) 运行转储命令:

dumpbin /ALL "C:\Windows\System32\notepad.exe" /OUT:"C:\sample\log4.txt" 

我在 OPTIONALHEADER VALUES 下得到了以下值:

1AC50 entry point (000000014001AC50) WinMainCRTStartup
1000 base of code
140000000 image base (0000000140000000 to 0000000140042FFF)

2) 运行 WinDbg:

x notepad!*CRT* 

我得到了这些:

00b9bf9a          notepad!__mainCRTStartup (void)
00b9bf90 notepad!WinMainCRTStartup (<no parameter info>)
00ba04a4 notepad!msvcrt_NULL_THUNK_DATA = <no type information>
00ba050c notepad!_IMPORT_DESCRIPTOR_msvcrt = <no type information>

我不明白为什么 14001AC50 和 00b9bf90 是不同的值。它们不应该是相同的 AddressOfEntryPoint 值吗?

提前致谢

最佳答案

造成这种差异的原因有几个。

首先,您正在 x64 版本的 notepad.exe 上运行 dumpbin,存储在 System32 中,但您似乎正在调试 x86 notepad.exe 存储在 SysWoW64 中。确保您已启动 x64 或 AMD64 版本的 WinDbg 并且您正在附加到 C:\Windows\System32\notepad.exe

一旦一切都解决了,事情应该开始变得更有意义了,但还有一件事要记住。 x WinDbg 中的命令显示正在运行的进程中符号的虚拟内存地址,而 dumpbin 将其显示为模块基地址的偏移量。

从模块库中快速减去一些东西应该匹配。

这是它在我的系统上的样子:

C:\>dumpbin /ALL "C:\Windows\System32\notepad.exe" | find "entry point"
1AC50 entry point (000000014001AC50) WinMainCRTStartup

0:000> x notepad!WinMainCRTStartup
00007ff6`4fe1ac50 notepad!WinMainCRTStartup (<no parameter info>)
0:000> ? notepad!WinMainCRTStartup - notepad
Evaluate expression: 109648 = 00000000`0001ac50

Matching entry point addresses

关于windows - 为什么 dumpbin 中可执行文件的入口点地址与 WinDbg 不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54888416/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com