Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / July 2006

Tip: Looking for answers? Try searching our database.

Determining executable code type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ebucis@gmail.com - 29 Jul 2006 13:29 GMT
Hi,
   I am developing an application that loads at runtime executable
code, investigates it and catalogs it (stores some information about
it).
When the executable is managed code, using reflection i can obtain the
metadata information and add it to the catalog. But when the executable
(exe or dll) is an unmanaged code I prompt the user and let him provide
some "metadata".
My problem is that I have not been successful correctly identifying
manage code from unmanaged code at runtime.
My first approach was to expect an exception if i tried to load a dll
or exe using reflection, but at the end of the day, there are a lot of
more reasons for an assembly not to load (e.g. missing required
references).

At this point I don't know what to do.

Thanks,

Lester
Michael Nemtsev - 29 Jul 2006 13:54 GMT
Hello ebucis@gmail.com,

Check PE header of the file whether it contains managed code.
You need to look in COM Descriptor Directory entry in the PE - if there is
nonzero address thus it constains managed code

> Hi,
> I am developing an application that loads at runtime executable
[quoted text clipped - 17 lines]
>
> Lester

---
WBR,
Michael  Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
ebucis@gmail.com - 31 Jul 2006 20:20 GMT
I also found this based on your hint:

http://geekswithblogs.net/rupreet/archive/2005/11/02/58873.aspx

Thanks!!

> Hello ebucis@gmail.com,
>
[quoted text clipped - 30 lines]
> "At times one remains faithful to a cause only because its opponents do not
> cease to be insipid." (c) Friedrich Nietzsche

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.