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 or 64bit on Windows?
-
Linux, Windows, or ??? Solaris is already all 64 bit. – kmarsh Apr 21 '10 at 12:16
-
Sorry - windows.. Yeah, that was kinda essential.. – stiank81 Apr 21 '10 at 12:19
-
1For future answer seekers, this Windows Explorer extension allows you to view 32/64 bit architecture information inside your file manager without using external tool: http://sanje2v.wordpress.com/2013/12/10/writing-property-handler-for-windows-explorermanta-property-extension/ . Also supports DLL, LIB, OBJ, O and A files. – Sanjeev Dec 16 '13 at 04:03
5 Answers
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

- 304
- 8
- 20
-
1Works fine! Didn't bother running it through PEID etc though. Ran with Cygwin. Works just fine. And it doesn't say 0x14C/0x86664, but PE32 for x86 and PE32+ for x64. – stiank81 Apr 26 '10 at 08:56
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).

- 9,240
- 6
- 35
- 42
-
3Well yes that'll work but it's not entirely sensible to just run a program to find out whether it's 32 or 64 bit. Also, you may not have a 64 bit machine to do that with. – WheresAlice Apr 21 '10 at 12:38
-
1if you only have a 32bit machine then it would not run if it was a 64bit app! – JamesRyan Apr 21 '10 at 15:31
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.

- 1,207
- 3
- 13
- 23
-
Sounds like a terrific idea. I'm running Cygwin, but when I try using "file" it says "command not found". Is this actually available on Cygwin? If so I guess I must've forgotten to install some package..? – stiank81 Apr 21 '10 at 12:54
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.

- 9,204
- 4
- 72
- 118

- 11
- 1
http://ntinfo.biz/ - Detect It Easy.
Or just GNU Binutils objdump -f my.exe

- 45,285
- 19
- 251
- 303