Beispiel #1
0
 internal static AssemblyMetadata CreateFromFile(ModuleMetadata manifestModule, string path)
 {
     return(new AssemblyMetadata(manifestModule, moduleName => ModuleMetadata.CreateFromFile(Path.Combine(Path.GetDirectoryName(path), moduleName))));
 }
Beispiel #2
0
 // creates a copy
 private ModuleMetadata(ModuleMetadata metadata)
     : base(isImageOwner: false, id: metadata.Id)
 {
     _module = metadata.Module;
 }
Beispiel #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));
 }
Beispiel #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)));
 }
Beispiel #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)));
 }
Beispiel #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)));
 }
Beispiel #7
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(ImmutableArray <byte> peImage)
 {
     return(Create(ModuleMetadata.CreateFromImage(peImage)));
 }