Пример #1
0
        public BTENTRY(byte[] bytes)
        {
            this._btkey = BitConverter.ToUInt64(bytes, 0);
            this.BREF   = new BREF(bytes.Skip(8).Take(16).ToArray());

            /*this.BREF = new BREF_UNICODE
             *              {BID_raw = BitConverter.ToUInt64(bytes, 8), ByteIndex = BitConverter.ToUInt64(bytes, 16)};*/
        }
Пример #2
0
 public PSTBTree(BREF bref, PSTFile pst)
 {
     using (var viewer = pst.PSTMMF.CreateViewAccessor((long)bref.IB, 512))
     {
         var data = new byte[512];
         viewer.ReadArray(0, data, 0, 512);
         this.Root = new BTPage(data, bref, pst);
     }
 }
Пример #3
0
        public BBTENTRY(byte[] bytes)
        {
            BREF = new BREF(bytes);

            /*this.BREF = new BREF_UNICODE
             *              {BID_raw = BitConverter.ToUInt64(bytes, 0), ByteIndex = BitConverter.ToUInt64(bytes, 8)};*/
            BlockByteCount = BitConverter.ToUInt16(bytes, 16);
            RefCount       = BitConverter.ToUInt16(bytes, 18);
        }
Пример #4
0
        public BTPage(byte[] pageData, BREF _ref, PSTFile pst)
        {
            this._ref             = _ref;
            this.InternalChildren = new List <BTPage>();
            this._trailer         = new PageTrailer(pageData.RangeSubset(496, 16));
            this._numEntries      = pageData[488];
            this._maxEntries      = pageData[489];
            this._cbEnt           = pageData[490];
            this._cLevel          = pageData[491];

            this.Entries = new List <BTPAGEENTRY>();
            for (var i = 0; i < this._numEntries; i++)
            {
                var curEntryBytes = pageData.RangeSubset(i * this._cbEnt, this._cbEnt);
                if (this._cLevel == 0)
                {
                    if (this._trailer.PageType == PageType.NBT)
                    {
                        this.Entries.Add(new NBTENTRY(curEntryBytes));
                    }
                    else
                    {
                        var curEntry = new BBTENTRY(curEntryBytes);
                        this.Entries.Add(curEntry);
                    }
                }
                else
                {
                    //btentries
                    var entry = new BTENTRY(curEntryBytes);
                    this.Entries.Add(entry);
                    using (var view = pst.PSTMMF.CreateViewAccessor((long)entry.BREF.IB, 512))
                    {
                        var bytes = new byte[512];
                        view.ReadArray(0, bytes, 0, 512);
                        this.InternalChildren.Add(new BTPage(bytes, entry.BREF, pst));
                    }
                }
            }
        }