有没有什么软件可以做到这一点?我在互联网上没有找到任何有用的信息,所以我在这里问。
10 回答
你不能得到确切的代码,但你可以得到它的反编译版本。
最受欢迎(也是最好的)工具是Reflector,但也有其他 .Net 反编译器(例如Dis#)。您还可以使用与 .Net Framework SDK 工具捆绑在一起的ILDASM对 IL 进行反编译。
只有托管语言c#
和Java
可以完全反编译。您可以查看完整的源代码。因为Win32 dll
您无法获取源代码。
对于 CSharp dll 使用DotPeek因为它是免费的,并且与ReDgate .Net 编译器一样工作
玩得开心。
使用.NET 反射器。
使用折射镜。从这里下载。
- 安装后打开软件。
- 按 Ctrl + O 并选择您的 DLL 文件。
- Dll 将显示在左窗格中。
- 右键单击 Dll 并选择导出源代码。
- 选择要导出文件的文件夹
- 稍等片刻,可能需要 2-3 分钟
您可以使用Reflector也可以使用Add-In FileGenerator将源代码提取到项目中。
可以使用dotPeek
唯一要说的是,使用的时候,右键选择类Decompiled Source
而不是双击,否则dotpeek只会显示本地cs文件的内容,不会显示反编译后的内容。
如果您只想了解 dll 程序集中的一些基础知识,例如类、方法等,请动态加载它们
你可以使用微软提供的 IL Disassembler 工具。
一般位于:“C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin”
我使用Refractor从 dll 文件中恢复我的脚本/代码。
public async void Decompile(string DllName)
{
string destinationfilename = "";
if (System.IO.File.Exists(DllName))
{
destinationfilename = (@helperRoot + System.IO.Path.GetFileName(medRuleBook.Schemapath)).ToLower();
if (System.IO.File.Exists(destinationfilename))
{
System.IO.File.Delete(destinationfilename);
}
System.IO.File.Copy(DllName, @destinationfilename);
}
// use dll-> XSD
var returnVal = await DoProcess(
@helperRoot + "xsd.exe", "\"" + @destinationfilename + "\"");
destinationfilename = destinationfilename.Replace(".dll", ".xsd");
if (System.IO.File.Exists(@destinationfilename))
{
// now use XSD
returnVal =
await DoProcess(
@helperRoot + "xsd.exe", "/c /namespace:RuleBook /language:CS " + "\"" + @destinationfilename + "\"");
if (System.IO.File.Exists(@destinationfilename.Replace(".xsd", ".cs")))
{
string getXSD = System.IO.File.ReadAllText(@destinationfilename.Replace(".xsd", ".cs"));
}
}
}