public void ImageResourceDataEntryConstructorWorks_Test() { var resourceDataEntry = new ImageResourceDataEntry(new BufferFile(RawStructures.RawResourceDataEntry), 2); Assert.Equal((uint)0x33221100, resourceDataEntry.OffsetToData); Assert.Equal((uint)0x77665544, resourceDataEntry.Size1); Assert.Equal(0xbbaa9988, resourceDataEntry.CodePage); Assert.Equal(0xffeeddcc, resourceDataEntry.Reserved); }
public DataSegment GetDataSegment(ImageResourceDataEntry dataDirectory) { DataSegment segment; if (!_dataMapping.TryGetValue(dataDirectory, out segment)) { _dataMapping.Add(dataDirectory, segment = new DataSegment(dataDirectory.Data)); Segments.Add(segment); } return(segment); }
internal static ImageResourceDataEntry FromReadingContext(ReadingContext context) { var reader = context.Reader; var entry = new ImageResourceDataEntry { StartOffset = reader.Position, OffsetToData = reader.ReadUInt32(), _size = reader.ReadUInt32(), CodePage = reader.ReadUInt32(), Reserved = reader.ReadUInt32(), }; entry._dataReaderContext = context.CreateSubContext(context.Assembly.RvaToFileOffset(entry.OffsetToData)); return(entry); }
public DataSegment GetDataSegment(ImageResourceDataEntry dataDirectory) { DataSegment segment; if (!_dataMapping.TryGetValue(dataDirectory, out segment)) { _dataMapping.Add(dataDirectory, segment = new DataSegment(dataDirectory.Data)); Segments.Add(segment); } return segment; }
public void AddDataEntry(ImageResourceDataEntry entry) { _dataEntries.Add(entry); Segments.Add(entry); }
internal static ImageResourceDataEntry FromReadingContext(ReadingContext context) { var reader = context.Reader; var entry = new ImageResourceDataEntry { StartOffset = reader.Position, OffsetToData = reader.ReadUInt32(), Size = reader.ReadUInt32(), CodePage = reader.ReadUInt32(), Reserved = reader.ReadUInt32(), }; entry._dataReaderContext = context.CreateSubContext(context.Assembly.RvaToFileOffset(entry.OffsetToData)); return entry; }