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

C# AssemblyDef类代码示例

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

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



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

示例1: isForm

 public static bool isForm(AssemblyDef asm)
 {
     bool result = false;
     foreach (ModuleDef current in asm.Modules)
     {
         foreach (TypeDef current2 in current.Types)
         {
             foreach (TypeDef current3 in current2.NestedTypes)
             {
                 foreach (MethodDef current4 in current3.Methods)
                 {
                     if (current4.Name == "InitializeComponent")
                     {
                         result = true;
                     }
                 }
             }
             foreach (MethodDef current5 in current2.Methods)
             {
                 if (current5.Name == "InitializeComponent")
                 {
                     result = true;
                 }
             }
         }
     }
     return result;
 }
开发者ID:xingkongtianyu,项目名称:Protect.NET,代码行数:28,代码来源:Checker.cs


示例2: AddToCache

 /// <summary>
 /// Add an assembly to the assembly cache
 /// </summary>
 /// <param name="asm">The assembly</param>
 /// <returns>
 /// <c>true</c> if <paramref name="asm" /> is cached, <c>false</c> if it's not
 /// cached because some other assembly with the exact same full name has already been
 /// cached or if <paramref name="asm" /> is <c>null</c>.
 /// </returns>
 public bool AddToCache(AssemblyDef asm)
 {
     if (_cache.ContainsKey(asm))
         return false;
     _cache[asm] = asm;
     return true;
 }
开发者ID:picrap,项目名称:StitcherBoy,代码行数:16,代码来源:ReadonlyAssemblyResolver.cs


示例3: GetBaseDirectory

		string GetBaseDirectory(AssemblyDef asm, ModuleDef mod) {
			if (string.IsNullOrEmpty(mod.Location))
				return string.Empty;
			try {
				return Path.GetDirectoryName(mod.Location);
			}
			catch {
				return string.Empty;
			}
		}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:10,代码来源:SatelliteAssemblyFinder.cs


