windowsvisual-studio32-bitanycpudumpbin

Determine if program was built with AnyCPU


After reading this comment

If it is built in "any cpu", it will show up as 32bit in dumpbin headers.

I would like to know how I can tell a regular 32-bit program from an AnyCPU program. I would prefer to do this from the command line if possible. I tried

dumpbin YourProgram.exe /headers

on a program of each type, but could not tell them apart in this way.


Solution

  • Compare these two

    PS > Start-Process -PassThru chocolatey.exe | Get-Process -Module
    
       Size(K) ModuleName
       ------- ----------
            40 chocolatey.exe
          1700 ntdll.dll
           444 MSCOREE.DLL
          1148 KERNEL32.dll
           432 KERNELBASE.dll
    
    PS > Start-Process -PassThru firefox.exe | Get-Process -Module
    
       Size(K) ModuleName
       ------- ----------
           272 firefox.exe
          1700 ntdll.dll
           252 wow64.dll
           368 wow64win.dll
            32 wow64cpu.dll
    

    So if you see wow64.dll then it is 32-bit, otherwise the program is 64-bit capable.