I am not entirely sure I follow what you are trying to do, but one thing to
data. It is the module that contains the meta data and one or more modules
ModuleAttachedToAssembly() callback and use the IMetaDataXXX interfaces. I
profiler/corprofiler/etc. to see the various discussions that have taken
place. There are a lot of examples listed as well as some gotchas to be
aware of. If you have a specific question after that, let us know.
"Nadav" <Nadav@discussions.microsoft.com> wrote in message
news:DCABFDBF-41C9-4375-871A-DFD67453C692@microsoft.com...
> Lets say that I am replacing the metadata of the DLL with some other
> meaningful metadata, on runtime ( through AssemblyLoadFinished ) I
> reconstruct the original metadata, apparently, some of the metadata is
> required before AssemblyLoadFinished & AssemblyLoadStarted are called, my
> question is what exactly is this metadata ( namespace, publickey, ... ) ?
>
>
> "Kaushik Srenevasan" wrote:
>
> > Can you tell us what you are trying to manipulate on the managed PE?
> >
> > --
> > Kaushik Srenevasan
> > Microsoft Student Ambassador,
> > Manager, Madurai .NET student user group
> >
http://groups.msn.com/MaduraiDotNet > >
> > "Nadav" <Nadav@discussions.microsoft.com> wrote in message
> > news:F45C2D66-D046-4DEC-8026-82ECB18C3090@microsoft.com...
> > > Hi All,
> > >
> > > - I am working on a tool that manipulate managed assemblies, some of
the
> > > functionality provided by the tool require manipulating the metadata
> > sections
> > > of the managed assembly in a way it could still be loaded by the
consuming
> > > application ( concerning the manipulated assembly is a DLL ), The tool
> > uses
> > > the unmanaged profiling API to monitor the application being executed
(
> > and
> > > actively effect it ), for each assembly being loaded an
> > AssemblyLoadStarted &
> > > AssemblyLoadFinished are being called. for the manipulated assembly
none
> > of
> > > these events is called, an 'Object reference is set to null' exception
is
> > > being thrown when trying to instantiate one of the classes defined in
the
> > > manipulated assembly... I wonder what parameters are extracted from a
> > managed
> > > assembly by the .NET framework during the loading process ( and NOT
> > through
> > > class instantiation and method calls of that assembly ), In other
words:
> > what
> > > is the process that take place from the point where the assembly file
is
> > > being opened ( e.g. CreateFileW ) to the point where the profiler
> > > AssemblyLoadFinished callback is being called? what parts of metadata
of
> > the
> > > assembly being loaded is being used by the .NET Framework? What
metadata
> > > properties are required so the assembly would load successfully ( e.g.
> > > NameSpace, PublicKey, version, . )? My guess is that I am manipulating
> > some
> > > variables that prevent the assembly from being loaded, the metadata
> > > manipulation involve merging large chunks of metadata from other
> > assemblies
> > > so it is hard to pinpoint what exactly causes this phenomenon.
> > > - SOooo, any pointers samples or explanations of the metadata
properties
> > > required during managed assembly load ( the process that take place
from
> > > assembly file creation until AssemblyLoadFinished execution ) would be
> > > appreciated.
> > >
> > > --
> > > Nadav
> > >
http://www.ddevel.com > >
> >
> >