private static Dictionary <ulong, NodeDataDTO> GetSIBlockData(SIBLOCK siblock, PSTFile pst) { var ret = new Dictionary <ulong, NodeDataDTO>(); foreach (var entry in siblock.Entries) { var curSLBlockBBT = pst.GetBlockBBTEntry(entry.SLBlockBID); var slblock = new SLBLOCK(GetBBTEntryData(curSLBlockBBT, pst)[0]); var data = GetSLBlockData(slblock, pst); foreach (var item in data) { ret.Add(item.Key, item.Value); } } return(ret); }
//gets all the data for an SL block. an SL block points directly to all the immediate subnodes private static Dictionary <ulong, NodeDataDTO> GetSLBlockData(SLBLOCK slblock, PSTFile pst, int take = int.MaxValue) { var ret = new Dictionary <ulong, NodeDataDTO>(); foreach (var entry in slblock.Entries.Take(take)) { //this data should represent the main data part of the subnode var data = GetBBTEntryData(pst.GetBlockBBTEntry(entry.SubNodeBID), pst); var cur = new NodeDataDTO { NodeData = data }; ret.Add(entry.SubNodeNID, cur); //see if there are sub nodes of this current sub node if (entry.SubSubNodeBID != 0) { //if there are subnodes, treat them like any other subnode cur.SubNodeData = GetSubNodeData(pst.GetBlockBBTEntry(entry.SubSubNodeBID), pst); } } return(ret); }