Reputation: 1425
I lost the solution of a class library. Can I open the DLL file which is created by the class library?
Upvotes: 133
Views: 1032496
Reputation: 1
*.dll files are archive files opened with WinZip, 7-Zip, etc. That isn’t 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.
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 files.
I have a game here, game.exe, and it contains Java class files and 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 are also a few .dll archives containing Java class files.
[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
[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: Creating And Using DLLs.
It also shows how they are created. As you can see, the contents of the DLL file file is called by an EXE file file as I previously explained. Also there is a tutorial here Walkthrough: Create and use your own Dynamic Link Library (C++), and, as I said before, 7-Zip 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.
However, since .dll files are by definition just archive library files, the DLL file itself should be readable and not a compiled C or C# file, etc., etc. Basically, .dll files are archives. Well, they should be when a .dll file is created in Visual Studio. The DLL file is created and any information you store in the DLL file 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.
This file size would be smaller than the original file of the same contents. However, the filesize is larger, suggesting that the file has actually been encrypted. It is 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 open source, because it involves the deliberate obfuscation of byte code.
Upvotes: -15
Reputation: 8078
Telerik's Just Decompile is the best I've used. It's free once you sign up with an email.
Upvotes: 1
Reputation: 875
Follow the below steps...
ILDASM.EXE
press ENTER..dll
file to the window from your folder. Or click on menu File → New. Then add the required .dll
file..dll
file will appear. Double click on those files to see what they contain.Upvotes: 64
Reputation: 15478
You are better off with a decompiler like Redgate's .NET Reflector or JetBrains' ReSharper decompiler.
There are open source ones also, like:
Upvotes: 160
Reputation: 10226
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#).
You can also decompile the CIL using ILDASM, which comes bundled with the .NET Framework SDK tools.
Upvotes: 6
Reputation: 8144
I think you have downloaded the .NET Reflector & this FileGenerator plugin http://filegenreflector.codeplex.com/ , If you do,
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.
OR
Upvotes: 11