• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PEFileToObjectModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PEFileToObjectModel的典型用法代码示例。如果您正苦于以下问题:C# PEFileToObjectModel类的具体用法?C# PEFileToObjectModel怎么用?C# PEFileToObjectModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PEFileToObjectModel类属于命名空间,在下文中一共展示了PEFileToObjectModel类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AttributeDecoder

     protected AttributeDecoder(
   PEFileToObjectModel peFileToObjectModel,
   MemoryReader signatureMemoryReader
 )
     {
         this.PEFileToObjectModel = peFileToObjectModel;
           this.SignatureMemoryReader = signatureMemoryReader;
           this.morePermutationsArePossible = true;
     }
开发者ID:harib,项目名称:Afterthought,代码行数:9,代码来源:Attributes.cs


示例2: GetAsTypeReference

     internal override IModuleTypeReference GetAsTypeReference(
   PEFileToObjectModel peFileToObjectModel, IModuleModuleReference module
 )
     {
         return this.GetAsNomimalType(peFileToObjectModel, module);
     }
开发者ID:harib,项目名称:Afterthought,代码行数:6,代码来源:Attributes.cs


示例3: StandAloneMethodSignatureConverter

 internal StandAloneMethodSignatureConverter(PEFileToObjectModel peFileToObjectModel, MethodDefinition moduleMethodDef, MemoryReader signatureMemoryReader)
   : base(peFileToObjectModel, signatureMemoryReader, moduleMethodDef) {
   this.RequiredParameters = Enumerable<IParameterTypeInformation>.Empty;
   this.VarArgParameters = Enumerable<IParameterTypeInformation>.Empty;
   //  TODO: Check minimum required size of the signature...
   this.FirstByte = this.SignatureMemoryReader.ReadByte();
   int paramCount = this.SignatureMemoryReader.ReadCompressedUInt32();
   bool dummyPinned;
   this.ReturnCustomModifiers = this.GetCustomModifiers(out dummyPinned);
   byte retByte = this.SignatureMemoryReader.PeekByte(0);
   if (retByte == ElementType.Void) {
     this.ReturnTypeReference = peFileToObjectModel.PlatformType.SystemVoid;
     this.SignatureMemoryReader.SkipBytes(1);
   } else if (retByte == ElementType.TypedReference) {
     this.ReturnTypeReference = peFileToObjectModel.PlatformType.SystemTypedReference;
     this.SignatureMemoryReader.SkipBytes(1);
   } else {
     if (retByte == ElementType.ByReference) {
       this.IsReturnByReference = true;
       this.SignatureMemoryReader.SkipBytes(1);
     }
     this.ReturnTypeReference = this.GetTypeReference();
   }
   if (paramCount > 0) {
     IParameterTypeInformation[] reqModuleParamArr = this.GetModuleParameterTypeInformations(Dummy.Signature, paramCount);
     if (reqModuleParamArr.Length > 0) this.RequiredParameters = IteratorHelper.GetReadonly(reqModuleParamArr);
     IParameterTypeInformation[] varArgModuleParamArr = this.GetModuleParameterTypeInformations(Dummy.Signature, paramCount - reqModuleParamArr.Length);
     if (varArgModuleParamArr.Length > 0) this.VarArgParameters = IteratorHelper.GetReadonly(varArgModuleParamArr);
   }
 }
开发者ID:modulexcite,项目名称:Microsoft.Cci.Metadata,代码行数:30,代码来源:ILReader.cs


