public HexFileStructureInfoProviderImpl(PEStructureProviderFactory peStructureProviderFactory)
 {
     if (peStructureProviderFactory == null)
     {
         throw new ArgumentNullException(nameof(peStructureProviderFactory));
     }
     this.peStructureProviderFactory = peStructureProviderFactory;
 }
            public static PEStructure TryCreate(PEStructureProviderFactory peStructureProviderFactory, HexBufferFile file)
            {
                PEStructure peStructure;

                if (file.Properties.TryGetProperty(typeof(PEStructure), out peStructure))
                {
                    return(peStructure);
                }

                var provider = peStructureProviderFactory.TryGetProvider(file);

                if (provider != null)
                {
                    peStructure = new PEStructure(provider);
                }

                file.Properties.AddProperty(typeof(PEStructure), peStructure);
                return(peStructure);
            }
Exemple #3
0
 HexFileStructureInfoProviderFactoryImpl(PEStructureProviderFactory peStructureProviderFactory) => this.peStructureProviderFactory = peStructureProviderFactory;