Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You must be talking about the output you see from Dumpbin.exe with the /headers option. Which looks like this when run on a .NET assembly that's compiled with the platform target set to AnyCPU:</p> <pre><code>Dump of file ConsoleApplication1.exe PE signature found File Type: EXECUTABLE IMAGE FILE HEADER VALUES 14C machine (x86) 3 number of sections 4E3E987F time date stamp Sun Aug 07 08:51:59 2011 0 file pointer to symbol table 0 number of symbols E0 size of optional header 102 characteristics Executable 32 bit word machine etc.. </code></pre> <p>Yes, the IMAGE_FILE_HEADER.Machine value is set to 0x14c, the value of IMAGE_FILE_MACHINE_I386 (aka x86). This is of no consequence, perhaps the strongest hint that it is not relevant is the target name: AnyCPU. It runs as well on an x86 as on an x64 operating system.</p> <p>What you really want to use is corflags.exe, it shows you the COR header in the file:</p> <pre><code>Version : v4.0.30319 CLR Header: 2.5 PE : PE32 CorFlags : 1 ILONLY : 1 32BIT : 0 Signed : 0 </code></pre> <p>The 32BIT flag is the important one, 0 indicates that AnyCPU was used. ILONLY = 1 indicates that the assembly contains IL only, no machine code. It will be 0 when you create assemblies with the C++/CLI language.</p> <p>You <em>can</em> create an image file with the machine set to x64. I think that was introduced in .NET 3.0 (aka .NET 2.0 SP1). If you set the platform target to x64 then the machine type field will be set to IMAGE_FILE_MACHINE_AMD64 (aka x64). That doesn't make much difference, other than that the program will never run on a 32-bit operating system and that the main thread will get started with a 4 megabyte stack instead of a 1 MB stack.</p> <p>The magic that turns a 32-bit executable image into a 64-bit process is described in <a href="https://stackoverflow.com/questions/10389756/how-does-corflags-exe-32bit-work/10392396#10392396">this answer</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload