Ejemplo n.º 1
0
        public TypeSpecMetadataTableRow(byte[] contents, Offset offset, IIndexDetails indexDetails)
        {
            this.FileOffset = offset;

            byte sizeOfBlobIndex = indexDetails.GetSizeOfBlobIndex();

            _signiture = new BlobIndex(sizeOfBlobIndex, contents, Signatures.Signatures.TypeSpecification, offset);
        }
Ejemplo n.º 2
0
 public FieldDef(string name, AssemblyDef definingAssembly, TypeDef containingType, FieldAttributes attributes, BlobIndex signitureIndex)
 {
     UniqueId      = definingAssembly.CreateUniqueId();
     Assembly      = definingAssembly;
     Type          = containingType;
     Name          = name;
     SignitureBlob = signitureIndex;
     _flags        = attributes;
     _constants    = new List <ConstantInfo>();
 }
        /// <summary>
        /// Initialises a new instance of the FieldMetadataTableRow
        /// </summary>
        /// <param name="contents">The contents of the file</param>
        /// <param name="offset">The offset of the current row</param>
        public FieldMetadataTableRow(byte[] contents, Offset offset, IIndexDetails indexDetails)
        {
            this.FileOffset = offset;

            byte sizeOfStringIndex = indexDetails.GetSizeOfStringIndex();
            byte sizeOfBlobIndex   = indexDetails.GetSizeOfBlobIndex();

            _flags          = (FieldAttributes)FieldReader.ToUInt16(contents, offset.Shift(2));
            _nameIndex      = new StringIndex(contents, sizeOfStringIndex, offset);
            _signitureIndex = new BlobIndex(sizeOfBlobIndex, contents, Reflection.Signatures.Signatures.Field, offset);
        }
        /// <summary>
        /// Initialises a new instnace of the StandAloneSigMetadataTableRow
        /// </summary>
        /// <param name="contents">The contents of teh file</param>
        /// <param name="offset">The offset for this row</param>
        public StandAloneSigMetadataTableRow(byte[] contents, Offset offset, IIndexDetails indexDetails)
        {
            this.FileOffset = offset;

            byte sizeOfBlobIndex = indexDetails.GetSizeOfBlobIndex();

            // TODO: Fix; stand alone is not forced to be a methoddef.. i think
            _signiture = new BlobIndex(
                sizeOfBlobIndex,
                contents,
                TheBoxSoftware.Reflection.Signatures.Signatures.MethodDef,
                offset);
        }
        /// <summary>
        /// Initialises a new instance of the MemberRefMetadataTableRow
        /// </summary>
        /// <param name="contents">The contents of the file</param>
        /// <param name="offset">The offset of this row</param>
        public MemberRefMetadataTableRow(byte[] contents, Offset offset, ICodedIndexResolver resolver, IIndexDetails indexDetails)
        {
            this.FileOffset = offset;

            int  sizeOfMemberRefParentIndex = resolver.GetSizeOfIndex(CodedIndexes.MemberRefParent);
            byte sizeOfStringIndex          = indexDetails.GetSizeOfStringIndex();
            byte sizeOfBlobIndex            = indexDetails.GetSizeOfBlobIndex();

            _class = resolver.Resolve(CodedIndexes.MemberRefParent,
                                      FieldReader.ToUInt32(contents, offset.Shift(sizeOfMemberRefParentIndex), sizeOfMemberRefParentIndex)
                                      );
            _name      = new StringIndex(contents, sizeOfStringIndex, offset);
            _signiture = new BlobIndex(sizeOfBlobIndex, contents, Reflection.Signatures.Signatures.MethodDef, offset);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initialises a new instance of the MethodMetadataTableRow class
        /// </summary>
        /// <param name="contents">The contents of the file</param>
        /// <param name="offset">The offset of the current row</param>
        public MethodMetadataTableRow(byte[] contents, Offset offset, IIndexDetails indexDetails)
        {
            this.FileOffset = offset;

            byte sizeOfStringIndex = indexDetails.GetSizeOfStringIndex();
            byte sizeOfBlobIndex   = indexDetails.GetSizeOfBlobIndex();
            byte sizeOfParamIndex  = indexDetails.GetSizeOfIndex(MetadataTables.Param);

            _rva       = FieldReader.ToUInt32(contents, offset.Shift(4));
            _implFlags = (MethodImplFlags)FieldReader.ToUInt16(contents, offset.Shift(2));
            _flags     = (MethodAttributes)FieldReader.ToUInt16(contents, offset.Shift(2));
            _name      = new StringIndex(contents, sizeOfStringIndex, offset);
            _signiture = new BlobIndex(sizeOfBlobIndex, contents, Signatures.Signatures.MethodDef, offset);
            _paramList = new Index(contents, offset, sizeOfParamIndex);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initialises a new instance of the ConstantMetadataTableRow
        /// </summary>
        /// <param name="contents">The contents fo the file</param>
        /// <param name="offset">The offset for the current row</param>
        public ConstantMetadataTableRow(byte[] contents, Offset offset, ICodedIndexResolver resolver, IIndexDetails indexDetails)
        {
            this.FileOffset = offset;

            int  hasConstantIndexSize = resolver.GetSizeOfIndex(CodedIndexes.HasConstant);
            byte sizeOfBlobIndex      = indexDetails.GetSizeOfBlobIndex();

            _type = (Signatures.ElementTypes)contents[offset.Shift(1)];
            offset.Shift(1);
            _parentIndex = resolver.Resolve(
                CodedIndexes.HasConstant,
                FieldReader.ToUInt32(contents, offset.Shift(hasConstantIndexSize), hasConstantIndexSize)
                );
            _valueIndex = new BlobIndex(sizeOfBlobIndex, contents, Signatures.Signatures.MethodDef, offset);
        }
Ejemplo n.º 8
0
 public YtIndexResults(BlobStores stores, SnowflakeConnectionProvider sf)
 {
     Sf        = sf;
     BlobIndex = new(stores.Store(DataStoreType.Results));
 }
Ejemplo n.º 9
0
 public YtIndexResults(YtStores stores, SnowflakeConnectionProvider sf)
 {
     Sf        = sf;
     Store     = stores.Store(DataStoreType.Results);
     BlobIndex = new BlobIndex(Store);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Creates a new instance of the TypeSpec class using the provided information.
 /// </summary>
 /// <param name="definingAssembly">The assembly which defines the type specification</param>
 /// <param name="signitureIndex">The index in to the blod where the signiture for this type is defined.</param>
 public TypeSpec(AssemblyDef definingAssembly, BlobIndex signitureIndex)
 {
     UniqueId = definingAssembly.CreateUniqueId();
     Assembly = definingAssembly;
     _signitureIndexInBlob = signitureIndex;
 }
Ejemplo n.º 11
0
        /// <include file='code-documentation\reflection.xml' path='docs/assemblydef/member[@name="getassemblyid"]/*'/>
        // public override long GetAssemblyId() => UniqueId;

        internal Signatures.Signature GetSigniture(BlobIndex fromIndex)
        {
            return(_blobStream.GetSigniture(fromIndex.Value, fromIndex.SignitureType));
        }