internal static TrackerDataBlock Parse(BinaryReader reader, int blockSize, ref byte[] bytes) { var r = new TrackerDataBlock(); reader.ReadInt32(); reader.ReadInt32(); r.MachineID = reader.ReadAnsiString(ref bytes, blockSize - 80); r.Droid1 = reader.ReadGuid(); r.Droid2 = reader.ReadGuid(); r.DroidBirth1 = reader.ReadGuid(); r.DroidBirth2 = reader.ReadGuid(); return(r); }
internal static IEnumerable <DataBlock> Parse(BinaryReader reader, ref byte[] bytes, ref StringBuilder sb) { var l = new List <DataBlock>(1); for (var bs = reader.ReadInt32(); bs > 4; bs = reader.ReadInt32()) { var sig = reader.ReadUInt32(); DataBlock db; switch (sig) { case EnvironmentVariableDataBlock.SIGNATURE: db = EnvironmentVariableDataBlock.Parse(reader, ref bytes, ref sb); break; case ConsoleDataBlock.SIGNATURE: db = ConsoleDataBlock.Parse(reader, ref sb); break; case ConsoleFEDataBlock.SIGNATURE: db = ConsoleFEDataBlock.Parse(reader); break; case DarwinDataBlock.SIGNATURE: db = DarwinDataBlock.Parse(reader, ref bytes, ref sb); break; case IconEnvironmentDataBlock.SIGNATURE: db = IconEnvironmentDataBlock.Parse(reader, ref bytes, ref sb); break; case KnownFolderDataBlock.SIGNATURE: db = KnownFolderDataBlock.Parse(reader); break; case PropertyStoreDataBlock.SIGNATURE: db = PropertyStoreDataBlock.Parse(reader, ref bytes, ref sb); break; case ShimDataBlock.SIGNATURE: db = ShimDataBlock.Parse(reader, bs, ref sb); break; case SpecialFolderDataBlock.SIGNATURE: db = SpecialFolderDataBlock.Parse(reader); break; case TrackerDataBlock.SIGNATURE: db = TrackerDataBlock.Parse(reader, bs, ref bytes); break; case VistaAndAboveIDListDataBlock.SIGNATURE: db = VistaAndAboveIDListDataBlock.Parse(reader); break; default: db = new UnknownDataBlock() { Signature = sig, Data = reader.ReadBytes(bs - 8) }; break; } l.Add(db); } return(l); }