How to determine whether a file is 32 bit or 64 bit

    On Unix/Linux platform, 'file' instruction can be used.


    On Windows platform,  four methods are introduced as follows:

1) View exe/dll/ocx type file with CFF Explorer

    CFF Explorer is a Windows PE format file editor. Its web site is : http://www.ntcore.com/exsuite.php . Open the file with CFF Explorer, find 'File Type' line in right sub-window, the digital 32 or 64 in column 'Value' denotes the bits of the file.

Example: view a 32 bit exe file with CFF Explorer



Example: view a 64 bit exe file with CFF Explorer



2) View exe/ocx type file with the hex editor embedded in CFF Explorer

    A hex editor is embedded in CFF Explorer. Open a file with it, and view the file with the hex editor. If 'PE..L' is found (its corresponding hex value is '50 45 00 00 4C'), the file is 32 bit type. 

Example: view a 32 bit exe file with the hex editor embedded in CFF Explorer



    If 'PE..d' is found (its corresponding hex value is '50 45 00 00 64'), the file is 64 bit type. 

Example: view a 64 bit exe file with the hex editor embedded in CFF Explorer



3) View exe/dll/ocx type file with Dependency Walker

    Dependency Walker is a powerful tool. Its web site is : http://dependencywalker.com . Note that you must use the 64 bit version of Dependency Walker on 64 bit Windows OS.  The 64 bit version of Dependency Walker can be downloaded from its web site.



    Open a file with Dependency Walker, the value in column 'CPU' denotes the bit number of the file. 'x86' means the file is 32 bit type. 'x64' means the file is 64 bit type.

Example: view a 32 bit dll file in 64-bit Windows 7 (C:\Windows\SysWOW64\aaclient.dll) with Dependency Walker



Example: view a 64 bit dll file in 64-bit Windows 7 (C:\Windows\System32\aaclient.dll) with Dependency Walker



4) View lib/exe/dll/ocx type file with dumpbin.exe
    CFF Explorer and Dependency Walke cannot be used to view a lib type file. Only 'dumpbin.exe' can do this. 'dumpbin.exe' is a command line tool included in Visual Studio. To view the bit version of a file, use the instruction: 
    dumpbin /headers filename
    In 'FILE HEADER VALUES' section, '14C machine (x86)' denotes the file is 32 bit version, and '8664 machine (x64)' denotes the file is 64 bit version.
Example: view a 32 bit lib file with dumpbin



Example: view a 64 bit lib file with dumpbin


猜你喜欢

转载自blog.csdn.net/henter/article/details/79445622
BIT