如何判断一个.exe和.dll文件是32bit的还是64bit的

2023-11-16  本文已影响0人  CodingCode
  1. 使用VS工具dumpbin
C:\> dumpbin /headers <exe-or-dll-file>
Microsoft (R) COFF/PE Dumper Version 8.00.40310.39
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file <exe-or-dll-file>

PE signature found

File Type: <type>

FILE HEADER VALUES
             14C machine (x86)
#or
             8664 machine (x64)

看这里的machine字段的值,如果是:

  1. 14C:那就是32bit
  2. 8664:那就是64bit
  1. 如果安装了cygwin或者mks,则可以直接使用file命令
C:\>file <exe-or-dll-file>
<exe-or-dll-file>:     extended DOS executable (.EXE) -- Win32 or NT Portable format
#or
<exe-or-dll-file>:     extended DOS executable (.EXE) -- AMD64
  1. 使用notepad++打开文件查看文件头

搜索第一个出现的字符串"PE",查看后面的可见字符,如果是

  1. L:32bit


    Screen Shot 2023-11-16 at 12.30.42.png
  2. d†:64bit


    Screen Shot 2023-11-16 at 12.29.38.png
上一篇 下一篇

猜你喜欢

热点阅读