是否有任何C#反编译器都能显示与编写代码几乎相同的代码? [英] Is there any C# decompiler that can show the coding almost identically to how it was written?

查看:153
本文介绍了是否有任何C#反编译器都能显示与编写代码几乎相同的代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用反射器反编译几个简单的c#应用程序,但是我注意到尽管代码正在反编译,但是我仍然看不到它们是在VS上编写的。我认为这就是编译器用机器代码代替人工指令的方式。但是我想我可以尝试一下,在这里询问。也许有一个反编译器可以反编译并显示与原始代码几乎相同的代码。

I've been using reflector to decompile a couple simple c# apps but I notice that though code is being decompiled, I still can't see things as they were written on VS. I think this is the way it is as the compiler replaces human instructions by machine code. However I thought I would give it a try and ask it on here. Maybe there is a decompiler that can decompile and show the coding almost identically to the original code.

推荐答案

有很多方法可以从不同的代码获得相同的IL。例如,没有办法知道扩展方法是在声明类型上称为流利样式还是显式。无法知道是否使用了LINQ vs常规代码。隐式操作的所有方式可能存在或可能不存在。删除的代码可能存在或未曾存在过。一旦成为IL,许多原始(包括枚举)最多4个字节就无法区分。

That is impossible, since there are lots of ways to get the same IL from different code. For example, there is no way to know if an extension method was called fluent-style vs explicit on the declaring type. There is no way to know if LINQ vs regular code was used. All manner of implicit operations may or may not be there. Removed code may or may not have been there. Many primitives (including enums) up-to-and-including 4 bytes are indistinguishable once they are IL.

如果您想要实际的代码,请合法地获取原始代码。

If you want the actual code, legally obtain the original code.

这篇关于是否有任何C#反编译器都能显示与编写代码几乎相同的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