C# 如何打开.dll文件看看里面写了什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18050615/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to open .dll files to see what is written inside?
提问by HaDe
I lost the solution of class-library, can I open .dllfile which is created by class-library.
我丢失了类库的解决方案,我可以打开.dll由class-library.
采纳答案by Peter Kellner
you are better off with a decompiler like redgates .net reflector or jetbrains resharper decompiler. there are open source ones also like
你最好使用像 redgates .net 反射器或 jetbrains resharper 反编译器这样的反编译器。有开源的也喜欢
http://www.jetbrains.com/decompiler/
回答by vusan
Open .dllfile with visual studio. Or resource editor.
.dll使用 Visual Studio打开文件。或者资源编辑器。
回答by Rohit
You cannot get the exact code, but you can get a decompiled version of it.
您无法获得确切的代码,但您可以获得它的反编译版本。
The most popular (and best) tool is Reflector, but there are also other .Net decompilers (such as Dis#).
最流行(也是最好的)工具是Reflector,但也有其他 .Net 反编译器(例如Dis#)。
You can also decompile the IL using ILDASM, which comes bundled with the .Net Framework SDK Tools.
回答by backtrack
I think you have downloaded the .NET Reflector & this FileGenerator plugin http://filegenreflector.codeplex.com/, If you do,
我想你已经下载了 .NET Reflector 和这个 FileGenerator 插件http://filegenreflector.codeplex.com/,如果你这样做了,
Open up the Reflector.exe,
Go to View and click Add-Ins,
In the Add-Ins window click Add...,
Then find the dll you have downloaded
FileGenerator.dll (witch came wth the FileGenerator plugin),
Then close the Add-Ins window.
Go to File and click Open and choose the dll that you want to decompile,
After you have opend it, it will appear in the tree view,
Go to Tools and click Generate Files(Crtl+Shift+G),
select the output directory and select appropriate settings as your wish, Click generate files.
打开Reflector.exe,
转到查看并单击加载项,
在加载项窗口中单击添加...,
然后找到你下载的dll
FileGenerator.dll(女巫来自 FileGenerator 插件),
然后关闭加载项窗口。
转到文件并单击打开并选择要反编译的dll,
打开后,它会出现在树视图中,
转到工具并单击生成文件(Crtl+Shift+G),
选择输出目录并根据需要选择适当的设置,单击生成文件。
OR
或者
回答by david
*.dll files are archive files open with winzip/7zip etc. That isnt to say that all .dll files are archives you can save anything with the .dll extension however most windows .dll files are generated to be archives examples of this are windows>twain_32.dll which is an archive file however twain.dll is not if you look at twain.dll you will see an MZ? as the first three notepad characters which denotes a Compiled C file/program or part of a program. Whereas MZ seems to be an archive.
*.dll 文件是使用 winzip/7zip 等打开的存档文件。这并不是说所有 .dll 文件都是存档,您可以使用 .dll 扩展名保存任何内容,但是大多数 windows .dll 文件生成为存档,例如 windows >twain_32.dll 这是一个存档文件但是 twain.dll 不是如果你查看 twain.dll 你会看到一个 MZ 吗?作为前三个记事本字符,表示已编译的 C 文件/程序或程序的一部分。而 MZ 似乎是一个档案。
Also most .exe files are archives mostly containing an icon image etc for the file and the windows installer packages as well they contain all the information the program needs to run images,movies etc and also directories including installation information and plain text file.
此外,大多数 .exe 文件是存档,主要包含文件和 Windows 安装程序包的图标图像等,它们还包含程序运行图像、电影等所需的所有信息,以及包括安装信息和纯文本文件的目录。
I have a game here game.exe and it contains java class files an image a pointer directing the .exe to run a .bat file. Obviously your .bat file will run a javac call from the archive and run the game there is also a few .dll archives containing java class files also.
我在这里有一个游戏 game.exe,它包含 java 类文件、一个图像、一个指示 .exe 运行 .bat 文件的指针。显然,您的 .bat 文件将从存档中运行 javac 调用并运行游戏,还有一些 .dll 存档也包含 java 类文件。
[autorun]
ICON=AUTORUN\MINCRAFTLOGO.ICO
standard icon redirect here .ico is an image file within a .dll file within a .exe file. So the image seen on the .exe file is the minecraft logo. This is in a file called autorun.inf. Second example
此处的标准图标重定向 .ico 是 .exe 文件中的 .dll 文件中的图像文件。所以在 .exe 文件上看到的图像是 minecraft 标志。这是在一个名为 autorun.inf 的文件中。第二个例子
[discstarter]
startpage=Autostart\Disk1.html
uselanguagestartpage=1
windowcaption=Solid Edge
licensee=Siemens PLM Software
productguid=05B227DF-DB00-4934-B3C8-40B7D8FAA54A
singleinstance=1
hidesplashscreen=1
noscrollbars=0
showstatusbar=1
splashscreentime=0
windowwidth=750
windowheight=775
buttondir=Autostart
toolbarcolor=16777215
toolbar=goback,goforward,gohome,print,exit
[autorun]
open=autostart.exe
icon=Autostart\ENGINE.ICO
This is the solid edge autorun.inf file contained in solidedge.exe Autostart\ is the Autostart.dll directory. open=autostart.exe specifies the autostart.exe file to run from within the original solidedge.exe archive. Here is a sample program using the .dll (dynamic link library) files http://www.flipcode.com/archives/Creating_And_Using_DLLs.shtml.
这是solidedge.exe 中包含的solid edge autorun.inf 文件。 Autostart\ 是Autostart.dll 目录。open=autostart.exe 指定要从原始solidedge.exe 存档中运行的autostart.exe 文件。这是一个使用 .dll(动态链接库)文件http://www.flipcode.com/archives/Creating_And_Using_DLLs.shtml的示例程序。
It also shows how they are created. As you can see the contents of the dll file is called by an exe file as I previously explained also there is a tutorial here http://msdn.microsoft.com/en-us/library/ms235636.aspxand as i said before 7zip or winzip will open a dynamic link library as an archive as long as you have the .dll file. If the contents of the dynamic link library have been compiled obviously you need a program which can read the file.
它还显示了它们是如何创建的。正如您所看到的,dll 文件的内容由一个 exe 文件调用,正如我之前所解释的,这里还有一个教程http://msdn.microsoft.com/en-us/library/ms235636.aspx,正如我之前所说只要您有 .dll 文件,7zip 或 winzip 就会将动态链接库作为存档打开。如果动态链接库的内容显然已经被编译,你需要一个可以读取文件的程序。
However since .dll files are by definition just archive library files the dll itself should be readable and not a compiled C,C# file etc etc Basically .dll files are archives well should be when a .dll file is created in visual studio the dll is created and any information you store in the dll file is encrypted. Mostly this encryption is handled by visual studio itself and generally isn't edited by hand. When you read a .dll file contents as a .exe the contents are automatically decrypted. Now when we talk about compiling a program we are changing the contents into bytecode the machine easily interprets.
但是,由于 .dll 文件根据定义只是存档库文件,因此 dll 本身应该是可读的,而不是编译后的 C、C# 文件等 基本上 .dll 文件应该很好地存档,当在 Visual Studio 中创建 .dll 文件时,dll 是创建并加密您存储在 dll 文件中的任何信息。大多数情况下,这种加密是由 Visual Studio 本身处理的,通常不是手工编辑的。当您将 .dll 文件内容作为 .exe 读取时,内容会自动解密。现在,当我们谈论编译程序时,我们将内容更改为机器易于解释的字节码。
This filesize would be smaller than the original file of the same contents. However the filesize is larger suggesting that the file has actually been encrypted. Probably to stop people reading their code. As a result the reading of .dll contents is termed decryption and not decompilation. Decompilation would convert the already compiled txt files to unreadable byte code. The use of standard .dll files is by definition not opensource because it involves the deliberate obfuscation of byte code.
此文件大小将小于相同内容的原始文件。但是文件大小较大表明该文件实际上已被加密。可能是为了阻止人们阅读他们的代码。因此,.dll 内容的读取被称为解密而不是反编译。反编译会将已编译的 txt 文件转换为不可读的字节码。根据定义,标准 .dll 文件的使用不是开源的,因为它涉及对字节码的故意混淆。
回答by Abhi
Follow below steps..
按照以下步骤..
- Go to Start Menu.
- Type Visual Studio Tool.
- Go to the folder above.
- Click on "Developer Command Prompt for VS 2013" in the case of VS 2013 or just "Visual Studio Command Prompt " in case of VS 2010.
- After command prompt loaded to screen type
ILDASM.EXEpress ENTER. ILDASMwindow will open.Drag the.dllfile to window from your folder.Or click onFile->New.Then Add required.dllfile.- After above steps Mainfest and
.dllfile will appear. Double click on these files to see what it contains.
- 转到开始菜单。
- 键入 Visual Studio 工具。
- 转到上面的文件夹。
- 在 VS 2013 的情况下单击“VS 2013 的开发人员命令提示符”,或者在 VS 2010 的情况下单击“Visual Studio 命令提示符”。
- 命令提示符加载到屏幕类型后,
ILDASM.EXE按 ENTER。 ILDASM窗口将打开。将.dll文件从您的文件夹拖到窗口。或单击。File->New然后添加所需.dll文件。- 完成上述步骤后,Mainfest 和
.dll文件将出现。双击这些文件以查看其中包含的内容。
回答by Eric
Telerik's Just Decompile is the best I've used. It's free once you sign up with an email.
Telerik 的 Just Decompile 是我用过的最好的。使用电子邮件注册后即可免费使用。
回答by user13570405
I use the Jetbrains Dot peek Software , you can try that too
我用的是 Jetbrains Dot peek 软件,你也可以试试

