zoukankan      html  css  js  c++  java
  • 如何查看一个Application是32位的还是64位的?

    使用process explorer查看,找到对应的进程。

    注册表的路径是ComputerHKEY_LOCAL_MACHINESOFTWAREWOW6432Node

    使用powershell查看

    [reflection.assemblyname]::GetAssemblyName("${pwd}AssemblyTest.exe") | fl    命令中的pwd是指当前路径

    https://stackoverflow.com/questions/270531/how-to-determine-if-a-net-assembly-was-built-for-x86-or-x64

    PS C:UserscluDownloadsFusion++.1.2> [reflection.assemblyname]::GetAssemblyName("${pwd}Fusion++.exe") | fl
    MethodInvocationException: Exception calling "GetAssemblyName" with "1" argument(s): "Could not load file or assembly 'C:UserscluDownloadsFusion++.1.2Fusion++.exe'. The module was expected to contain an assembly manifest."

    使用visual studio自带的CorFlags

    C:Program Files (x86)Microsoft Visual Studio2017Professional>cd "C:Usersclusource eposEdenredTestAssemblyTestinDebug"

    C:Usersclusource eposEdenredTestAssemblyTestinDebug>corflags AssemblyTest.exe
    Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.6.1055.0
    Copyright (c) Microsoft Corporation. All rights reserved.

    Version : v4.0.30319
    CLR Header: 2.5
    PE : PE32
    CorFlags : 0x20003
    ILONLY : 1
    32BITREQ : 0
    32BITPREF : 1
    Signed : 0

    https://stackoverflow.com/questions/18608785/how-to-interpret-the-corflags-flags

    Microsoft .NET 4.5 introduced a new option, Any CPU 32-bit Preferred. In the new version of CorFlags.exe, the 32BIT flag no longer exists, instead, two new flags were added, 32BITREQ and 32BITPREF.

    Somewhere based on the below explanation, we can interpret new CorFlags as follows.

    CPU Architecture           PE      32BITREQ   32BITPREF
    ------------------------   -----   --------   ---------
    x86 (32-bit)               PE32           1           0
    x64 (64-bit)               PE32+          0           0
    Any CPU                    PE32           0           0
    Any CPU 32-Bit Preferred   PE32           0           1
    

    C:UserscluDownloadsFusion++.1.2>corflags "Fusion++.exe"
    Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.8.3928.0
    Copyright (c) Microsoft Corporation. All rights reserved.

    corflags : error CF008 : The specified file does not have a valid managed header

    C:UserscluDownloadsFusion++.1.1>corflags "Fusion++.exe"
    Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.8.3928.0
    Copyright (c) Microsoft Corporation. All rights reserved.

    Version : v4.0.30319
    CLR Header: 2.5
    PE : PE32
    CorFlags : 0x20003
    ILONLY : 1
    32BITREQ : 0
    32BITPREF : 1
    Signed : 0

  • 相关阅读:
    优秀的3D游戏开发系统和虚拟现实技术!
    C#反射实例(转)
    网易学院
    static 并发
    设计模式Strategy 策略模式
    1:统一建模语言UML轻松入门基本概念
    标准CSS 列表写法
    超级简单:ASP.NET Localization (本地化,多语言)
    js用escape()轻松搞定ajax post提交汉字的乱码问题
    认识.NET的集合
  • 原文地址:https://www.cnblogs.com/chucklu/p/10020221.html
Copyright © 2011-2022 走看看