Esempio n. 1
0
 public static AssemblyMetadata CreateFromFile(ModuleMetadata manifestModule, string path)
 {
     return(new AssemblyMetadata(manifestModule, moduleName => ModuleMetadata.CreateFromFile(Path.Combine(Path.GetDirectoryName(path), moduleName))));
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a single-module assembly.
 /// </summary>
 /// <param name="peImage">
 /// Manifest module image.
 /// </param>
 /// <exception cref="ArgumentNullException"><paramref name="peImage"/> is null.</exception>
 public static AssemblyMetadata CreateFromImage(byte[] peImage)
 {
     return(Create(ModuleMetadata.CreateFromImage(peImage)));
 }
Esempio n. 3
0
 /// <summary>
 /// Finds all modules of an assembly on a specified path and builds an instance of <see cref="AssemblyMetadata"/> that represents them.
 /// </summary>
 /// <param name="path">The full path to the assembly on disk.</param>
 /// <exception cref="ArgumentNullException"><paramref name="path"/> is null.</exception>
 /// <exception cref="ArgumentException"><paramref name="path"/> is invalid.</exception>
 /// <exception cref="IOException">Error reading file <paramref name="path"/>. See <see cref="Exception.InnerException"/> for details.</exception>
 /// <exception cref="NotSupportedException">Reading from a file path is not supported by the platform.</exception>
 public static AssemblyMetadata CreateFromFile(string path)
 {
     return(CreateFromFile(ModuleMetadata.CreateFromFile(path), path));
 }
Esempio n. 4
0
 /// <summary>
 /// Creates a single-module assembly.
 /// </summary>
 /// <param name="peStream">Manifest module PE image stream.</param>
 /// <param name="options">False to close the stream upon disposal of the metadata.</param>
 /// <exception cref="BadImageFormatException">The PE image format is invalid.</exception>
 public static AssemblyMetadata CreateFromStream(Stream peStream, PEStreamOptions options)
 {
     return(Create(ModuleMetadata.CreateFromStream(peStream, options)));
 }
Esempio n. 5
0
 /// <summary>
 /// Creates a single-module assembly.
 /// </summary>
 /// <param name="peStream">Manifest module PE image stream.</param>
 /// <param name="leaveOpen">False to close the stream upon disposal of the metadata.</param>
 /// <exception cref="BadImageFormatException">The PE image format is invalid.</exception>
 public static AssemblyMetadata CreateFromStream(Stream peStream, bool leaveOpen = false)
 {
     return(Create(ModuleMetadata.CreateFromStream(peStream, leaveOpen)));
 }
Esempio n. 6
0
 /// <summary>
 /// Creates a single-module assembly.
 /// </summary>
 /// <param name="peImage">
 /// Manifest module image.
 /// </param>
 /// <exception cref="ArgumentNullException"><paramref name="peImage"/> is null.</exception>
 /// <exception cref="BadImageFormatException">The PE image format is invalid.</exception>
 public static AssemblyMetadata CreateFromImage(IEnumerable <byte> peImage)
 {
     return(Create(ModuleMetadata.CreateFromImage(peImage)));
 }
Esempio n. 7
0
 // creates a copy
 private ModuleMetadata(ModuleMetadata metadata)
     : base(isImageOwner: false, id: metadata.Id)
 {
     _module = metadata.Module;
 }