通过 Reflector 反编译 ASP.NET 有多少成功?

发布于 2024-07-05 15:46:14 字数 245 浏览 7 评论 0原文

我刚刚完成了一个小项目,需要对预编译但不再受支持的 ASP.NET 网站进行更改。 代码很丑陋,但在编译之前就很丑陋,令我印象深刻的是,一切似乎仍然工作正常。

它需要一些编辑,例如删除控件声明,因为它们被放入生成的文件中,并与反编译的基类发生冲突,但几个小时后没有任何问题无法解决。

现在我只是好奇有多少其他人在这方面取得了多大成功。 我实际上想写一篇关于定义逆向工程过程(如果不是自动化的话)的 CodeProject 文章。

I just finished a small project where changes were required to a pre-compiled, but no longer supported, ASP.NET web site. The code was ugly, but it was ugly before it was even compiled, and I'm quite impressed that everything still seems to work fine.

It took some editing, e.g. to remove control declarations, as they get put in a generated file, and conflict with the decompiled base class, but nothing a few hours didn't cure.

Now I'm just curious as to how many others have had how much success doing this. I would actually like to write a CodeProject article on defining, if not automating, the reverse engineering process.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

記柔刀 2024-07-12 15:46:14

由于 .NET 平台中存在所有编译器糖,如果没有极其复杂的反编译器,您就无法将二进制文件反编译为原始代码。 例如,编译器在后台创建类来处理封装。 自动化这种事情似乎是一项艰巨的任务。 然而,处理预期的问题只是为了让它编译可能是可以编写脚本的。

Due to all the compiler sugar that exists in the .NET platform, you can't decompile a binary into the original code without extremely sophisticated decompilers. For instance, the compiler creates classes in the background to handle enclosures. Automating this kind of thing seems like it would be a daunting task. However, handling expected issues just to get it to compile might be scriptable.

避讳 2024-07-12 15:46:14

<块引用>

意愿:
由于 .NET 平台中存在所有编译器糖

幸运的是,这个特定的应用程序非常简单,但我不希望反编译为原始代码,只需反编译为像原始代码一样工作的代码,或者甚至可以提供有关如何反编译的见解原来的作品,允许“拼接”新代码。

Will:
Due to all the compiler sugar that exists in the .NET platform

Fortunately this particular application was incredibly simple, but I don't expect to decompile into the original code, just into code works like the original, or maybe even provides an insight into how the original works, to allow 'splicing' in of new code.

淡淡離愁欲言轉身 2024-07-12 15:46:14

我必须做类似的事情,而且我实际上比拥有代码更高兴。 我可能花费的时间更少,但是编译器优化后的代码质量可能比原始代码更好。 所以,是的,如果它是一个简单的应用程序,那么对其进行逆向工程就相对简单; 另一方面,我想避免将来不得不这样做。

i had to do something similar, and i was actually happier than if i had the code. it might have taken me less time to do it, but the quality of the code after the compiler optimized it was probably better than the original code. So yes, if its a simple application, is relatively simple to do reverse engineer it; on the other hand i would like to avoid having to do that in the future.

花心好男孩 2024-07-12 15:46:14

如果它是用 .NET 1.1 或 .NET 2.0 编写的,那么您将比使用 VS 2008 编译器编译的任何内容获得更大的成功,主要是因为新语言修订版引入的语法糖(Lambda、匿名类等) 。

只要代码没有被混淆,那么您应该能够使用反射器来获得可行的代码,如果您随后将其放入 VS,您应该立即在反射代码。

请注意以 <> 开头的变量/方法,我经常看到这种情况(特别是在反映 .NET 3.5 时)。

最糟糕的情况就是将其全部导出到 VS,点击编译并确定有多少错误,然后从中进行调用。

但如果它是一个足够简单的项目,您应该能够从反射器进行逆向工程,至少使用反射器来了解代码正在做什么的一般要点,然后自己重​​新编码。

If it was written in .NET 1.1 or .NET 2.0 you'll have a lot more success than anything compiled with the VS 2008 compilers, mainly because of the syntactic suger that the new language revisions brought in (Lambda, anonymous classes, etc).

As long as the code wasn't obfuscated then you should be able to use reflector to get viable code, if you then put it into VS you should immidiately find errors in the reflected code.

Be on the look out for variables/ method starting with <>, I see that a lot (particularly when reflecting .NET 3.5).

The worst you can do is export it all to VS, hit compile and determine how many errors there are and make a call from that.

But if it's a simple enough project you should be able to reverse engineer from reflector, at least use reflector to get the general gist of what the code is doing, and then recode yourself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文