void ReadConstantList(PortableExecutable pe) { uint index = 0; foreach (var record in pe.MetadataRoot.GetTable<ConstantTable>(TableID.Constant)) { index++; var item = new CLIConstant(this); item.Token = new MetadataToken(TableID.Constant, index); item.Type = (ElementType)record.Type; item.Parent = CodedIndex.HasConstant.Decode(record.Parent); item.Value = pe.MetadataRoot.GetBlob(record.Value); ConstantList.AddOrUpdate( item.Parent, token => { var bag = new ConcurrentBag<CLIConstant>(); bag.Add(item); return bag; }, (token, bag) => { bag.Add(item); return bag; } ); } }
void ReadStandAloneSigList(PortableExecutable pe) { }
void ReadTypeRefList(PortableExecutable pe) { uint index = 0; foreach (var record in pe.MetadataRoot.GetTable<TypeRefTable>(TableID.TypeRef)) { index++; var item = new CLITypeRef(this); item.Token = new MetadataToken(TableID.TypeRef, index); item.ResolutionScope = CodedIndex.ResolutionScope.Decode(record.ResolutionScope); item.Name = pe.MetadataRoot.GetString(record.TypeName); item.Namespace = pe.MetadataRoot.GetString(record.TypeNamespace); TypeRefList.Add(item); } }
void ReadModuleRefList(PortableExecutable pe) { }
void ReadParamList(PortableExecutable pe) { uint index = 0; foreach (var record in pe.MetadataRoot.GetTable<ParamTable>(TableID.Param)) { index++; var item = new CLIParam(this); item.Token = new MetadataToken(TableID.Param, index); item.Flags = (ParamAttributes)record.Flags; item.Name = pe.MetadataRoot.GetString(record.Name); ParamList.Add(item); } }
void ReadMethodImplList(PortableExecutable pe) { }
void ReadMethodSpecList(PortableExecutable pe) { }
void ReadFieldList(PortableExecutable pe) { uint index = 0; foreach (var record in pe.MetadataRoot.GetTable<FieldTable>(TableID.Field)) { index++; var item = new CLIField(this); item.Token = new MetadataToken(TableID.Field, index); item.Flags = (FieldAttributes)record.Flags; item.Name = pe.MetadataRoot.GetString(record.Name); item.Signature = Signature.ParseFieldSignature(pe.MetadataRoot.GetBlob(record.Signature)); FieldList.Add(item); } }
void ReadFieldMarshalList(PortableExecutable pe) { }
void ReadExportedTypeList(PortableExecutable pe) { }
void ReadFieldLayoutList(PortableExecutable pe) { }
void ReadEventMapList(PortableExecutable pe) { }
void ReadDeclSecurityList(PortableExecutable pe) { }
void ReadCustomAttributeList(PortableExecutable pe) { uint index = 0; foreach (var record in pe.MetadataRoot.GetTable<CustomAttributeTable>(TableID.CustomAttribute)) { index++; var item = new CLICustomAttribute(this); item.Token = new MetadataToken(TableID.CustomAttribute, index); item.Parent = CodedIndex.HasCustomAttribute.Decode(record.Parent); item.Type = CodedIndex.CustomAttributeType.Decode(record.Type); item.Value = pe.MetadataRoot.GetBlob(record.Value); CustomAttributeList.AddOrUpdate( item.Parent, token => { var bag = new ConcurrentBag<CLICustomAttribute>(); bag.Add(item); return bag; }, (token, bag) => { bag.Add(item); return bag; } ); } }
void ReadMemberRefList(PortableExecutable pe) { uint index = 0; foreach (var record in pe.MetadataRoot.GetTable<MemberRefTable>(TableID.MemberRef)) { index++; var item = new CLIMemberRef(this); item.Token = new MetadataToken(TableID.MemberRef, index); item.Class = CodedIndex.MemberRefParent.Decode(record.Class); item.Name = pe.MetadataRoot.GetString(record.Name); MemberRefList.Add(item); } }
void ReadFieldRVAList(PortableExecutable pe) { }
void ReadMethodDefList(PortableExecutable pe) { uint index = 0; foreach (var record in pe.MetadataRoot.GetTable<MethodDefTable>(TableID.MethodDef)) { index++; var item = new CLIMethodDef(this); item.Token = new MetadataToken(TableID.MethodDef, index); item.ImplFlags = (MethodImplAttributes)record.ImplFlags; item.Flags = (MethodAttributes)record.Flags; item.Name = pe.MetadataRoot.GetString(record.Name); item.Signature = Signature.ParseMethodSignature(pe.MetadataRoot.GetBlob(record.Signature)); MethodDefList.Add(item); } }
void ReadFileList(PortableExecutable pe) { }
void ReadMethodSemanticsList(PortableExecutable pe) { }
void ReadGenericParamConstraintList(PortableExecutable pe) { }
void ReadModuleList(PortableExecutable pe) { uint index = 0; foreach (var record in pe.MetadataRoot.GetTable<ModuleTable>(TableID.Module)) { index++; var item = new CLIModule(this); item.Token = new MetadataToken(TableID.Module, index); item.Name = pe.MetadataRoot.GetString(record.Name); item.Guid = pe.MetadataRoot.GetGuid(record.Mvid); ModuleList.Add(item); } }
void ReadGenericParamList(PortableExecutable pe) { }
void ReadNestedClassList(PortableExecutable pe) { foreach (var record in pe.MetadataRoot.GetTable<NestedClassTable>(TableID.NestedClass)) { } }
void ReadImplMapList(PortableExecutable pe) { }
void ReadPropertyMapList(PortableExecutable pe) { }
void ReadInterfaceImplList(PortableExecutable pe) { uint index = 0; foreach (var record in pe.MetadataRoot.GetTable<InterfaceImplTable>(TableID.InterfaceImpl)) { index++; var item = new CLIInterfaceImpl(this); item.Token = new MetadataToken(TableID.InterfaceImpl, index); item.Class = new MetadataToken(TableID.TypeDef, record.Class); item.Interface = CodedIndex.TypeDefOrRef.Decode(record.Interface); InterfaceImplList.AddOrUpdate( item.Class, token => { var bag = new ConcurrentBag<CLIInterfaceImpl>(); bag.Add(item); return bag; }, (token, bag) => { bag.Add(item); return bag; } ); } }
void ReadTypeDefList(PortableExecutable pe) { uint index = 0; foreach (var record in pe.MetadataRoot.GetTable<TypeDefTable>(TableID.TypeDef)) { index++; var item = new CLITypeDef(this); item.Token = new MetadataToken(TableID.TypeDef, index); item.Flags = (TypeAttributes)record.Flags; item.Name = pe.MetadataRoot.GetString(record.TypeName); item.Namespace = pe.MetadataRoot.GetString(record.TypeNamespace); TypeDefList.Add(item); } }
void ReadManifestResourceList(PortableExecutable pe) { }
void ReadTypeSpecList(PortableExecutable pe) { }
void ReadClassLayoutList(PortableExecutable pe) { }