Reputation: 7183
Is there a way to know how a DLL file was generated like VC++, C#, VB or something else ?
EDIT: I just want a way to know how my dll was generated, so far I know it is unmanaged code but nothing more.
Upvotes: 2
Views: 1138
Reputation: 114461
There are clear indicators, but no absolute way to tell this from looking at the assembly or the IL. The different compilers have signature ways in which they solve certain problems, which allows you to do a good guess of which compiler was used to produce the output. With Roslyn this has become harder for C# and VB.NET as they share the same compiler infrastructure now.
There are some language features which are unique to a language, which can be a clear indicator.
And there is a set of referenced assemblies for the different languages which are used when creating projects from Visual Studio. However, a C# developer can still reference the Microsoft.VisualBasic assembly, so this is no sure way either. Plus, if none of the features of these assemblies are used in the code, the reference will be removed during compilation.
So to conclude, there is no clear way to tell the exact language used to produce the code. It's not an attribute of the assembly, it's not stored in the header or anything.
A windows .dll or .exe file has a PE header, it contains some information about the type of project. If it has a CLR header, then it's built for the .NET runtime (you still don't know by what, but you knows its target). By looking for common dependencies (like the VB runtime) with a dependency checker you can make a likely guess the app was written for VB6 or earlier.
See also:
Upvotes: 2