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

后端 未结 10 557
感情败类
感情败类 2020-12-14 16:55

Is there any software to do this? I didn\'t find any useful information on the internet so I am asking here.

相关标签:
10条回答
  • 2020-12-14 17:13

    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"

    0 讨论(0)
  • 2020-12-14 17:14
     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 讨论(0)
  • 2020-12-14 17:16

    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. Option instance

    0 讨论(0)
  • 2020-12-14 17:23

    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.

    0 讨论(0)
提交回复
热议问题