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

            }
        }
Exemplo n.º 24
0
 void ReadImplMapList(PortableExecutable pe)
 {
 }
Exemplo n.º 25
0
 void ReadPropertyMapList(PortableExecutable pe)
 {
 }
Exemplo n.º 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;
             }
         );
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 28
0
 void ReadManifestResourceList(PortableExecutable pe)
 {
 }
Exemplo n.º 29
0
 void ReadTypeSpecList(PortableExecutable pe)
 {
 }
Exemplo n.º 30
0
 void ReadClassLayoutList(PortableExecutable pe)
 {
 }