示例4: AssemblyOptions

		public AssemblyOptions(AssemblyDef asm) {
			HashAlgorithm = asm.HashAlgorithm;
			Version = asm.Version;
			Attributes = asm.Attributes;
			PublicKey = asm.PublicKey;
			Name = asm.Name;
			Culture = asm.Culture;
			ClrVersion = Module.ClrVersion.DefaultVersion;
			CustomAttributes.AddRange(asm.CustomAttributes);
			DeclSecurities.AddRange(asm.DeclSecurities);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:11,代码来源:AssemblyOptions.cs


示例5: DeobfuscateAssembly

        public override AssemblyDef DeobfuscateAssembly(AssemblyDef asmDef)
        {
            Ctx.Assembly = asmDef;
            Ctx.OriginalMD = (Ctx.Assembly.ManifestModule as ModuleDefMD);

            InitializePipelines();
            Pipelines["preRoutines"].Process();
            Pipelines["routines"].Process();

            return Ctx.Assembly;
        }
开发者ID:n017,项目名称:ConfuserDeobfuscator,代码行数:11,代码来源:Deobfuscator19R.cs


示例6: ResolveCLRNamespaces

		IEnumerable<string> ResolveCLRNamespaces(AssemblyDef assembly, string ns) {
			foreach (var attr in assembly.CustomAttributes.FindAll("System.Windows.Markup.XmlnsDefinitionAttribute")) {
				Debug.Assert(attr.ConstructorArguments.Count == 2);

				var xmlNs = attr.ConstructorArguments[0].Value;
				var clrNs = attr.ConstructorArguments[1].Value;
				Debug.Assert(xmlNs is UTF8String && clrNs is UTF8String);

				if ((UTF8String)xmlNs == ns)
					yield return (UTF8String)clrNs;
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:12,代码来源:XmlnsPropertyHandler.cs


示例7: InjectSettings

 private void InjectSettings(AssemblyDef asm)
 {
     var ep = asm.ManifestModule.EntryPoint;
     var settingsMethod = ep.DeclaringType.FindMethod(new UTF8String("InitializeSettings"));
     if (settingsMethod == null)
         throw new ComponentMissingException("Failed to locate InitializeSettings method in stub");
     settingsMethod.Body.Instructions[0].Operand = _settings.Hostname;
     settingsMethod.Body.Instructions[2].OpCode = OpCodes.Ldc_I4;
     settingsMethod.Body.Instructions[2].Operand = _settings.Port;
     settingsMethod.Body.Instructions[4].OpCode = OpCodes.Ldc_I4;
     settingsMethod.Body.Instructions[4].Operand = _settings.ReconnectDelay*1000;
 }
开发者ID:Viralmaniar,项目名称:uRAT,代码行数:12,代码来源:StubBuilder.cs


示例8: CopyTo

		public AssemblyDef CopyTo(AssemblyDef asm) {
			asm.HashAlgorithm = HashAlgorithm;
			asm.Version = Version;
			asm.Attributes = Attributes;
			asm.PublicKey = PublicKey;
			asm.Name = Name ?? UTF8String.Empty;
			asm.Culture = Culture;
			asm.CustomAttributes.Clear();
			asm.CustomAttributes.AddRange(CustomAttributes);
			asm.DeclSecurities.Clear();
			asm.DeclSecurities.AddRange(DeclSecurities);
			return asm;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:13,代码来源:AssemblyOptions.cs


示例9: FetchSubversion1_9

        private static DeobfuscatorBase FetchSubversion1_9(AssemblyDef asmDef)
        {
            foreach (var type in asmDef.ManifestModule.Types)
            {
                if (type.Name.String.StartsWith("Lzma") && type.HasNestedTypes && type.NestedTypes.Count == 6)
                {
                    // Weak 1.9L detection
                    return Activator.CreateInstance<Deobfuscator19L>();
                }
            }

            return Activator.CreateInstance<Deobfuscator19R>();
        }
开发者ID:GodLesZ,项目名称:ConfuserDeobfuscator,代码行数:13,代码来源:DeobfuscatorFactory.cs


示例10: GetResult

		public override DocumentTreeNodeFilterResult GetResult(AssemblyDef asm) {
			var thisFlag = VisibleMembersFlags.AssemblyDef;
			var visibleFlags = thisFlag | VisibleMembersFlags.ModuleDef |
					VisibleMembersFlags.Namespace | VisibleMembersFlags.AnyTypeDef |
					VisibleMembersFlags.FieldDef | VisibleMembersFlags.MethodDef |
					VisibleMembersFlags.InstanceConstructor | VisibleMembersFlags.PropertyDef |
					VisibleMembersFlags.EventDef | VisibleMembersFlags.AssemblyRef |
					VisibleMembersFlags.BaseTypes | VisibleMembersFlags.DerivedTypes |
					VisibleMembersFlags.ModuleRef | VisibleMembersFlags.ResourceList |
					VisibleMembersFlags.MethodBody | VisibleMembersFlags.ParamDefs |
					VisibleMembersFlags.ParamDef | VisibleMembersFlags.Locals |
					VisibleMembersFlags.Local | VisibleMembersFlags.Resource |
					VisibleMembersFlags.ResourceElement | VisibleMembersFlags.Other |
					VisibleMembersFlags.Attributes;
			return FilterFile(thisFlag, visibleFlags);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:16,代码来源:FlagsDocumentTreeNodeFilter.cs


示例11: WriteAssembly

		protected void WriteAssembly(AssemblyDef asm, IDecompilerOutput output, DecompilationContext ctx) {
			DecompileInternal(asm, output, ctx);
			output.WriteLine();
			PrintEntryPoint(asm.ManifestModule, output);
			var peImage = TryGetPEImage(asm.ManifestModule);
			if (peImage != null) {
				WriteCommentBegin(output, true);
				uint ts = peImage.ImageNTHeaders.FileHeader.TimeDateStamp;
				var date = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(ts);
				var dateString = date.ToString(CultureInfo.CurrentUICulture.DateTimeFormat);
				output.Write(string.Format(dnSpy_Decompiler_Resources.Decompile_Timestamp, ts, dateString), BoxedTextColor.Comment);
				WriteCommentEnd(output, true);
				output.WriteLine();
			}
			output.WriteLine();
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:16,代码来源:DecompilerBase.cs


示例12: GetFiles

		IEnumerable<string> GetFiles(AssemblyDef asm, ModuleDef mod) {
			var baseDir = GetBaseDirectory(asm, mod);
			if (string.IsNullOrEmpty(baseDir))
				yield break;
			var baseDirs = new List<string>();
			baseDirs.Add(baseDir);
			//TODO: Add all privatePath dirs found in app.config
			foreach (var bd in baseDirs) {
				foreach (var dir in GetDirectories(baseDir)) {
					var name = Path.GetFileName(dir);
					if (!IsValidCulture(name))
						continue;
					yield return Path.Combine(dir, asm.Name + ".resources.dll");
					yield return Path.Combine(dir, asm.Name, asm.Name + ".resources.dll");
				}
			}
		}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:17,代码来源:SatelliteAssemblyFinder.cs


示例13: Write

        public void Write(ISyntaxHighlightOutput output, ILanguage language, AssemblyDef asm, bool showToken, bool showAssemblyVersion, bool showAssemblyPublicKeyToken)
        {
            output.Write(asm.Name, IsExe(asm.ManifestModule) ? TextTokenKind.AssemblyExe : TextTokenKind.Assembly);

            bool showAsmVer = showAssemblyVersion;
            bool showPublicKeyToken = showAssemblyPublicKeyToken && !PublicKeyBase.IsNullOrEmpty2(asm.PublicKeyToken);

            if (showAsmVer || showPublicKeyToken) {
                output.WriteSpace();
                output.Write("(", TextTokenKind.Operator);

                bool needComma = false;
                if (showAsmVer) {
                    if (needComma)
                        output.WriteCommaSpace();
                    needComma = true;

                    output.Write(asm.Version);
                }

                if (showPublicKeyToken) {
                    if (needComma)
                        output.WriteCommaSpace();
                    needComma = true;

                    var pkt = asm.PublicKeyToken;
                    if (PublicKeyBase.IsNullOrEmpty2(pkt))
                        output.Write("null", TextTokenKind.Keyword);
                    else
                        output.Write(pkt.ToString(), TextTokenKind.Number);
                }

                output.Write(")", TextTokenKind.Operator);
            }

            WriteToken(output, asm, showToken);
        }
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:37,代码来源:NodePrinter.cs


示例14: Write

		/// <summary>
		/// Writes an assembly
		/// </summary>
		/// <param name="output">Output</param>
		/// <param name="decompiler">Decompiler</param>
		/// <param name="asm">Assembly</param>
		/// <param name="showToken">true to write tokens</param>
		/// <param name="showAssemblyVersion">true to write version</param>
		/// <param name="showAssemblyPublicKeyToken">true to write public key token</param>
		public void Write(ITextColorWriter output, IDecompiler decompiler, AssemblyDef asm, bool showToken, bool showAssemblyVersion, bool showAssemblyPublicKeyToken) {
			output.Write(IsExe(asm.ManifestModule) ? BoxedTextColor.AssemblyExe : BoxedTextColor.Assembly, asm.Name);

			bool showAsmVer = showAssemblyVersion;
			bool showPublicKeyToken = showAssemblyPublicKeyToken && !PublicKeyBase.IsNullOrEmpty2(asm.PublicKeyToken);

			if (showAsmVer || showPublicKeyToken) {
				output.WriteSpace();
				output.Write(BoxedTextColor.Punctuation, "(");

				bool needComma = false;
				if (showAsmVer) {
					if (needComma)
						output.WriteCommaSpace();
					needComma = true;

					output.Write(asm.Version);
				}

				if (showPublicKeyToken) {
					if (needComma)
						output.WriteCommaSpace();
					needComma = true;

					var pkt = asm.PublicKeyToken;
					if (PublicKeyBase.IsNullOrEmpty2(pkt))
						output.Write(BoxedTextColor.Keyword, "null");
					else
						output.Write(BoxedTextColor.Number, pkt.ToString());
				}

				output.Write(BoxedTextColor.Punctuation, ")");
			}

			WriteToken(output, asm, showToken);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:45,代码来源:NodePrinter.cs


示例15: ReadModule

        /// <summary>
        /// Reads a module
        /// </summary>
        /// <param name="fileRid">File rid</param>
        /// <param name="owner">The assembly owning the module we should read</param>
        /// <returns>A new <see cref="ModuleDefMD"/> instance or <c>null</c> if <paramref name="fileRid"/>
        /// is invalid or if it's not a .NET module.</returns>
        internal ModuleDefMD ReadModule(uint fileRid, AssemblyDef owner)
        {
            var fileDef = ResolveFile(fileRid);
            if (fileDef == null)
                return null;
            if (!fileDef.ContainsMetaData)
                return null;
            var fileName = GetValidFilename(GetBaseDirectoryOfImage(), UTF8String.ToSystemString(fileDef.Name));
            if (fileName == null)
                return null;
            ModuleDefMD module;
            try {
                module = ModuleDefMD.Load(fileName);
            }
            catch {
                module = null;
            }
            if (module != null) {
                // share context
                module.context = context;

                var asm = module.Assembly;
                if (asm != null && asm != owner)
                    asm.Modules.Remove(module);
            }
            return module;
        }
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:34,代码来源:ModuleDefMD.cs


示例16: DeobfuscateAssembly

 public virtual AssemblyDef DeobfuscateAssembly(AssemblyDef asmDef)
 {
     return null;
 }
开发者ID:GodLesZ,项目名称:ConfuserDeobfuscator,代码行数:4,代码来源:DeobfuscatorBase.cs


示例17: FindAssemblyNode

 public AssemblyTreeNode FindAssemblyNode(AssemblyDef asm)
 {
     if (asm == null)
         return null;
     App.Current.Dispatcher.VerifyAccess();
     foreach (AssemblyTreeNode node in this.Children) {
         if (node.LoadedAssembly.IsLoaded && node.LoadedAssembly.AssemblyDefinition == asm)
             return node;
     }
     return null;
 }
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:11,代码来源:AssemblyListTreeNode.cs


示例18: GetResult

		public virtual DocumentTreeNodeFilterResult GetResult(AssemblyDef asm) => new DocumentTreeNodeFilterResult();
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:1,代码来源:DocumentTreeNodeFilterBase.cs


示例19: DecompileInternal

		void DecompileInternal(AssemblyDef asm, IDecompilerOutput output, DecompilationContext ctx) {
			this.WriteCommentLine(output, asm.ManifestModule.Location);
			if (asm.IsContentTypeWindowsRuntime)
				this.WriteCommentLine(output, asm.Name + " [WinRT]");
			else
				this.WriteCommentLine(output, asm.FullName);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:DecompilerBase.cs


示例20: GetImageReference

		public ImageReference GetImageReference(AssemblyDef assembly) {
			var mod = assembly.ManifestModule;
			return GetImageReference(mod != null ? mod.Characteristics : Characteristics.Dll);
		}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:4,代码来源:DotNetImageManager.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# AssemblyDefinitionDynamic类代码示例发布时间:2022-05-24
下一篇:
C# AssemblyCompiler类代码示例发布时间: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