开发者

Is it possible to determine what language a .NET assembly was written in?

开发者 https://www.devze.com 2023-01-10 02:01 出处:网络
Is there a method to determine the original language of a .NET assembly if the source code is not avail开发者_高级运维able?Not really, but you can sometimes make a guess.

Is there a method to determine the original language of a .NET assembly if the source code is not avail开发者_高级运维able?


Not really, but you can sometimes make a guess.

For example, if you have a VB.NET assembly containing anonymous types, the compiler-generated name in the assembly will look something like this:

VB$AnonymousType_T<T0, T1>

Anonymous types in a C# assembly look like this:

<>f__AnonymousType0<....>

Different compilers will implement these sorts of things slightly different. C++/CLI assemblies tend to have lots of types in the assembly with "funny" names (for things like functions that belong to the global scope and so on).

Visual Basic applications also reference the Microsoft.VisualBase assembly (though any .NET app can technically reference any assembly, so that's not a 100% indicator).


You can guess by looking at what assemblies it references. If you see one of Microsoft.CSharp or Microsoft.VisualBasic, for example, that could give you a big hint.


Not really since they're all roughly compiled to the same IL.

0

精彩评论

暂无评论...
验证码 换一张
取 消