Example #1
0
        private void writeGDFheader(MemoryStream ms)
        {
            CBinaryWriter writer = new CBinaryWriter(EndianType.LittleEndian, ms);

            writer.Seek(0L, SeekOrigin.Begin);
            writer.Write((uint)0x1a465358);
            writer.Write((uint)0x400);
            writer.Seek(0x8000L, SeekOrigin.Begin);
            writer.Write(gdf_sector);
            writer.Seek(0x10000L, SeekOrigin.Begin);
            writer.Write(this.src.VolDesc.Identifier);
            writer.Write(this.tables[this.tables.Count - 1].Sector);
            writer.Write((uint)(this.sizeToSectors(this.tables[this.tables.Count - 1].Size) * this.src.VolDesc.SectorSize));
            writer.Write(this.src.VolDesc.ImageCreationTime);
            writer.Write((byte)1);
            writer.Seek(0x107ecL, SeekOrigin.Begin);
            writer.Write(this.src.VolDesc.Identifier);
            writer.Close();
        }
Example #2
0
        public byte[] ToByteArray()
        {
            if (Padding == null)
            {
                calcPadding();
            }
            byte[]        buffer = new byte[EntrySize];
            CBinaryWriter writer = new CBinaryWriter(EndianType.LittleEndian, new MemoryStream(buffer));

            writer.Write(SubTreeL);
            writer.Write(SubTreeR);
            writer.Write(Sector);
            writer.Write(Size);
            writer.Write((byte)Attributes);
            writer.Write(NameLength);
            writer.Write(Name.ToCharArray(), 0, Name.Length);
            writer.Write(Padding);
            writer.Close();
            return(buffer);
        }
Example #3
0
 public void Close()
 {
     bw.Close();
 }