After examining header values from Richard's answer, I came up with a solution which is fast, easy, and only requires a text editor. Even Windows' default notepad.exe would work.
Open the executable in text editor. You might have to drag-and-drop or use the editor's
Open...
dialog, because Windows doesn't showOpen with...
option in context menu for executables.Check the first printable characters after the first occurrence of
PE
. This part is most likely to be surrounded by at least some whitespace (could be a lot of it), so it can be easily done visually.
Here is what you're going to find:
x86:
PE L
x64:
PE d†
A word of warning: using default Notepad on big files can be very slow, so better not use it for files larger than a megabyte or few. In my case in took about 30 seconds to display a 12 MiB file. Notepad++, however, was able to display a 120 MiB executable almost instantly.
This is solution might be useful in case you need to inspect a file on a machine you can't install any additional software on.
Additional info:
If you have a HEX-Editor available, the offset of PE Signature is located at offset 0x3C
. The signature is PE\0\0
(letters "P" and "E" followed by two null bytes), followed by a two byte Machine Type in Little Endian.
The relevant values are 0x8664
for x64 executable and 0x14c
for x86. There are a lot more possible values, but you probably won't ever encounter any of these, or be able to run such executables on your Windows PC.
Full list of machine types, along with the rest of .exe specifications can be found in Microsoft PE and COFF Specification Machine Types section.