internal MetaDataRow ReadRow(BinaryReader reader, byte[] signature) { MetaDataRow row = new MetaDataRow(); row._parts = new ValueType[signature.Length]; row.NETHeader = tablesHeap._netheader; row._offset = (uint)(reader.BaseStream.Position + tablesHeap.StreamOffset); for (int i = 0; i < signature.Length; i++) { if (signature[i] == sizeof(uint)) { row._parts[i] = reader.ReadUInt32(); } else if (signature[i] == sizeof(ushort)) { row._parts[i] = reader.ReadUInt16(); } else if (signature[i] == sizeof(byte)) { row._parts[i] = reader.ReadByte(); } } return(row); }
internal MetaDataMember CreateMember(Type type, MetaDataRow row, MetaDataTableType table, int index) { MetaDataMember member = (MetaDataMember)Activator.CreateInstance(type, row); member._table = table; member._netheader = tablesHeap._netheader; member._metadatatoken = (uint)(((int)table) << 24 | index); return member; }
internal MetaDataMember CreateMember(Type type, MetaDataRow row, MetaDataTableType table, int index) { MetaDataMember member = (MetaDataMember)Activator.CreateInstance(type, row); member._table = table; member._netheader = tablesHeap._netheader; member._metadatatoken = (uint)(((int)table) << 24 | index); return(member); }
public SecurityDeclaration(MetaDataRow row) : base(row) { }
public AssemblyDefinition(MetaDataRow row) : base(row) { }
public StandAloneSignature(MetaDataRow row) : base(row) { }
public EnCLog(MetaDataRow row) : base(row) { }
public ModuleReference(MetaDataRow row) : base(row) { }
public EventMap(MetaDataRow row) : base(row) { }
public GenericParameter(MetaDataRow row) : base(row) { }
public ModuleDefinition(MetaDataRow row) : base(row) { }
public MemberReference(MetaDataRow row) : base(row) { }
private bool GetRowAndType(BinaryReader reader, MetaDataTable table, out MetaDataRow row, out Type type) { type = null; row = default(MetaDataRow); switch (table.Type) { case MetaDataTableType.Module: row = ReadRow(reader, GetModuleSignature()); type = typeof(ModuleDefinition); break; case MetaDataTableType.TypeRef: row = ReadRow(reader, GetTypeRefSignature()); type = typeof(TypeReference); break; case MetaDataTableType.TypeDef: row = ReadRow(reader, GetTypeDefSignature()); type = typeof(TypeDefinition); break; case MetaDataTableType.FieldPtr: row = ReadRow(reader, GetFieldPtrSignature()); type = typeof(FieldPtr); break; case MetaDataTableType.Field: row = ReadRow(reader, GetFieldDefSignature()); type = typeof(FieldDefinition); break; case MetaDataTableType.MethodPtr: row = ReadRow(reader, GetMethodPtrSignature()); type = typeof(MethodPtr); break; case MetaDataTableType.Method: row = ReadRow(reader, GetMethodDefSignature()); type = typeof(MethodDefinition); break; case MetaDataTableType.ParamPtr: row = ReadRow(reader, GetParamPtrSignature()); type = typeof(ParamPtr); break; case MetaDataTableType.Param: row = ReadRow(reader, GetParamDefSignature()); type = typeof(ParameterDefinition); break; case MetaDataTableType.InterfaceImpl: row = ReadRow(reader, GetInterfaceImplSignature()); type = typeof(InterfaceImplementation); break; case MetaDataTableType.MemberRef: row = ReadRow(reader, GetMemberRefSignature()); tablesHeap._netheader.BlobHeap._mainStream.Seek(Convert.ToUInt32(row._parts[2]), SeekOrigin.Begin); tablesHeap._netheader.BlobHeap._binReader.ReadByte(); byte sigtype = tablesHeap._netheader.BlobHeap._binReader.ReadByte(); if (sigtype == 0x6) { type = typeof(FieldReference); } else { type = typeof(MethodReference); } break; case MetaDataTableType.Constant: row = ReadRow(reader, GetConstantSignature()); type = typeof(Constant); break; case MetaDataTableType.CustomAttribute: row = ReadRow(reader, GetCustomAttributeSignature()); type = typeof(CustomAttribute); break; case MetaDataTableType.FieldMarshal: row = ReadRow(reader, GetFieldMarshalSignature()); type = typeof(FieldMarshal); break; case MetaDataTableType.DeclSecurity: row = ReadRow(reader, GetSecurityDeclSignature()); type = typeof(SecurityDeclaration); break; case MetaDataTableType.ClassLayout: row = ReadRow(reader, GetClassLayoutSignature()); type = typeof(ClassLayout); break; case MetaDataTableType.FieldLayout: row = ReadRow(reader, GetFieldLayoutSignature()); type = typeof(FieldLayout); break; case MetaDataTableType.StandAloneSig: row = ReadRow(reader, GetStandAloneSigSignature()); type = typeof(StandAloneSignature); break; case MetaDataTableType.EventMap: row = ReadRow(reader, GetEventMapSignature()); type = typeof(EventMap); break; case MetaDataTableType.Event: row = ReadRow(reader, GetEventDefSignature()); type = typeof(EventDefinition); break; case MetaDataTableType.PropertyMap: row = ReadRow(reader, GetPropertyMapSignature()); type = typeof(PropertyMap); break; case MetaDataTableType.PropertyPtr: row = ReadRow(reader, GetPropertyPtrSignature()); type = typeof(PropertyPtr); break; case MetaDataTableType.Property: row = ReadRow(reader, GetPropertyDefSignature()); type = typeof(PropertyDefinition); break; case MetaDataTableType.MethodSemantics: row = ReadRow(reader, GetMethodSemanticsSignature()); type = typeof(MethodSemantics); break; case MetaDataTableType.MethodImpl: row = ReadRow(reader, GetMethodImplSignature()); type = typeof(MethodImplementation); break; case MetaDataTableType.ModuleRef: row = ReadRow(reader, GetModuleRefSignature()); type = typeof(ModuleReference); break; case MetaDataTableType.TypeSpec: row = ReadRow(reader, GetTypeSpecSignature()); type = typeof(TypeSpecification); break; case MetaDataTableType.MethodSpec: row = ReadRow(reader, GetMethodSpecSignature()); type = typeof(MethodSpecification); break; case MetaDataTableType.ImplMap: row = ReadRow(reader, GetPInvokeImplSignature()); type = typeof(PInvokeImplementation); break; case MetaDataTableType.FieldRVA: row = ReadRow(reader, GetFieldRVASignature()); type = typeof(FieldRVA); break; case MetaDataTableType.Assembly: row = ReadRow(reader, GetAssemblyDefSignature()); type = typeof(AssemblyDefinition); break; case MetaDataTableType.AssemblyProcessor: row = ReadRow(reader, GetAssemblyProcSignature()); type = typeof(AssemblyProcessor); break; case MetaDataTableType.AssemblyOS: row = ReadRow(reader, GetAssemblyOSSignature()); type = typeof(AssemblyOS); break; case MetaDataTableType.AssemblyRef: row = ReadRow(reader, GetAssemblyRefSignature()); type = typeof(AssemblyReference); break; case MetaDataTableType.AssemblyRefProcessor: row = ReadRow(reader, GetAssemblyRefProcSignature()); type = typeof(AssemblyRefProcessor); break; case MetaDataTableType.AssemblyRefOS: row = ReadRow(reader, GetAssemblyRefOSSignature()); type = typeof(AssemblyRefOS); break; case MetaDataTableType.File: row = ReadRow(reader, GetFileReferenceSignature()); type = typeof(File); break; case MetaDataTableType.ExportedType: row = ReadRow(reader, GetExportedTypeSignature()); type = typeof(ExportedType); break; case MetaDataTableType.ManifestResource: row = ReadRow(reader, GetManifestResSignature()); type = typeof(ManifestResource); break; case MetaDataTableType.NestedClass: row = ReadRow(reader, GetNestedClassSignature()); type = typeof(NestedClass); break; case MetaDataTableType.EncLog: row = ReadRow(reader, GetEnCLogSignature()); type = typeof(EnCLog); break; case MetaDataTableType.EncMap: row = ReadRow(reader, GetEnCMapSignature()); type = typeof(EnCMap); break; case MetaDataTableType.GenericParam: row = ReadRow(reader, GetGenericParamSignature()); type = typeof(GenericParameter); break; case MetaDataTableType.GenericParamConstraint: row = ReadRow(reader, GetGenericParamConstraintSignature()); type = typeof(GenericParamConstraint); break; } return(type != null); }
public AssemblyReference(MetaDataRow row) : base(row) { }
public FieldRVA(MetaDataRow row) : base(row) { }
public CustomAttribute(MetaDataRow row) : base(row) { }
public FileReference(MetaDataRow row) : base(row) { }
public MethodReference(MetaDataRow row) : base(row) { }
internal MetaDataRow ReadRow(BinaryReader reader, byte[] signature) { MetaDataRow row = new MetaDataRow(); row._parts = new ValueType[signature.Length]; row.NETHeader = tablesHeap._netheader; row._offset = (uint)(reader.BaseStream.Position + tablesHeap.StreamOffset); for (int i = 0; i < signature.Length; i++) { if (signature[i] == sizeof(uint)) row._parts[i] = reader.ReadUInt32(); else if (signature[i] == sizeof(ushort)) row._parts[i] = reader.ReadUInt16(); else if (signature[i] == sizeof(byte)) row._parts[i] = reader.ReadByte(); } return row; }
public InterfaceImplementation(MetaDataRow row) : base(row) { }
public PropertyPtr(MetaDataRow row) : base(row) { }
public MethodImplementation(MetaDataRow row) : base(row) { }
public void Dispose() { _metadatarow = default(MetaDataRow); ClearCache(); }
public FieldDefinition(MetaDataRow row) : base(row) { }
public AssemblyOS(MetaDataRow row) : base(row) { }
public NestedClass(MetaDataRow row) : base(row) { }
public AssemblyProcessor(MetaDataRow row) : base(row) { }
public TypeDefinition(MetaDataRow row) : base(row) { }
public TypeSpecification(MetaDataRow row) : this(row.NETHeader.BlobHeap.ReadTypeSignature(Convert.ToUInt32(row._parts[0]), null)) { _metadatarow = row; }
public ParameterDefinition(MetaDataRow row) : base(row) { }
public PropertyMap(MetaDataRow row) : base(row) { }
public ManifestResource(MetaDataRow row) : base(row) { }
public FieldPtr(MetaDataRow row) : base(row) { }
public FieldMarshal(MetaDataRow row) : base(row) { }
private bool GetRowAndType(BinaryReader reader, MetaDataTable table, out MetaDataRow row, out Type type) { type = null; row = default(MetaDataRow); switch (table.Type) { case MetaDataTableType.Module: row = ReadRow(reader, GetModuleSignature()); type = typeof(ModuleDefinition); break; case MetaDataTableType.TypeRef: row = ReadRow(reader, GetTypeRefSignature()); type = typeof(TypeReference); break; case MetaDataTableType.TypeDef: row = ReadRow(reader, GetTypeDefSignature()); type = typeof(TypeDefinition); break; case MetaDataTableType.FieldPtr: row = ReadRow(reader, GetFieldPtrSignature()); type = typeof(FieldPtr); break; case MetaDataTableType.Field: row = ReadRow(reader, GetFieldDefSignature()); type = typeof(FieldDefinition); break; case MetaDataTableType.MethodPtr: row = ReadRow(reader, GetMethodPtrSignature()); type = typeof(MethodPtr); break; case MetaDataTableType.Method: row = ReadRow(reader, GetMethodDefSignature()); type = typeof(MethodDefinition); break; case MetaDataTableType.ParamPtr: row = ReadRow(reader, GetParamPtrSignature()); type = typeof(ParamPtr); break; case MetaDataTableType.Param: row = ReadRow(reader, GetParamDefSignature()); type = typeof(ParameterDefinition); break; case MetaDataTableType.InterfaceImpl: row = ReadRow(reader, GetInterfaceImplSignature()); type = typeof(InterfaceImplementation); break; case MetaDataTableType.MemberRef: row = ReadRow(reader, GetMemberRefSignature()); tablesHeap._netheader.BlobHeap._mainStream.Seek(Convert.ToUInt32(row._parts[2]), SeekOrigin.Begin); tablesHeap._netheader.BlobHeap._binReader.ReadByte(); byte sigtype = tablesHeap._netheader.BlobHeap._binReader.ReadByte(); if (sigtype == 0x6) type = typeof(FieldReference); else type = typeof(MethodReference); break; case MetaDataTableType.Constant: row = ReadRow(reader, GetConstantSignature()); type = typeof(Constant); break; case MetaDataTableType.CustomAttribute: row = ReadRow(reader, GetCustomAttributeSignature()); type = typeof(CustomAttribute); break; case MetaDataTableType.FieldMarshal: row = ReadRow(reader, GetFieldMarshalSignature()); type = typeof(FieldMarshal); break; case MetaDataTableType.DeclSecurity: row = ReadRow(reader, GetSecurityDeclSignature()); type = typeof(SecurityDeclaration); break; case MetaDataTableType.ClassLayout: row = ReadRow(reader, GetClassLayoutSignature()); type = typeof(ClassLayout); break; case MetaDataTableType.FieldLayout: row = ReadRow(reader, GetFieldLayoutSignature()); type = typeof(FieldLayout); break; case MetaDataTableType.StandAloneSig: row = ReadRow(reader, GetStandAloneSigSignature()); type = typeof(StandAloneSignature); break; case MetaDataTableType.EventMap: row = ReadRow(reader, GetEventMapSignature()); type = typeof(EventMap); break; case MetaDataTableType.Event: row = ReadRow(reader, GetEventDefSignature()); type = typeof(EventDefinition); break; case MetaDataTableType.PropertyMap: row = ReadRow(reader, GetPropertyMapSignature()); type = typeof(PropertyMap); break; case MetaDataTableType.PropertyPtr: row = ReadRow(reader, GetPropertyPtrSignature()); type = typeof(PropertyPtr); break; case MetaDataTableType.Property: row = ReadRow(reader, GetPropertyDefSignature()); type = typeof(PropertyDefinition); break; case MetaDataTableType.MethodSemantics: row = ReadRow(reader, GetMethodSemanticsSignature()); type = typeof(MethodSemantics); break; case MetaDataTableType.MethodImpl: row = ReadRow(reader, GetMethodImplSignature()); type = typeof(MethodImplementation); break; case MetaDataTableType.ModuleRef: row = ReadRow(reader, GetModuleRefSignature()); type = typeof(ModuleReference); break; case MetaDataTableType.TypeSpec: row = ReadRow(reader, GetTypeSpecSignature()); type = typeof(TypeSpecification); break; case MetaDataTableType.MethodSpec: row = ReadRow(reader, GetMethodSpecSignature()); type = typeof(MethodSpecification); break; case MetaDataTableType.ImplMap: row = ReadRow(reader, GetPInvokeImplSignature()); type = typeof(PInvokeImplementation); break; case MetaDataTableType.FieldRVA: row = ReadRow(reader, GetFieldRVASignature()); type = typeof(FieldRVA); break; case MetaDataTableType.Assembly: row = ReadRow(reader, GetAssemblyDefSignature()); type = typeof(AssemblyDefinition); break; case MetaDataTableType.AssemblyProcessor: row = ReadRow(reader, GetAssemblyProcSignature()); type = typeof(AssemblyProcessor); break; case MetaDataTableType.AssemblyOS: row = ReadRow(reader, GetAssemblyOSSignature()); type = typeof(AssemblyOS); break; case MetaDataTableType.AssemblyRef: row = ReadRow(reader, GetAssemblyRefSignature()); type = typeof(AssemblyReference); break; case MetaDataTableType.AssemblyRefProcessor: row = ReadRow(reader, GetAssemblyRefProcSignature()); type = typeof(AssemblyRefProcessor); break; case MetaDataTableType.AssemblyRefOS: row = ReadRow(reader, GetAssemblyRefOSSignature()); type = typeof(AssemblyRefOS); break; case MetaDataTableType.File: row = ReadRow(reader, GetFileReferenceSignature()); type = typeof(File); break; case MetaDataTableType.ExportedType: row = ReadRow(reader, GetExportedTypeSignature()); type = typeof(ExportedType); break; case MetaDataTableType.ManifestResource: row = ReadRow(reader, GetManifestResSignature()); type = typeof(ManifestResource); break; case MetaDataTableType.NestedClass: row = ReadRow(reader, GetNestedClassSignature()); type = typeof(NestedClass); break; case MetaDataTableType.EncLog: row = ReadRow(reader, GetEnCLogSignature()); type = typeof(EnCLog); break; case MetaDataTableType.EncMap: row = ReadRow(reader, GetEnCMapSignature()); type = typeof(EnCMap); break; case MetaDataTableType.GenericParam: row = ReadRow(reader, GetGenericParamSignature()); type = typeof(GenericParameter); break; case MetaDataTableType.GenericParamConstraint: row = ReadRow(reader, GetGenericParamConstraintSignature()); type = typeof(GenericParamConstraint); break; } return type != null; }
public PInvokeImplementation(MetaDataRow row) : base(row) { }
public PropertyDefinition(MetaDataRow row) : base(row) { }
public ClassLayout(MetaDataRow row) : base(row) { }
public Constant(MetaDataRow row) : base(row) { }
public MetaDataMember(MetaDataRow row) { UpdateRowOnRebuild = true; _metadatarow = row; }
public TypeReference(MetaDataRow row) : base(row) { }
public MethodDefinition(MetaDataRow row) : base(row) { }
public MethodSemantics(MetaDataRow row) : base(row) { }
public EventDefinition(MetaDataRow row) : base(row) { }
public GenericParamConstraint(MetaDataRow row) : base(row) { }