Checking if file is 32bit or 64bit - on Windows
I'm compiling a program on my 64bit machine, but I'm not sure if it produces 32-bit or 64-bit output.. How can I check if a file is 32bit o开发者_运维问答r 64bit on Windows?
You can use GNUfile for 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.
The first value in the file header tells you the architecture: either 0x14C for x86 or 0x8664 for x64
Just run it and have a look at the Processes tab in Windows Task Manager. 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).
You could run the 'file' command from linux in a cygwin environment to test.
You could also place some debug statement like 'print sizeof(int)' (schematically) to check.
You may use EXE Explorer by MiTec, a small free tool. 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.
http://ntinfo.biz/ - Detect It Easy.
Or just GNU Binutils objdump -f my.exe
精彩评论