Beispiel #1
0
 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;
             }
         );
     }
 }
Beispiel #2
0
 void ReadStandAloneSigList(PortableExecutable pe)
 {
 }
Beispiel #3
0
 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);
     }
 }
Beispiel #4
0
 void ReadModuleRefList(PortableExecutable pe)
 {
 }
Beispiel #5
0
 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);
     }
 }
Beispiel #6
0
 void ReadMethodImplList(PortableExecutable pe)
 {
 }
Beispiel #7
0
 void ReadMethodSpecList(PortableExecutable pe)
 {
 }
Beispiel #8
0
 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);
     }
 }
Beispiel #9
0
 void ReadFieldMarshalList(PortableExecutable pe)
 {
 }
Beispiel #10
0
 void ReadExportedTypeList(PortableExecutable pe)
 {
 }
Beispiel #11
0
 void ReadFieldLayoutList(PortableExecutable pe)
 {
 }
Beispiel #12
0
 void ReadEventMapList(PortableExecutable pe)
 {
 }
Beispiel #13
0
 void ReadDeclSecurityList(PortableExecutable pe)
 {
 }
Beispiel #14
0
 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;
             }
         );
     }
 }
Beispiel #15
0
 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);
     }
 }
Beispiel #16
0
 void ReadFieldRVAList(PortableExecutable pe)
 {
 }
Beispiel #17
0
 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);
     }
 }
Beispiel #18
0
 void ReadFileList(PortableExecutable pe)
 {
 }
Beispiel #19
0
 void ReadMethodSemanticsList(PortableExecutable pe)
 {
 }
Beispiel #20
0
 void ReadGenericParamConstraintList(PortableExecutable pe)
 {
 }
Beispiel #21
0
 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);
     }
 }
Beispiel #22
0
 void ReadGenericParamList(PortableExecutable pe)
 {
 }
Beispiel #23
0
        void ReadNestedClassList(PortableExecutable pe)
        {
            foreach (var record in pe.MetadataRoot.GetTable<NestedClassTable>(TableID.NestedClass))
            {

            }
        }
Beispiel #24
0
 void ReadImplMapList(PortableExecutable pe)
 {
 }
Beispiel #25
0
 void ReadPropertyMapList(PortableExecutable pe)
 {
 }
Beispiel #26
0
 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;
             }
         );
     }
 }
Beispiel #27
0
 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);
     }
 }
Beispiel #28
0
 void ReadManifestResourceList(PortableExecutable pe)
 {
 }
Beispiel #29
0
 void ReadTypeSpecList(PortableExecutable pe)
 {
 }
Beispiel #30
0
 void ReadClassLayoutList(PortableExecutable pe)
 {
 }