![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 --- |
#3
| |||
| |||
|
|
Hello ebucis (AT) gmail (DOT) 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 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 --- 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 |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |