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

C# IDecompiler类代码示例

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

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



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

示例1: Decompile

		void Decompile(ModuleDef module, BamlDocument document, IDecompiler lang,
			IDecompilerOutput output, CancellationToken token) {
			var decompiler = new XamlDecompiler();
			var xaml = decompiler.Decompile(module, document, token, BamlDecompilerOptions.Create(lang), null);
			var xamlText = new XamlOutputCreator(xamlOutputOptionsProvider.Default).CreateText(xaml);
			documentWriterService.Write(output, xamlText, ContentTypes.Xaml);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:BamlResourceElementNode.cs


示例2: Rewrite

        public override bool Rewrite(CodeDescriptor decompilee, MethodBase callee, StackElement[] args, IDecompiler stack, IFunctionBuilder builder)
        {
            if (args[0].Variability == Msil.EVariability.ExternVariable)
                throw new NotSupportedException("Delegate calls must have constant target!");

            Delegate deleg = (Delegate)args[0].Sample;
            if (deleg == null)
                return false;

            StackElement[] callArgs;
            if (deleg.Method.IsStatic)
            {
                callArgs = new StackElement[args.Length - 1];
                Array.Copy(args, 1, callArgs, 0, args.Length - 1);
            }
            else
            {
                callArgs = new StackElement[args.Length];
                Array.Copy(args, callArgs, args.Length);
                callArgs[0].Sample = deleg.Target;
                callArgs[0].Expr = LiteralReference.CreateConstant(deleg.Target);
                callArgs[0].Variability = Msil.EVariability.Constant;
            }
            stack.ImplementCall(deleg.Method, callArgs);
            return true;
        }
开发者ID:venusdharan,项目名称:systemsharp,代码行数:26,代码来源:ResolveDelegateCalls.cs


示例3: Setup

		public void Setup()
		{
            mr = new MockRepository();
            form = new MainForm();
            sc = new ServiceContainer();
            loader = mr.StrictMock<ILoader>();
            dec = mr.StrictMock<IDecompiler>();
            sc = new ServiceContainer();
            uiSvc = new FakeShellUiService();
            host = mr.StrictMock<DecompilerHost>();
            memSvc = mr.StrictMock<ILowLevelViewService>();
            var image = new LoadedImage(Address.Ptr32(0x10000), new byte[1000]);
            var imageMap = image.CreateImageMap();
            var arch = mr.StrictMock<IProcessorArchitecture>();
            arch.Stub(a => a.CreateRegisterBitset()).Return(new BitSet(32));
            arch.Replay();
            var platform = mr.StrictMock<Platform>(null, arch);
            arch.BackToRecord();
            program = new Program(image, imageMap, arch, platform);
            project = new Project { Programs = { program } };

            browserSvc = mr.StrictMock<IProjectBrowserService>();

            sc.AddService<IDecompilerUIService>(uiSvc);
            sc.AddService(typeof(IDecompilerShellUiService), uiSvc);
            sc.AddService(typeof(IDecompilerService), new DecompilerService());
            sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService());
            sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
            sc.AddService(typeof(IProjectBrowserService), browserSvc);
            sc.AddService(typeof(ILowLevelViewService), memSvc);
            sc.AddService<ILoader>(loader);

            i = new TestInitialPageInteractor(sc, dec);

		}
开发者ID:gh0std4ncer,项目名称:reko,代码行数:35,代码来源:InitialPageInteractorTests.cs


示例4: Setup

		public void Setup()
		{
            mr = new MockRepository();
            form = new MainForm();
            sc = new ServiceContainer();
            loader = mr.StrictMock<ILoader>();
            dec = mr.StrictMock<IDecompiler>();
            sc = new ServiceContainer();
            uiSvc = new FakeShellUiService();
            host = mr.StrictMock<DecompilerHost>();
            memSvc = mr.StrictMock<ILowLevelViewService>();
            var mem = new MemoryArea(Address.Ptr32(0x10000), new byte[1000]);
            var imageMap = new SegmentMap(
                mem.BaseAddress,
                new ImageSegment("code", mem, AccessMode.ReadWriteExecute));
            var arch = mr.StrictMock<IProcessorArchitecture>();
            var platform = mr.StrictMock<IPlatform>();
            program = new Program(imageMap, arch, platform);
            project = new Project { Programs = { program } };

            browserSvc = mr.StrictMock<IProjectBrowserService>();

            sc.AddService<IDecompilerUIService>(uiSvc);
            sc.AddService(typeof(IDecompilerShellUiService), uiSvc);
            sc.AddService(typeof(IDecompilerService), new DecompilerService());
            sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService());
            sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
            sc.AddService(typeof(IProjectBrowserService), browserSvc);
            sc.AddService(typeof(ILowLevelViewService), memSvc);
            sc.AddService<ILoader>(loader);
            sc.AddService<DecompilerHost>(host);

            i = new TestInitialPageInteractor(sc, dec);

		}
