Beispiel #1
0
        public NativeHashtable(NativeParser parser)
        {
            uint header = parser.GetUInt8();

            _reader     = parser.Reader;
            _baseOffset = parser.Offset;

            int numberOfBucketsShift = (int)(header >> 2);

            if (numberOfBucketsShift > 31)
            {
                _reader.ThrowBadImageFormatException();
            }
            _bucketMask = (uint)((1 << numberOfBucketsShift) - 1);

            byte entryIndexSize = (byte)(header & 3);

            if (entryIndexSize > 2)
            {
                _reader.ThrowBadImageFormatException();
            }
            _entryIndexSize = entryIndexSize;
        }
Beispiel #2
0
 public void ThrowBadImageFormatException()
 {
     _reader.ThrowBadImageFormatException();
 }
 public static void ThrowBadImageFormatException()
 {
     NativeReader.ThrowBadImageFormatException();
 }
 public void Decode(NativeReader reader)
 {
     if (reader.ReadUInt32(0) != Signature)
         reader.ThrowBadImageFormatException();
     reader.Read(4, out ScopeDefinitions);
 }
        public NativeHashtable(NativeParser parser)
        {
            uint header = parser.GetUInt8();

            _reader = parser.Reader;
            _baseOffset = parser.Offset;

            int numberOfBucketsShift = (int)(header >> 2);
            if (numberOfBucketsShift > 31)
                _reader.ThrowBadImageFormatException();
            _bucketMask = (uint)((1 << numberOfBucketsShift) - 1);

            byte entryIndexSize = (byte)(header & 3);
            if (entryIndexSize > 2)
                _reader.ThrowBadImageFormatException();
            _entryIndexSize = entryIndexSize;
        }