Exemple #1
0
        /// <summary>
        /// Returns the offset within the FAT of the next block
        /// </summary>
        /// <param name="baseBlock">The root block for the entry</param>
        static public long BlockToFATOffset(uint baseBlock, Structs.PartitionInfo Partition)
        {
            if (baseBlock > Partition.Clusters)
            {
                // throw new Exception("Cluster ref of range");
            }
            long rVal = baseBlock * (int)Partition.EntrySize;

            rVal += Partition.FATOffset;
            return(rVal);
        }
Exemple #2
0
        /// <summary>
        /// Converts cluster (block) number to offset
        /// </summary>
        static public long GetBlockOffset(uint block, Structs.PartitionInfo Partition)
        {
            if (block > Partition.Clusters)
            {
                // throw new Exception("Cluster ref of range");
            }
            //The way that FATX works is that the root block is considered block 0,
            //so let's think about this like an array...  if the block is reading block
            //2, then it's really block 1 in an array
            block--;
            long rVal = (Partition.DataOffset + ((long)block * Partition.ClusterSize));

            return(rVal);
        }
 public PartitionGeometry(ParrotLibs.Folder e)
 {
     InitializeComponent();
     ParrotLibs.Structs.PartitionInfo PI = e.PartitionInfo;
     propertyGrid1.SelectedObject = PI;
 }
Exemple #4
0
 public DateTime PartitionTimeStamp(Structs.PartitionInfo PI)
 {
     return(VariousFunctions.DateTimeFromFATInt((ushort)((PI.ID & ~0xFFFF) >> 8), (ushort)PI.ID));
 }
Exemple #5
0
 static public uint GetBlockFromOffset(long offset, Structs.PartitionInfo Partition)
 {
     return((uint)(((offset - Partition.DataOffset)) / Partition.ClusterSize));
 }