如何从DLL文件中提取类的源代码?
-
11-10-2019 - |
题
有什么软件可以执行此操作吗?我在互联网上没有找到任何有用的信息,所以我在这里问。
其他提示
仅托管语言 c#
和 Java
可以完全分解。您可以查看完整的源代码。为了 Win32 dll
您无法获得源代码。
对于CSHARP DLL利用 dotpeek 它是免费的,与 Redgate .NET编译器
玩得开心。
利用 .NET反射器.
您可以使用 反射器 并使用 加入 FileGenerator 将源代码提取到项目中。
使用折射器。从 这里.
- 安装后打开软件。
- 按CTRL + O,然后选择您的DLL文件。
- DLL将显示在左窗格中。
- 右键单击DLL,然后选择“导出源代码”。
- 选择要导出文件的文件夹
- 等待一会儿可能需要2-3分钟
如果您只想知道DLL组件中的一些基础知识,例如类别,方法等
您可以使用Microsoft提供的IL拆卸器工具。
通常位于:“ C: Program Files(X86) Microsoft SDKS Windows v7.0a bin”
我用了 折射剂 从DLL文件中恢复我的脚本/代码。
var destinationfilename = "";
if (System.IO.File.Exists("nameoffile.dll"))
{
destinationfilename = (@helperRoot + System.IO.Path.GetFileName(medRuleBook.Schemapath)).ToLower();
if (System.IO.File.Exists(destinationfilename)) System.IO.File.Delete(destinationfilename);
System.IO.File.Copy(@'nameoffile.dll", @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")))
{
var getXSD = System.IO.File.ReadAllText(@destinationfilename.Replace(".xsd", ".cs"));
}
}
不隶属于 StackOverflow