public static AssemblyApi Traverse(string path) { if (string.IsNullOrWhiteSpace(path)) throw new ArgumentException("Assembly Path should not be empty."); using (MetadataReaderHost host = new PeReader.DefaultHost()) { IModule module = host.LoadUnitFrom(path) as IModule; if (module == null || module is Dummy) { Environment.Exit(1); throw new ArgumentException("'{0}' is not a PE file containing a CLR module or assembly.", path); } var t = new ApiTraverser(host, module.ContainingAssembly); t.Traverse(module); return t.Assembly; } }
public static AssemblyApi Traverse(string path) { if (string.IsNullOrWhiteSpace(path)) { throw new ArgumentException("Assembly Path should not be empty."); } using (MetadataReaderHost host = new PeReader.DefaultHost()) { IModule module = host.LoadUnitFrom(path) as IModule; if (module == null || module is Dummy) { Environment.Exit(1); throw new ArgumentException("'{0}' is not a PE file containing a CLR module or assembly.", path); } var t = new ApiTraverser(host, module.ContainingAssembly); t.Traverse(module); return(t.Assembly); } }