I'm looking for a solution to determine whether a given executable is 64-bit or 32-bit.
The executable being tested may be .NET based or not.
I've seen multiple different techniques, not sure in what one differs from the other.
Techniques i've seen listed:
- Using dumpbin.exe (comes with Visual Studio or Windows SDK)
- Win32 function GetBinaryType http://msdn.microsoft.com/en-us/library/windows/desktop/aa364819(v=vs.85).aspx
- Checking the file's headers (demonstrated in this Q: How can I determine for which platform an executable is compiled?)
What is the most robust way of doing it ?