Windows如何区分常规EXE和.NET exe? [英] How does Windows differentiate between a regular EXE and a .NET exe?

查看:135
本文介绍了Windows如何区分常规EXE和.NET exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一次采访中,有人问我Windows OS如何区分常规EXE和.NET EXE。

I was asked in an interview as to how Windows OS differentiate between a regular EXE and a .NET EXE.

我的答复是,构建.NET exe时,编译器会将一些信息放入标头中。信息为PE32或PE32 +。 Windows会验证标头,以确定它是否需要加载MSCOREE.dll,以加载CLR并执行EXE。

My reply was, when a .NET exe is build, the compiler puts some information into the header. The information is PE32 or PE32+. Windows verifies the header to determine if it needs to load MSCOREE.dll which loads the CLR and executes the EXE.

我的答案正确吗?

推荐答案

我同意<通常,在许多情况下,a href = https://stackoverflow.com/questions/2638883/2639041#2639041> GregC 很有用。但这是一个很难在面试中回答的难题(除非是针对CLR团队:)

While I agree with GregC in general there are times when this type of information is useful. But that is one tough question to be expected to answer in an interview (unless it's for the CLR team :)

网页和博客... strong>

  • Portable Executable (wikipedia)

图书...

  • Expert .NET 2.0 IL Assembler (I thought this was a great book)

这篇关于Windows如何区分常规EXE和.NET exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