如何反编译/编译dll文件?
我有一个用 C# 编写的应用程序。它已经编译好了。
那里有很多 dll 文件,我无法打开它们,反编译它们无法查看和访问构建它们的 C# 代码,当我在 Visual Studio 中添加对 dll 文件的引用时,我只能看到那里有哪些方法,但看不到/ 这些方法的访问代码。
是否有工具或有方法如何查看/访问该代码、修改它然后重新编译它?
如果您有想法,请帮帮我!
谢谢
I have an app written in C#. It was already compiled.
There are plenty of dll files there and i could not open them , decompile them cannot see and access C# code which build them, when i add a reference to dll files in Visual Studio i only can see what methods are there, but i cannot see / access code of those methods.
Is there a tool or is there a way how to see / access that code , modify it and then recompile it ?
Please if you have an idea give me a hand !
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是通过 Reflector - 它并不完美,但会给你一个好主意。
它允许选择一个程序集并以 IL、vb.net 或 C# 显示它。您可以将结果复制/粘贴到 Visual Studio 中,并使用您的更改进行编译。
因为它适用于原始优化的 IL,所以像
foreach
循环这样的东西可能最终成为标签和 goto,而变量名称可能最终成为无效的 C#/vb.net 变量名称(尽管它们是有效的 IL)。我过去曾使用过它,最大的问题是重建 foreach 循环,尽管在几次循环之后该模式变得明显,并且可以通过搜索/替换来更改变量名称。
The easiest way to do this is through Reflector - it is not perfect, but will give you a good idea.
It lets select an assembly and display it in either IL, vb.net or C#. You can copy/paste the result into Visual Studio and compile it with your changes.
Because it works on the raw optimized IL, things like
foreach
loops can end up as labels and gotos and variables names can end up as invalid C#/vb.net variables names (though they are valid IL).I have used it in the past, and the biggest issue is in reconstructing
foreach
loops, though the pattern becomes apparent after several of those, and the variable names can be changed with a search/replace.