public static void ConsoleWrite(this MbdbEntry item) { Console.WriteLine($"Domain=\"{item.Domain}\""); Console.WriteLine($"RelativePath=\"{item.RelativePath}\""); Console.WriteLine($"Target=\"{item.Target}\""); Console.WriteLine($"Flags={item.Flags}"); if (item.FileContentsHash != null) { var s = CommonHelpers.ObjectToString(item.FileContentsHash); Console.WriteLine($"FileContentsHash={s}"); } if (item.WrappedKey != null) { var s = CommonHelpers.ObjectToString(item.WrappedKey.Unknown); Console.WriteLine($"EncryptionKey.Unknown={s}"); s = CommonHelpers.ObjectToString(item.WrappedKey.Key); Console.WriteLine($"EncryptionKey.Key={s}"); } if (item.Properties != null) { var s = CommonHelpers.ObjectToString(item.Properties); Console.WriteLine($"Properties={s}"); } }
private MbdbEntry ReadMbdbEntry(BinaryReader reader) { var result = new MbdbEntry { Domain = ReadString(reader), RelativePath = ReadString(reader), Target = ReadString(reader), FileContentsHash = ReadData(reader), WrappedKey = ReadEncryptionKey(reader), Mode = reader.ReadUInt16BigEndian(), InodeNumber = reader.ReadUInt64BigEndian(), UserId = reader.ReadUInt32BigEndian(), GroupId = reader.ReadUInt32BigEndian(), LastModifiedTime = ReadDateTimeOffset(reader), LastAccessedTime = ReadDateTimeOffset(reader), CreatedTime = ReadDateTimeOffset(reader), FileLength = reader.ReadInt64BigEndian(), Flags = reader.ReadByte(), }; result.Properties = ReadProperties(reader); return(result); }