/// <summary>
        /// Formats a partition with Praxis
        /// </summary>
        /// <param name="part">Partition to format with Praxis</param>
        public Praxis(Partition part, bool format)
        {
            partition = part;
            byte[] c0 = part.readCluster(0);
            fixed(byte *ptr = c0)
            {
                if (format)
                {
                    UnsignedWriter writer = new UnsignedWriter(ptr);
                    writer.Advance(0x0020);             //Label, ASCII not implemented, so will advance until then
                    writer.Write16(0xF00F);             //if 0xF00F then drive is formatted
                    writer.Write64(0x0000);             //Used clusters
                    writer.Write32(0x0000);             //Used entries
                    writer.Write16(0x0001);             //Major version
                    writer.Write16(0x0000);             //Minor version
                    writer.Write32(0x0000);             //Bug fixes
                    writer.Write64(0x646E454878617250); //UTF8 for PraxHEnd
                }
                UnsignedReader reader = new UnsignedReader(ptr);

                reader.Advance(42);
                totalEntries = reader.Read32();
            }

            partition.writeCluster(0, c0);
        }
Пример #2
0
 public static EntryStruct Read(UnsignedReader reader, byte dirorfile, uint hash, ulong sector, uint which)
 {
     reader.Advance(8U + (which + 13U));
     return new EntryStruct(reader.Read8(), reader.Read32(), reader.Read64());
 }
 public static EntryStruct Read(UnsignedReader reader, byte dirorfile, uint hash, ulong sector, uint which)
 {
     reader.Advance(8U + (which + 13U));
     return(new EntryStruct(reader.Read8(), reader.Read32(), reader.Read64()));
 }
Пример #4
0
 /// <summary>
 /// Formats a partition with Praxis
 /// </summary>
 /// <param name="part">Partition to format with Praxis</param>
 public Praxis(Partition part, bool format)
 {
     partition = part;
     byte[] c0 = part.readCluster(0);
     fixed (byte* ptr = c0) {
         if (format) {
             UnsignedWriter writer = new UnsignedWriter(ptr);
             writer.Advance(0x0020); //Label, ASCII not implemented, so will advance until then
             writer.Write16(0xF00F); //if 0xF00F then drive is formatted
             writer.Write64(0x0000); //Used clusters
             writer.Write32(0x0000); //Used entries
             writer.Write16(0x0001); //Major version
             writer.Write16(0x0000); //Minor version
             writer.Write32(0x0000); //Bug fixes
             writer.Write64(0x646E454878617250); //UTF8 for PraxHEnd
         }
         UnsignedReader reader = new UnsignedReader(ptr);
         reader.Advance(42);
         totalEntries = reader.Read32();
     }
     partition.writeCluster(0, c0);
 }