How to find if native dll is compiled as x64 or x86?
来源:互联网 发布:tomcat nginx 编辑:程序博客网 时间:2024/05/01 15:59
Question:
I want to determine if native assembly is complied as x64 or x86 from a managed code application (c#). I think it must somewhere in the PE header since the OS loader needs to know this info but I couldn't find it. I prefer of course to do it in managed code but if it necessary I can use native C++.
Answer:
In case anyone is still looking for this (I just got here from google) there is an easy way to do this withcorflags. Open Visual Studio Command Prompt and type "corflags [your assembly]". You'll get something like this:
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>corflags "C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll"
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.21022.8 Copyright (c) Microsoft Corporation. All rights reserved.
Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 24
ILONLY : 0
32BIT : 0
Signed : 1
You're looking at PE and 32BIT specifically.
AnyCpu:
PE: PE32
32BIT: 0x86:
PE: PE32
32BIT: 1x64:
PE: PE32+
32BIT: 0
- How to find if native dll is compiled as x64 or x86?
- How to find if native dll is compiled as x64 or x86?
- How to: Determine if a Package that is About to be Compiled is Being Used Currently (文档 ID 1054939.6
- experiment : judge PE file is x86 or x64
- C Tips: How to tell if system is little endian or big endian?
- C# Tips: How to tell if system is little endian or big endian?
- How to check if a Number is Positive or Negative in Java - Interview Question
- How to justify if a windows program is 32 bit or 64 bit
- Linux / Unix Script: Simple Process Checker To Find Out If A Service Is Running or Not
- check if unmanaged dll is 32-bit or 64-bit?
- How to save a web page as HTML or MHT
- How to mark volume groups as active or inactive
- How to find the crash point: Android Native crash
- C++ How to tell if a .lib file was compiled with compiler option /MT, /MD, /MTd, /MDd, /clr etc?
- How to Load a Java Native/Dynamic Library (DLL)
- How to Load a Java Native/Dynamic Library (DLL)
- How to judge if an iterator is used before.
- How to determine if a machine is localhost?
- jira 4.2配置oracle
- 精仿时尚女性网DEDE5.7模板下载GBK UTF8双版本
- CSS的优先级别
- Android应用开发基础篇(14)-----自定义标题栏
- loadrunner 三种post函数区别
- How to find if native dll is compiled as x64 or x86?
- 写在00100010岁
- html doctype 浅见
- 雕虫小技让Discuz利用WinwebMail发邮件
- win7使用笔记本做wifi热点
- LightHouse3D的GLSL教程
- CGI中表单信息的编码规则
- Flex中的CSS: (2)三种基本类型的CSS会被编译器转换为什么样的AS代码?
- CentOS6下VNC的安装与配置