示例4: GetAsTypeReference

 internal override ITypeReference/*?*/ GetAsTypeReference(PEFileToObjectModel peFileToObjectModel, IMetadataReaderModuleReference module) {
   foreach (var aref in peFileToObjectModel.GetAssemblyReferences()) {
     var assemRef = aref as AssemblyReference;
     if (assemRef == null) continue;
     if (assemRef.AssemblyIdentity.Equals(this.AssemblyIdentity))
       return this.TypeName.GetAsTypeReference(peFileToObjectModel, assemRef);
   }
   if (module.ContainingAssembly.AssemblyIdentity.Equals(this.AssemblyIdentity))
     return this.TypeName.GetAsTypeReference(peFileToObjectModel, module);
   AssemblyFlags flags = this.Retargetable ? AssemblyFlags.Retargetable : (AssemblyFlags)0;
   return this.TypeName.GetAsTypeReference(peFileToObjectModel, new AssemblyReference(peFileToObjectModel, 0, this.AssemblyIdentity, flags));
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:12,代码来源:Attributes.cs


示例5: GetAsNomimalType

 internal override IMetadataReaderNamedTypeReference/*?*/ GetAsNomimalType(
   PEFileToObjectModel peFileToObjectModel,
   IMetadataReaderModuleReference module
 ) {
   var typeRef = new NamespaceTypeNameTypeReference(module, this, peFileToObjectModel);
   var redirectedTypeRef = peFileToObjectModel.ModuleReader.metadataReaderHost.Redirect(peFileToObjectModel.Module, typeRef) as INamespaceTypeReference;
   if (redirectedTypeRef != typeRef && redirectedTypeRef != null) {
     var namespaceName = this.GetNamespaceName(peFileToObjectModel.NameTable, redirectedTypeRef.ContainingUnitNamespace as INestedUnitNamespaceReference);
     var mangledName = redirectedTypeRef.Name;
     if (redirectedTypeRef.GenericParameterCount > 0)
       mangledName = peFileToObjectModel.NameTable.GetNameFor(redirectedTypeRef.Name.Value+"`"+redirectedTypeRef.GenericParameterCount);
     var redirectedNamespaceTypeName = new NamespaceTypeName(peFileToObjectModel.NameTable, namespaceName, mangledName, redirectedTypeRef.Name);
     return new NamespaceTypeNameTypeReference(module, redirectedNamespaceTypeName, peFileToObjectModel);
   }
   return typeRef;
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:16,代码来源:Attributes.cs


示例6: SecurityAttributeDecoder20

     //^ [NotDelayed]
     internal SecurityAttributeDecoder20(
   PEFileToObjectModel peFileToObjectModel,
   MemoryReader signatureMemoryReader,
   SecurityAttribute securityAttribute
 )
         : base(peFileToObjectModel, signatureMemoryReader)
     {
         //^ this.SignatureMemoryReader = signatureMemoryReader; //TODO: Spec# bug. This assignment should not be necessary.
           this.SecurityAttributes = TypeCache.EmptySecurityAttributes;
           //^ base;
           byte prolog = this.SignatureMemoryReader.ReadByte();
           if (prolog != SerializationType.SecurityAttribute20Start) {
         return;
           }
           int numberOfAttributes = this.SignatureMemoryReader.ReadCompressedUInt32();
           SecurityCustomAttribute[] securityCustomAttributes = new SecurityCustomAttribute[numberOfAttributes];
           for (int i = 0; i < numberOfAttributes; ++i) {
         SecurityCustomAttribute/*?*/ secAttr = this.ReadSecurityAttribute(securityAttribute);
         if (secAttr == null) {
           //  MDError...
           return;
         }
         securityCustomAttributes[i] = secAttr;
           }
           //^ NonNullType.AssertInitialized(securityCustomAttributes);
           this.SecurityAttributes = new EnumerableArrayWrapper<SecurityCustomAttribute, ICustomAttribute>(securityCustomAttributes, Dummy.CustomAttribute);
     }
开发者ID:harib,项目名称:Afterthought,代码行数:28,代码来源:Attributes.cs


示例7: CustomAttributeDecoder

     //^ [NotDelayed]
     internal CustomAttributeDecoder(
   PEFileToObjectModel peFileToObjectModel,
   MemoryReader signatureMemoryReader,
   uint customAttributeRowId,
   IModuleMethodReference attributeConstructor
 )
         : base(peFileToObjectModel, signatureMemoryReader)
     {
         //^ this.SignatureMemoryReader = signatureMemoryReader; //TODO: Spec# bug. This assignment should not be necessary.
           this.CustomAttribute = Dummy.CustomAttribute;
           //^ base;
           ushort prolog = this.SignatureMemoryReader.ReadUInt16();
           if (prolog != SerializationType.CustomAttributeStart) {
         return;
           }
           List<ExpressionBase> exprList = new List<ExpressionBase>();
           IModuleParameterTypeInformation[] modParams = attributeConstructor.RequiredModuleParameterInfos.RawArray;
           int len = modParams.Length;
           for (int i = 0; i < len; ++i) {
         IModuleTypeReference/*?*/ moduleTypeRef = modParams[i].ModuleTypeReference;
         if (moduleTypeRef == null) {
           //  Error...
           return;
         }
         ExpressionBase/*?*/ argument = this.ReadSerializedValue(moduleTypeRef);
         if (argument == null) {
           //  Error...
           this.decodeFailed = true;
           return;
         }
         exprList.Add(argument);
           }
           ushort numOfNamedArgs = this.SignatureMemoryReader.ReadUInt16();
           FieldOrPropertyNamedArgumentExpression[]/*?*/ namedArgumentArray = null;
           if (numOfNamedArgs > 0) {
         namedArgumentArray = new FieldOrPropertyNamedArgumentExpression[numOfNamedArgs];
         for (ushort i = 0; i < numOfNamedArgs; ++i) {
           bool isField = this.SignatureMemoryReader.ReadByte() == SerializationType.Field;
           IModuleTypeReference/*?*/ memberType = this.GetFieldOrPropType();
           if (memberType == null) {
         //  Error...
         return;
           }
           string/*?*/ memberStr = this.GetSerializedString();
           if (memberStr == null)
         return;
           IName memberName = this.PEFileToObjectModel.NameTable.GetNameFor(memberStr);
           ExpressionBase/*?*/ value = this.ReadSerializedValue(memberType);
           if (value == null) {
         //  Error...
         return;
           }
           IModuleTypeReference/*?*/ moduleTypeRef = attributeConstructor.OwningTypeReference;
           if (moduleTypeRef == null) {
         //  Error...
         return;
           }
           FieldOrPropertyNamedArgumentExpression namedArg = new FieldOrPropertyNamedArgumentExpression(memberName, moduleTypeRef, isField, memberType, value);
           namedArgumentArray[i] = namedArg;
         }
           }
           EnumerableArrayWrapper<ExpressionBase, IMetadataExpression> arguments = TypeCache.EmptyExpressionList;
           if (exprList.Count > 0)
         arguments = new EnumerableArrayWrapper<ExpressionBase, IMetadataExpression>(exprList.ToArray(), Dummy.Expression);
           EnumerableArrayWrapper<FieldOrPropertyNamedArgumentExpression, IMetadataNamedArgument> namedArguments = TypeCache.EmptyNamedArgumentList;
           if (namedArgumentArray != null)
         namedArguments = new EnumerableArrayWrapper<FieldOrPropertyNamedArgumentExpression, IMetadataNamedArgument>(namedArgumentArray, Dummy.NamedArgument);
           this.CustomAttribute = new CustomAttribute(this.PEFileToObjectModel, customAttributeRowId, attributeConstructor, arguments, namedArguments);
     }
开发者ID:harib,项目名称:Afterthought,代码行数:70,代码来源:Attributes.cs


示例8: ResolveNominalTypeName

     /*?*/
     internal abstract TypeBase ResolveNominalTypeName(
   PEFileToObjectModel peFileToObjectModel
 );
开发者ID:harib,项目名称:Afterthought,代码行数:4,代码来源:Attributes.cs


示例9: SecurityAttribute

 internal SecurityAttribute(
   PEFileToObjectModel peFileToObjectModel,
   uint declSecurityRowId,
   SecurityAction action
 )
   : base(peFileToObjectModel) {
   this.DeclSecurityRowId = declSecurityRowId;
   this.Action = action;
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:9,代码来源:Attributes.cs


示例10: CustomAttribute

     internal CustomAttribute(
   PEFileToObjectModel peFileToObjectModel,
   uint attributeRowId,
   IModuleMethodReference constructor,
   EnumerableArrayWrapper<ExpressionBase, IMetadataExpression> arguments,
   EnumerableArrayWrapper<FieldOrPropertyNamedArgumentExpression, IMetadataNamedArgument> namedArguments
 )
         : base(peFileToObjectModel)
     {
         this.AttributeRowId = attributeRowId;
           this.Constructor = constructor;
           this.Arguments = arguments;
           this.NamedArguments = namedArguments;
     }
开发者ID:harib,项目名称:Afterthought,代码行数:14,代码来源:Attributes.cs


示例11: GetAsNamedTypeReference

 internal IMetadataReaderNamedTypeReference GetAsNamedTypeReference(
   PEFileToObjectModel peFileToObjectModel, IMetadataReaderModuleReference module
 ) {
   return this.GetAsNomimalType(peFileToObjectModel, module);
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:5,代码来源:Attributes.cs


示例12: ResolveNominalTypeName

 internal abstract INamedTypeDefinition/*?*/ ResolveNominalTypeName(
   PEFileToObjectModel peFileToObjectModel
 );
开发者ID:Biegal,项目名称:Afterthought,代码行数:3,代码来源:Attributes.cs


示例13: GetSpecializedTypeReference

 private ITypeReference GetSpecializedTypeReference(PEFileToObjectModel peFileToObjectModel, INamedTypeReference nominalType, out int argumentUsed, bool mostNested) {
   argumentUsed = 0;
   int len = this.GenericArguments.Count;
   var nestedType = nominalType as INestedTypeReference;
   if (nestedType != null) {
     var parentTemplate = this.GetSpecializedTypeReference(peFileToObjectModel, (INamedTypeReference)nestedType.ContainingType, out argumentUsed, mostNested: false);
     if (parentTemplate != nestedType.ContainingType)
       nominalType = new SpecializedNestedTypeReference(nestedType, parentTemplate, peFileToObjectModel.InternFactory);
   }
   var argsToUse = mostNested ? len-argumentUsed : nominalType.GenericParameterCount;
   if (argsToUse == 0) return nominalType;
   var genericArgumentsReferences = new ITypeReference[argsToUse];
   for (int i = 0; i < argsToUse; ++i)
     genericArgumentsReferences[i] = this.GenericArguments[i+argumentUsed].GetAsTypeReference(peFileToObjectModel, peFileToObjectModel.Module)??Dummy.TypeReference;
   argumentUsed += argsToUse;
   return new GenericTypeInstanceReference(nominalType, IteratorHelper.GetReadonly(genericArgumentsReferences), peFileToObjectModel.InternFactory);
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:17,代码来源:Attributes.cs


示例14: TypeOfExpression

 internal TypeOfExpression(
   PEFileToObjectModel peFileToObjectModel,
   ITypeReference/*?*/ typeExpression
 ) {
   this.PEFileToObjectModel = peFileToObjectModel;
   this.TypeExpression = typeExpression;
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:7,代码来源:Attributes.cs


示例15: LocalVariableSignatureConverter

 internal LocalVariableSignatureConverter(
   PEFileToObjectModel peFileToObjectModel,
   MethodBody owningMethodBody,
   MemoryReader signatureMemoryReader
 )
   : base(peFileToObjectModel, signatureMemoryReader, owningMethodBody.MethodDefinition) {
   this.OwningMethodBody = owningMethodBody;
   byte firstByte = this.SignatureMemoryReader.ReadByte();
   if (!SignatureHeader.IsLocalVarSignature(firstByte)) {
     //  MDError
   }
   int locVarCount = this.SignatureMemoryReader.ReadCompressedUInt32();
   LocalVariableDefinition[] locVarArr = new LocalVariableDefinition[locVarCount];
   for (int i = 0; i < locVarCount; ++i) {
     locVarArr[i] = this.GetLocalVariable((uint)i);
   }
   this.LocalVariables = locVarArr;
 }
开发者ID:modulexcite,项目名称:Microsoft.Cci.Metadata,代码行数:18,代码来源:ILReader.cs


示例16: CustomAttribute

 internal CustomAttribute(PEFileToObjectModel peFileToObjectModel, uint attributeRowId, IMethodReference constructor,
   IMetadataExpression[]/*?*/ arguments, IMetadataNamedArgument[]/*?*/ namedArguments)
   : base(peFileToObjectModel) {
   this.AttributeRowId = attributeRowId;
   this.Constructor = constructor;
   this.Arguments = arguments;
   this.NamedArguments = namedArguments;
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:8,代码来源:Attributes.cs


示例17: ILReader

 internal ILReader(
   MethodDefinition methodDefinition,
   MethodIL methodIL
 ) {
   this.MethodDefinition = methodDefinition;
   this.PEFileToObjectModel = methodDefinition.PEFileToObjectModel;
   this.MethodIL = methodIL;
   this.MethodBody = new MethodBody(methodDefinition, methodIL.LocalVariablesInited, methodIL.MaxStack);
   this.EndOfMethodOffset = (uint)methodIL.EncodedILMemoryBlock.Length;
 }
开发者ID:modulexcite,项目名称:Microsoft.Cci.Metadata,代码行数:10,代码来源:ILReader.cs


示例18: GetAsNomimalType

     /*?*/
     internal abstract IModuleNominalType GetAsNomimalType(
   PEFileToObjectModel peFileToObjectModel,
   IModuleModuleReference module
 );
开发者ID:harib,项目名称:Afterthought,代码行数:5,代码来源:Attributes.cs



注:本文中的PEFileToObjectModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PEModuleBuilder类代码示例发布时间:2022-05-24
下一篇:
C# PEAPI类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap