public PENode(Func <HexBufferFile> createBufferFile, PEStructureProviderFactory peStructureProviderFactory) { if (createBufferFile == null) { throw new ArgumentNullException(nameof(createBufferFile)); } if (peStructureProviderFactory == null) { throw new ArgumentNullException(nameof(peStructureProviderFactory)); } this.createBufferFile = createBufferFile; this.peStructureProviderFactory = peStructureProviderFactory; }
public static PEStructure TryCreate(PEStructureProviderFactory peStructureProviderFactory, HexBufferFile file) { if (file.Properties.TryGetProperty(typeof(PEStructure), out PEStructure peStructure)) { return(peStructure); } var provider = peStructureProviderFactory.TryGetProvider(file); if (provider != null) { peStructure = new PEStructure(provider); } file.Properties.AddProperty(typeof(PEStructure), peStructure); return(peStructure); }
public HexFileStructureInfoProviderImpl(PEStructureProviderFactory peStructureProviderFactory) => this.peStructureProviderFactory = peStructureProviderFactory ?? throw new ArgumentNullException(nameof(peStructureProviderFactory));