public int ReadFrom(byte[] buffer, int offset)
        {
            Signature = Utilities.ToUInt32BigEndian(buffer, offset + 0);
            Version = Utilities.ToUInt32BigEndian(buffer, offset + 4);
            HeaderSize = Utilities.ToUInt32BigEndian(buffer, offset + 8);
            Flags = Utilities.ToUInt32BigEndian(buffer, offset + 12);
            RunningDataForkOffset = Utilities.ToUInt64BigEndian(buffer, offset + 16);
            DataForkOffset = Utilities.ToUInt64BigEndian(buffer, offset + 24);
            DataForkLength = Utilities.ToUInt64BigEndian(buffer, offset + 32);
            RsrcForkOffset = Utilities.ToUInt64BigEndian(buffer, offset + 40);
            RsrcForkLength = Utilities.ToUInt64BigEndian(buffer, offset + 48);
            SegmentNumber = Utilities.ToUInt32BigEndian(buffer, offset + 56);
            SegmentCount = Utilities.ToUInt32BigEndian(buffer, offset + 60);
            SegmentGuid = Utilities.ToGuidBigEndian(buffer, offset + 64);

            DataForkChecksum = Utilities.ToStruct<UdifChecksum>(buffer, offset + 80);
            XmlOffset = Utilities.ToUInt64BigEndian(buffer, offset + 216);
            XmlLength = Utilities.ToUInt64BigEndian(buffer, offset + 224);

            MasterChecksum = Utilities.ToStruct<UdifChecksum>(buffer, offset + 352);
            ImageVariant = Utilities.ToUInt32BigEndian(buffer, offset + 488);
            SectorCount = Utilities.ToInt64BigEndian(buffer, offset + 492);

            return Size;
        }
        public int ReadFrom(byte[] buffer, int offset)
        {
            Signature             = Utilities.ToUInt32BigEndian(buffer, offset + 0);
            Version               = Utilities.ToUInt32BigEndian(buffer, offset + 4);
            HeaderSize            = Utilities.ToUInt32BigEndian(buffer, offset + 8);
            Flags                 = Utilities.ToUInt32BigEndian(buffer, offset + 12);
            RunningDataForkOffset = Utilities.ToUInt64BigEndian(buffer, offset + 16);
            DataForkOffset        = Utilities.ToUInt64BigEndian(buffer, offset + 24);
            DataForkLength        = Utilities.ToUInt64BigEndian(buffer, offset + 32);
            RsrcForkOffset        = Utilities.ToUInt64BigEndian(buffer, offset + 40);
            RsrcForkLength        = Utilities.ToUInt64BigEndian(buffer, offset + 48);
            SegmentNumber         = Utilities.ToUInt32BigEndian(buffer, offset + 56);
            SegmentCount          = Utilities.ToUInt32BigEndian(buffer, offset + 60);
            SegmentGuid           = Utilities.ToGuidBigEndian(buffer, offset + 64);

            DataForkChecksum = Utilities.ToStruct <UdifChecksum>(buffer, offset + 80);
            XmlOffset        = Utilities.ToUInt64BigEndian(buffer, offset + 216);
            XmlLength        = Utilities.ToUInt64BigEndian(buffer, offset + 224);

            MasterChecksum = Utilities.ToStruct <UdifChecksum>(buffer, offset + 352);
            ImageVariant   = Utilities.ToUInt32BigEndian(buffer, offset + 488);
            SectorCount    = Utilities.ToInt64BigEndian(buffer, offset + 492);

            return(Size);
        }
Exemple #3
0
        public int ReadFrom(byte[] buffer, int offset)
        {
            Signature = Utilities.ToUInt32BigEndian(buffer, offset + 0);
            InfoVersion = Utilities.ToUInt32BigEndian(buffer, offset + 4);
            FirstSector = Utilities.ToInt64BigEndian(buffer, offset + 8);
            SectorCount = Utilities.ToInt64BigEndian(buffer, offset + 16);
            DataStart = Utilities.ToUInt64BigEndian(buffer, offset + 24);
            DecompressBufferRequested = Utilities.ToUInt32BigEndian(buffer, offset + 32);
            BlocksDescriptor = Utilities.ToUInt32BigEndian(buffer, offset + 36);

            CheckSum = Utilities.ToStruct<UdifChecksum>(buffer, offset + 60);

            Runs = new List<CompressedRun>();
            int numRuns = Utilities.ToInt32BigEndian(buffer, offset + 200);
            for (int i = 0; i < numRuns; ++i)
            {
                Runs.Add(Utilities.ToStruct<CompressedRun>(buffer, offset + 204 + (i * 40)));
            }

            return 0;
        }
        public int ReadFrom(byte[] buffer, int offset)
        {
            Signature   = Utilities.ToUInt32BigEndian(buffer, offset + 0);
            InfoVersion = Utilities.ToUInt32BigEndian(buffer, offset + 4);
            FirstSector = Utilities.ToInt64BigEndian(buffer, offset + 8);
            SectorCount = Utilities.ToInt64BigEndian(buffer, offset + 16);
            DataStart   = Utilities.ToUInt64BigEndian(buffer, offset + 24);
            DecompressBufferRequested = Utilities.ToUInt32BigEndian(buffer, offset + 32);
            BlocksDescriptor          = Utilities.ToUInt32BigEndian(buffer, offset + 36);

            CheckSum = Utilities.ToStruct <UdifChecksum>(buffer, offset + 60);

            Runs = new List <CompressedRun>();
            int numRuns = Utilities.ToInt32BigEndian(buffer, offset + 200);

            for (int i = 0; i < numRuns; ++i)
            {
                Runs.Add(Utilities.ToStruct <CompressedRun>(buffer, offset + 204 + (i * 40)));
            }

            return(0);
        }