确定进程转储是在 x64 还是 x86 计算机上生成
如果我有一个进程转储文件,是否有办法知道转储是在 x64 机器还是 x86 机器上生成的?
If I have a process dump file, is there anyway of knowing if the dump was generated on a x64 machine or x86 machines?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不幸的是,上述答案在大多数情况下不起作用。
如果目标进程构建为 x86 二进制文件,Dupmchk.exe 将为 x86 和 x64 操作系统显示“x86 兼容”。对于我们大多数时间使用的小型转储,!peb 命令还为您提供无用的“PEB NULL...”。
您最好检查“Kernel32.dll”的完整路径,因为 x64 操作系统将加载“C:\Windows\Syswow64\Kernel32.dll”,而 x86 操作系统将加载普通的“C:\Windows” \System32\Kernel32.dll”用于 x86 可执行文件。加载的模块及其路径会记录在 minidump 中,并可通过 dumpchk.exe、windbg 和 Visual Studio 轻松检查。
Unfortunately, above answers don't work in most cases.
Dupmchk.exe will say "x86 compatible" for both x86 and x64 OS if the target process was built as x86 binary. And !peb command also gives you useless "PEB NULL..." for minidumps which we use most of the time.
You would better check the full path of "Kernel32.dll" since x64 OS will load "C:\Windows\Syswow64\Kernel32.dll" instead while x86 OS will load the plain "C:\Windows\System32\Kernel32.dll" for x86 executables. Loaded modules and their paths are recoreded in minidump and easily checked by dumpchk.exe, windbg and Visual Studio.
您可以使用 .effmach 命令了解创建转储的体系结构。请注意,在 WOW64 场景中,转储架构是 x64,但实际上您应该使用 x86 方法对其进行调试(请参阅 !wow64exts.sw 命令)。
0:000> .effmach
有效机器:x64(AMD64)
You can use the .effmach command to know the architecture that the dump was created on. Note that there is the WOW64 scenario where the dump arch is x64 but you should actually debug it with a x86 approach (see !wow64exts.sw command).
0:000> .effmach
Effective machine: x64 (AMD64)
你可以看看环境变量。命令
!peb
的输出除其他外还包含环境变量列表。如果您看到定义了变量PROCESSOR_ARCHITEW6432
或ProgramW6432
,则操作系统是 64 位。否则,它是 32 位的。You can look at the environment variables. Output of command
!peb
, among other things, contains list of environment variables. If you see variablesPROCESSOR_ARCHITEW6432
orProgramW6432
defined, the OS is 64 bit. Otherwise, it is 32 bit.您可以使用 Windows 调试工具附带的 dumpchk.exe 实用程序。只需将转储文件作为参数传递即可。
在生成的报告中,您将获得操作系统版本和 CPU 风格,例如:
You can use the dumpchk.exe utility that ships with Debugging tools for Windows. Simply pass the dump file as the argument.
In the generated report, you'll have the OS version and the CPU flavor, for example :