开发者

How do you extract classes' source code from a dll file?

开发者 https://www.devze.com 2023-02-05 03:42 出处:网络
Is there any software to 开发者_JAVA百科do this? I didn\'t find any useful information on the internet so I am asking here.You cannot get the exact code, but you can get a decompiled version of it.

Is there any software to 开发者_JAVA百科do this? I didn't find any useful information on the internet so I am asking here.


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 IL using ILDASM, which comes bundled with the .Net Framework SDK Tools.


Only managed Languages like c# and Java can be decompiled completely.You can view complete source code. For Win32 dll you cannot get source code.

For CSharp dll Use DotPeek becoz it free and works same as ReDgate .Net Compiler

Have fun.


Use dotPeek

How do you extract classes' source code from a dll file?

Select the .dll to decompile

How do you extract classes' source code from a dll file?

That's it


Use .NET reflector.


Use Refractor. Download from here.

  1. Open the software after installing.
  2. Press Ctrl + O and select your DLL File.
  3. Dll will be shown in left pane.
  4. Right click on Dll and select Export Source Code.
  5. Select the folder in which you want to export your files
  6. Wait for a while it may take 2-3 minutes

How do you extract classes' source code from a dll file?


You can use Reflector and also use Add-In FileGenerator to extract source code into a project.


You can use dotPeek The only thing I have to say is that when using it, right-click on the class to select Decompiled Source instead of double-clicking, otherwise dotpeek will only display the contents of the local cs file, not the decompiled content.

How do you extract classes' source code from a dll file?


If you want to know only some basics inside the dll assembly e.g. Classes, method etc.,to load them dyanamically

you can make use of IL Disassembler tool provided by Microsoft.

Generally located at: "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin"


I used Refractor to recover my script/code from dll file.


 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"));
           
            }
        }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号