开发者ID:relaxar,项目名称:reko,代码行数:35,代码来源:InitialPageInteractorTests.cs


示例5: WriteCore

		protected override void WriteCore(ITextColorWriter output, IDecompiler decompiler, DocumentNodeWriteOptions options) {
			var tdr = TryGetTypeDefOrRef();
			if (tdr == null)
				output.Write(BoxedTextColor.Error, "???");
			else
				new NodePrinter().Write(output, decompiler, tdr, GetShowToken(options));
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:BaseTypeNodeImpl.cs


示例6: IsSupportedLanguage

		bool IsSupportedLanguage(IDecompiler decompiler, CompilationKind kind) {
			if (decompiler == null)
				return false;

			switch (kind) {
			case CompilationKind.Assembly:
				if (!decompiler.CanDecompile(DecompilationType.AssemblyInfo))
					return false;
				break;

			case CompilationKind.Method:
			case CompilationKind.EditClass:
				if (!decompiler.CanDecompile(DecompilationType.TypeMethods))
					return false;
				break;

			case CompilationKind.AddClass:
				break;

			default:
				throw new ArgumentOutOfRangeException(nameof(kind));
			}

			return languageCompilerProviders.Any(a => a.Language == decompiler.GenericGuid);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:25,代码来源:EditCodeVMCreator.cs


示例7: CalculateLanguageGuid

		static Guid CalculateLanguageGuid(IDecompiler decompiler) {
			if (decompiler.GenericGuid == DecompilerConstants.LANGUAGE_VISUALBASIC)
				return new Guid("F184B08F-C81C-45F6-A57F-5ABD9991F28F");

			Debug.Assert(decompiler.GenericGuid == DecompilerConstants.LANGUAGE_CSHARP);
			return new Guid("FAE04EC0-301F-11D3-BF4B-00C04F79EFBC");
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:Project.cs


示例8: Write

		/// <summary>
		/// Writes a file
		/// </summary>
		/// <param name="output">Output</param>
		/// <param name="decompiler">Decompiler</param>
		/// <param name="document">Document</param>
		public void Write(ITextColorWriter output, IDecompiler decompiler, IDsDocument document) {
			var filename = GetFilename(document);
			var peImage = document.PEImage;
			if (peImage != null)
				output.Write(IsExe(peImage) ? BoxedTextColor.AssemblyExe : BoxedTextColor.Assembly, NameUtilities.CleanName(filename));
			else
				output.Write(BoxedTextColor.Text, NameUtilities.CleanName(filename));
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:14,代码来源:NodePrinter.cs


示例9: NodeDecompiler

		public NodeDecompiler(Func<Func<object>, object> execInThread, IDecompilerOutput output, IDecompiler decompiler, DecompilationContext decompilationContext, IDecompileNodeContext decompileNodeContext = null) {
			this.execInThread = execInThread;
			this.output = output;
			this.decompiler = decompiler;
			this.decompilationContext = decompilationContext;
			this.decompileNodeContext = decompileNodeContext;
			this.decompileNodeContext.ContentTypeString = decompiler.ContentTypeString;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:NodeDecompiler.cs


示例10: AppBamlResourceProjectFile

		public AppBamlResourceProjectFile(string filename, TypeDef type, IDecompiler decompiler) {
			Filename = filename;
			this.type = type;
			SubType = "Designer";
			Generator = "MSBuild:Compile";
			BuildAction = DotNetUtils.IsStartUpClass(type) ? BuildAction.ApplicationDefinition : BuildAction.Page;
			this.decompiler = decompiler;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:BamlResourceProjectFile.cs


示例11: DecompileFields

		protected virtual void DecompileFields(IDecompiler decompiler, IDecompilerOutput output) {
			foreach (var vm in HexVMs) {
				decompiler.WriteCommentLine(output, string.Empty);
				decompiler.WriteCommentLine(output, string.Format("{0}:", vm.Name));
				foreach (var field in vm.HexFields)
					decompiler.WriteCommentLine(output, string.Format("{0:X8} - {1:X8} {2} = {3}", field.Span.Start.ToUInt64(), field.Span.End.ToUInt64() - 1, field.FormattedValue, field.Name));
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:HexNode.cs


示例12: NodeTabSaver

		NodeTabSaver(IMessageBoxService messageBoxService, IDocumentTab tab, IDocumentTreeNodeDecompiler documentTreeNodeDecompiler, IDecompiler decompiler, IDocumentViewer documentViewer, DocumentTreeNodeData[] nodes) {
			this.messageBoxService = messageBoxService;
			this.tab = tab;
			this.documentTreeNodeDecompiler = documentTreeNodeDecompiler;
			this.decompiler = decompiler;
			this.documentViewer = documentViewer;
			this.nodes = nodes;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:NodeTabSaver.cs


示例13: EditClassVM

		public EditClassVM(IRawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, IMemberDef defToEdit, IList<MethodSourceStatement> statementsInMethodToEdit)
			: base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, defToEdit.Module) {
			this.defToEdit = defToEdit;
			nonNestedTypeToEdit = defToEdit as TypeDef ?? defToEdit.DeclaringType;
			while (nonNestedTypeToEdit.DeclaringType != null)
				nonNestedTypeToEdit = nonNestedTypeToEdit.DeclaringType;
			methodSourceStatement = statementsInMethodToEdit.Count == 0 ? (MethodSourceStatement?)null : statementsInMethodToEdit[0];
			StartDecompile();
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:EditClassVM.cs


示例14: WriteShort

		public override void WriteShort(IDecompilerOutput output, IDecompiler decompiler, bool showOffset) {
			base.WriteShort(output, decompiler, showOffset);
			var documentViewerOutput = output as IDocumentViewerOutput;
			if (documentViewerOutput != null) {
				documentViewerOutput.AddButton(dnSpy_Resources.SaveResourceButton, () => Save());
				documentViewerOutput.WriteLine();
				documentViewerOutput.WriteLine();
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:UnknownResourceNodeImpl.cs


示例15: WriteCore

		protected override void WriteCore(ITextColorWriter output, IDecompiler decompiler, DocumentNodeWriteOptions options) {
			if ((options & DocumentNodeWriteOptions.ToolTip) == 0)
				new NodePrinter().Write(output, decompiler, Document);
			else {
				output.Write(BoxedTextColor.Text, TargetFrameworkUtils.GetArchString(Document.PEImage.ImageNTHeaders.FileHeader.Machine));

				output.WriteLine();
				output.WriteFilename(Document.Filename);
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:PEDocumentNodeImpl.cs


示例16: Write

		protected override void Write(ITextColorWriter output, IDecompiler decompiler) {
			if (hidesParent) {
				output.Write(BoxedTextColor.Punctuation, "(");
				output.Write(BoxedTextColor.Text, dnSpy_Analyzer_Resources.HidesParent);
				output.Write(BoxedTextColor.Punctuation, ")");
				output.WriteSpace();
			}
			decompiler.WriteType(output, analyzedProperty.DeclaringType, true);
			output.Write(BoxedTextColor.Operator, ".");
			new NodePrinter().Write(output, decompiler, analyzedProperty, Context.ShowToken, null);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:11,代码来源:PropertyNode.cs


示例17: Rewrite

        public override bool Rewrite(CodeDescriptor decompilee, MethodBase callee, StackElement[] args, IDecompiler stack, IFunctionBuilder builder)
        {
            var side = args[0].Sample as IXilinxBlockMemSide;
            if (side == null)
                return false;

            var code = IntrinsicFunctions.XILOpCode(
                DefaultInstructionSet.Instance.WrMem(side),
                typeof(void));
            builder.Call(code.Callee, args[1].Expr, args[2].Expr);
            return true;
        }
开发者ID:venusdharan,项目名称:systemsharp,代码行数:12,代码来源:XilinxBlockMem.cs


示例18: WriteShort

		public override void WriteShort(IDecompilerOutput output, IDecompiler decompiler, bool showOffset) {
			var documentViewerOutput = output as IDocumentViewerOutput;
			if (documentViewerOutput != null) {
				documentViewerOutput.AddUIElement(() => {
					return new System.Windows.Controls.Image {
						Source = ImageSource,
					};
				});
			}

			base.WriteShort(output, decompiler, showOffset);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:12,代码来源:SerializedImageResourceElementNode.cs


示例19: DecompileFields

		protected override void DecompileFields(IDecompiler decompiler, IDecompilerOutput output) {
			decompiler.WriteCommentLine(output, string.Empty);
			decompiler.WriteCommentBegin(output, true);
			WriteHeader(output);
			decompiler.WriteCommentEnd(output, true);
			output.WriteLine();

			for (int i = 0; i < (int)MetaDataTableVM.Rows; i++) {
				var obj = MetaDataTableVM.Get(i);
				decompiler.WriteCommentBegin(output, true);
				Write(output, obj);
				decompiler.WriteCommentEnd(output, true);
				output.WriteLine();
			}
		}
开发者ID:0xd4d,项目名称:dnSpy,代码行数:15,代码来源:MetaDataTableNode.cs


示例20: ProjectModuleOptions

		public ProjectModuleOptions(ModuleDef module, IDecompiler decompiler, DecompilationContext decompilationContext) {
			if (decompiler == null)
				throw new ArgumentNullException(nameof(decompiler));
			if (decompilationContext == null)
				throw new ArgumentNullException(nameof(decompilationContext));
			if (module == null)
				throw new ArgumentNullException(nameof(module));
			Module = module;
			Decompiler = decompiler;
			DecompilationContext = decompilationContext;
			ProjectGuid = Guid.NewGuid();
			UnpackResources = true;
			CreateResX = true;
			DecompileXaml = true;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:15,代码来源:ProjectModuleOptions.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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