简体   繁体   English

检查文件是 32 位还是 64 位 - 在 Windows 上

[英]Checking if file is 32bit or 64bit - on Windows

我正在我的 64 位机器上编译一个程序,但我不确定它是生成 32 位还是 64 位输出。如何在 Windows 上检查文件是 32 位还是 64 位?

You can use GNUfile for windows.您可以将GNUfile用于 Windows。
You can run the app thru PEID Lastly (and preferred- less room for error) With either Visual Studio C++ (at least express edition minimum) or the Platform SDK installed you can use dumpbin /headers to look at the PE header values.您可以通过PEID最后运行应用程序(以及首选的错误余地) 使用 Visual Studio C++(至少是 Express 版本最低)或安装了Platform SDK,您可以使用 dumpbin /headers 查看 PE 标头值。

The first value in the file header tells you the architecture: either 0x14C for x86 or 0x8664 for x64文件头中的第一个值告诉您架构:x86 为 0x14C 或 x64 为 0x8664

Just run it and have a look at the Processes tab in Windows Task Manager.只需运行它并查看 Windows 任务管理器中的进程选项卡。 If there is a *32 suffix after the process name, it's 32-bit, otherwise it's 64-bit (provided you're on a 64-bit OS).如果进程名称后有 *32 后缀,则为 32 位,否则为 64 位(前提是您使用的是 64 位操作系统)。

You could run the 'file' command from linux in a cygwin environment to test.您可以在 cygwin 环境中从 linux 运行“文件”命令进行测试。

You could also place some debug statement like 'print sizeof(int)' (schematically) to check.您还可以放置一些调试语句,例如 'print sizeof(int)'(示意性地)进行检查。

You may use EXE Explorer by MiTec, a small free tool.您可以使用 MiTec 的EXE Explorer ,这是一个免费的小工具。 It also displays many other properites of the binary file it checks.它还显示它检查的二进制文件的许多其他属性。

I had the same question as the original poster and the EXE Explorer works for me quite well.我和原始海报有同样的问题, EXE Explorer对我来说效果很好。

http://ntinfo.biz/ - Detect It Easy. http://ntinfo.biz/ - 轻松检测。

Or just GNU Binutils objdump -f my.exe或者只是 GNU Binutils objdump -f my.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM