Esempio n. 1
0
        internal static StringTable ReadStringTable(this PeReader reader)
        {
            var orgPos = reader.GetPosition();

            var table = new StringTable();

            reader.ReadFileInfo(table, 8);

            table.LanguageCode = ulong.Parse(table.Key, NumberStyles.HexNumber);

            // Read children (Strings, as sz key/value pairs)
            var children = new Dictionary <string, string>();

            while (reader.GetPosition() < orgPos + table.Length)
            {
                var child = reader.ReadStringTableString();
                children.Add(child.key, child.value);
            }
            table.Values = children.ToImmutableDictionary();

            // Undocumented
            reader.ReadPadding();

            return(table);
        }