如何使ILspy c#反编译结果具有更好的格式



ILspy是一个很棒的工具,但当我使用它来反编译dll时,我会得到这样的结果:

this.lastOrientation = base.get_Orientation();

但它应该是这样的:

this.lastOrientation = base.Orientation;

我怎样才能得到更好的结果?

更多这样的例子:

应为:

battery_logo.Visibility = System.Windows.Visibility.Visible;

但我们得到的是:

battery_logo.set_Visibility(System.Windows.Visibility.Visible);

当我们构建时会出现错误,如:

'System.Windows.UIElement.Visibility.set': cannot explicitly call operator or accessor

这里有一个错误报告:https://github.com/icsharpcode/ILSpy/issues/380

有人写道:

事实证明,这个问题与缺少依赖程序集和基类型有关。我再也看不到这个问题了。不过,我在一些混淆的代码上遇到了障碍,不确定你是否有兴趣帮助我解决这个问题,但我非常感谢你的帮助。

你说你正在为Windows Phone反编译一个应用程序。您可以尝试在ILSpy 中加载Windows Phone的引用程序集

ILspy是一个了不起的工具,但当我使用它反编译dll时,我有结果如下:

this.lastOrientation = base.get_Orientation();

但它应该是这样的:

this.lastOrientation = base.Orientation;

CCD_ 1可能是一个属性,而c#中的属性实际上是一种语法糖,它们在内部简单地翻译为getter&setter方法——这就是为什么你看到反编译的代码,就好像它是对一个方法的调用和对一个正则属性的读取一样。

最新更新