Download ArticleDownload Article

Dynamic Link Library (DLL) files aren't average text files that can be opened in an editor—they contain compiled code and objects that Windows programs reference during use. If you want to see or edit the code that makes a DLL file work, you can easily do so using a decompiler. We'll show you how to use a dotPeek decompiler to open a DLL file, and how to register a DLL for a new program.

Method 1
Method 1 of 2:

Using DLL Files

Download Article
  1. How.com.vn English: Step 1 Understand what a DLL file is.
    A DLL (dynamic link library) is a Windows file that is used by program to call upon existing functions. Essentially, they allow Windows and other programs to gain functionality without having to have that functionality built-in.[1]
    • DLL files are an essential part of Windows programming, and lead to sleeker, more efficient programs.
  2. How.com.vn English: Step 2 Know that the...
    Know that the average user doesn't need to open or interact with DLL files. For most users, DLL files will exist in the background.[2] Programs will install and call upon them automatically, and moving them can cause serious problems with the system.
    • Sometimes you may be asked during the installation of community-made programs to place DLL files in specific locations. Make sure that you trust the program before following these instructions, as DLL files can be malicious.
    • If you're interested in learning how DLL files are constructed, see the next section.
    Advertisement
  3. How.com.vn English: Step 3 Register a new...
    Register a new DLL. If you have had to manually copy a DLL file into a folder for a program to use, you may need to register it in the Windows Registry before it can be used. Refer to the program's documentation to determine if you'll need to perform this step (it is extremely uncommon for most Windows programs).[3]
    • Open the Command Prompt. You can find this in the Start menu or by pressing the Windows key + R and typing cmd. Navigate to the location of the new DLL file.
    • If you are using Windows 7 or newer, open the folder containing the new DLL file, hold the Shift key and right-click in the folder, and select "Open command window here". The Command Prompt will open directly to that folder.
    • Type regsvr32 dllname.dll and press Enter. This will add the DLL file to Windows Registry.[4]
    • Type regsvr32 -u dllname.dll to remove the DLL file from the Windows Registry.
  4. Advertisement
Method 2
Method 2 of 2:

Decompiling DLL Files

Download Article
  1. How.com.vn English: Step 1 Download and install a decompiler.
    A "decompiler" is a program that allows you to see the source code that was used to construct a file or program, in this case a DLL file. In order to see the code that makes a DLL file work, you will need to use a decompiler to revert it back into readable code. Opening a DLL file without a decompiler (such as opening it with Notepad) will result in a jumbled mess of unreadable characters.
    • dotPeek is one of the more popular free decompilers. It is available from jetbrains.com/decompiler/.
  2. How.com.vn English: Step 2 Open the DLL file in your decompiler.
    If you're using dotPeek, simply click "File" → "Open" and then browse for the DLL file you want to decompile. You can explore the contents of the DLL file without affecting your system.[5]
  3. Step 3 Use the "Assembly Explorer" to browse the nodes of the DLL file.
    DLL files are made of "nodes", or modules of code that work together to form the entire DLL file. You can expand each node to see any subnodes that it may contain.
  4. How.com.vn English: Step 4 Double-click a node to see the code for it.
    The code for the node you select will appear in the right frame of dotPeek. You can scroll through the code to review it. dotPeek will display the code in C#, or it can download additional libraries in order for you to view the original source code.
    • If the node requires additional libraries to view, dotPeek will attempt to download them automatically.
  5. How.com.vn English: Step 5 Get clarification for different pieces of the code.
    If you've found a piece of code you don't understand, you can use the Quick Documentation feature to see what the command is doing.
    • Place your cursor in the piece of code that you need documentation for in the Code Viewer frame.
    • Press Ctrl + Q to load the Quick Documentation window.
    • Follow the hyperlinks to learn more about each aspect of the code you are examining.
  6. How.com.vn English: Step 6 Export the code to Visual Basic.
    If you want to manipulate, edit, and build the file on your own, you can export it into Visual Studio. The exported code will be in C#, even if it was originally written in a different language originally.[6]
    • Right-click on the DLL file in the Assembly Explorer.
    • Select "Export to Project"
    • Choose your export options. You can have the project opened immediately in Visual Studio if you'd like to get started on it immediately.
  7. How.com.vn English: Step 7 Edit the code...
    Edit the code in Visual Studio. Once you have the project loaded in Visual Studio, you will have complete control over editing and building the DLL into your own creation. Click here for detailed instructions on using Visual Studio.[7]
  8. Advertisement

Community Q&A

Search
Add New Question
  • Question
    Can I modify game code by accessing the DLL files?
    How.com.vn English: Community Answer
    Community Answer
    Possibly, but be mindful of the licensing of the game and whether or not you are allowed to edit the coding.
  • Question
    Can I change the source code of a windows DLL file? Can I change the source code of another application?
    How.com.vn English: Community Answer
    Community Answer
    Yes, but making changes is risky because because these are compiled files. If you want to change code, first backup your original files, then you can use the "Resource Editor" to edit and save the DLL.
  • Question
    How do I find virus code in a DLL file?
    How.com.vn English: Community Answer
    Community Answer
    Scan it using an antivirus or a virus-scanning website like virustotal.com.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      How.com.vn English: Yaffet Meshesha
      Co-authored by:
      Computer Specialist
      This article was co-authored by Yaffet Meshesha. Yaffet Meshesha is a Computer Specialist and the Founder of Techy, a full-service computer pickup, repair, and delivery service. With over eight years of experience, Yaffet specializes in computer repairs and technical support. Techy has been featured on TechCrunch and Time. This article has been viewed 2,630,671 times.
      How helpful is this?
      Co-authors: 58
      Updated: February 21, 2024
      Views: 2,630,671
      Categories: File Manipulation
      Article SummaryX

      1. Download an install a compiler.
      2. Open the DLL in the compiler.
      3. Use the Assembly Explorer to browse the nodes.
      4. Double-click a node to view its code.
      5. Export the project to Visual Basic to edit the code.
      6. Edit the code in Visual Studio.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 2,630,671 times.

      Reader Success Stories

      • How.com.vn English: Rhys Edwards

        Rhys Edwards

        Sep 24, 2017

        "I am troubleshooting a web page user search issue that uses a custom DLL. I needed to be able to reproduce the..." more
        Rated this article:
      Share your story

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement