gaurav pawaskar
gaurav pawaskar

Reputation: 65

.Net DLL vs C++ DLL

How to differentiate between .NET DLL and C++ dll without looking at the code. Can we identify it by looking at the export table or other section of DLL after looking into DLL from any PE file explorer?

Upvotes: 3

Views: 2351

Answers (2)

mox
mox

Reputation: 6314

As a matter of fact, this is clearly indicated by looking at the Image file and is documented by the Portable Executable format specification. Should the Directory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR] be present (not EMPTY), the image is Managed (.NET) otherwise the image is unmanaged.

Upvotes: 0

Mike Miller
Mike Miller

Reputation: 16575

You might be able to use corflags

For a .NET c# DLL I get

Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.0.30319.1 Copyright (c) Microsoft Corporation. All rights reserved.

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

For a C++ DLL I get

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

**** UPDATE ****

I might have misunderstood the question. This is a good SO question on a similar problem. How can I test a Windows DLL file to determine if it is 32 bit or 64 bit?

Upvotes: 1

Related Questions