/// <summary> /// Prepares a new lazy-initialized list of module import entries. /// </summary> /// <param name="context">The reader context.</param> /// <param name="dataDirectory">The import data directory.</param> public SerializedImportedModuleList(PEReaderContext context, DataDirectory dataDirectory) { _context = context ?? throw new ArgumentNullException(nameof(context)); _dataDirectory = dataDirectory; }
public X64ExceptionDirectory(PEReaderContext context, IBinaryStreamReader reader) { _context = context ?? throw new ArgumentNullException(nameof(context)); _reader = reader ?? throw new ArgumentNullException(nameof(reader)); }
/// <summary> /// Prepares a new lazy-initialized list of base relocations. /// </summary> /// <param name="context">The reader context.</param> /// <param name="relocDirectory">The directory that contains the base relocations.</param> public SerializedRelocationList(PEReaderContext context, in DataDirectory relocDirectory)
/// <summary> /// Creates a new tables stream based on a segment in a file. /// </summary> /// <param name="context">The reader context.</param> /// <param name="name">The name of the stream.</param> /// <param name="reader">The raw contents of the stream.</param> public SerializedTableStream(PEReaderContext context, string name, in BinaryStreamReader reader)
public X64ExceptionDirectory(PEReaderContext context, in BinaryStreamReader reader)
/// <summary> /// Prepares a new lazy-initialized list of module import entries. /// </summary> /// <param name="context">The reader context.</param> /// <param name="dataDirectory">The import data directory.</param> public SerializedImportedModuleList(PEReaderContext context, in DataDirectory dataDirectory)
/// <summary> /// Creates a new tables stream based on a byte array. /// </summary> /// <param name="context">The reader context.</param> /// <param name="name">The name of the stream.</param> /// <param name="rawData">The raw contents of the stream.</param> public SerializedTableStream(PEReaderContext context, string name, byte[] rawData) : this(context, name, ByteArrayDataSource.CreateReader(rawData)) { }
/// <inheritdoc /> public IDebugDataSegment ReadDebugData(PEReaderContext context, DebugDataType type, IBinaryStreamReader reader) { return(new CustomDebugDataSegment(type, DataSegment.FromReader(reader))); }
/// <summary> /// Prepares a new lazy-initialized list of base relocations. /// </summary> /// <param name="context">The reader context.</param> /// <param name="relocDirectory">The directory that contains the base relocations.</param> public SerializedRelocationList(PEReaderContext context, DataDirectory relocDirectory) { _context = context ?? throw new ArgumentNullException(nameof(context)); _relocDirectory = relocDirectory; }
/// <summary> /// Prepares a new lazy-initialized metadata stream list. /// </summary> /// <param name="context">The reader context.</param> /// <param name="directoryReader">The input stream containing the metadata directory.</param> /// <param name="entriesReader">The input stream containing the metadata stream entries.</param> /// <param name="numberOfStreams">The number of streams.</param> public MetadataStreamList( PEReaderContext context, in BinaryStreamReader directoryReader,
public IMetadataStream ReadStream(PEReaderContext context, MetadataStreamHeader header, ref BinaryStreamReader reader) { return(header.Name == KoiStreamName ? new KoiStream(KoiStreamName, new DataSegment(reader.ReadToEnd()), Logger) : _reader.ReadStream(context, header, ref reader)); }
/// <summary> /// Creates a new tables stream based on a byte array. /// </summary> /// <param name="context">The reader context.</param> /// <param name="name">The name of the stream.</param> /// <param name="rawData">The raw contents of the stream.</param> public SerializedTableStream(PEReaderContext context, string name, byte[] rawData) : this(context, name, new DataSegment(rawData)) { }
/// <summary> /// Reads a single field RVA row from an input stream. /// </summary> /// <param name="context">The reader context.</param> /// <param name="reader">The input stream.</param> /// <param name="layout">The layout of the field RVA table.</param> /// <returns>The row.</returns> public static FieldRvaRow FromReader(PEReaderContext context, IBinaryStreamReader reader, TableLayout layout) { return(new FieldRvaRow( context.File.GetReferenceToRva(reader.ReadUInt32()), reader.ReadIndex((IndexSize)layout.Columns[1].Size))); }
/// <summary> /// Reads a single module import entry from an input stream. /// </summary> /// <param name="context">The reader context.</param> /// <param name="reader">The input stream to read from.</param> /// <returns></returns> public static IImportedModule FromReader(PEReaderContext context, ref BinaryStreamReader reader) { var entry = new SerializedImportedModule(context, ref reader); return(entry.IsEmpty ? null : entry); }