Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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);
        }