internal static void ReadFileInfo(this PeReader reader, FileInfo info, int keyLen) { info.Position = reader.GetPosition(); info.Length = reader.ReadUInt16(); info.ValueLength = reader.ReadUInt16(); info.Type = reader.ReadUInt16(); info.Key = reader.ReadStringZ(keyLen); info.Padding1 = reader.ReadPadding(); }
internal static bool ReadFileInfo(this PeReader reader, FileInfo info, string expectedKey) { var orgPos = reader.GetPosition(); reader.ReadFileInfo(info, expectedKey.Length); var result = info.Key.Equals(expectedKey, StringComparison.Ordinal); if (!result) { info.Position = 0; reader.SetPosition(orgPos); } return(result); }