I just need to search for bits of text in my C# code.
I already have .NET Reflector and the File Disassembler Add-In, but these just seem to decompile one DLL.
To do this, go to the Modules window and from the context menu of a . NET assembly, and then select the Decompile source code command. Visual Studio generates a symbol file for the assembly and then embeds the source into the symbol file. In a later step, you can extract the embedded source code.
Such a DLL is compiled to machine language and can only be directly decompiled to assembly language. So, again, it depends on the language used. And the answer might be that it's just not possible to get anything resembling the original source code. Then, as stated, if it's Visual Basic, research p-code decompilers.
Using Visual Studio, you may edit the code to run the functions that you want. You can also use Visual Studio to read the DLL file without editing the code.
You can now use Visual Studio to decompile managed code even if you don't have the symbols, allowing you to look at code, inspect variables and set breakpoints.
Actually, none of these answers are right.
Yeah, all the tools can decompile *.dll files into *.csproj file but none of them supports CLI or batch processing. You can save yourself the time with installations.
The best possible solution so far is use dotPeek, put all *.dll files into one folder and use Explore Folder option.

dotPeek will analyse the given folder and shows a tree of DLLs located inside the folder. You can generate csproj manually for every single dll which is loaded.

If you came across this post because you are looking answer how locate specific instruction in your or 3rd party dlls, specially a use of reflection, you can use this PowerShell script to decompile dlls into IL and look for the instruction (System.Reflection.Assembly::Load(string) for reflection).
It is using Intermediate Language DisASseMbler (ILDASM) from .NET Framework SDK kit. Adjust the path accordingly to your version of SDK.
function Get-LibDump
{
Param(
# Specifies a path to one or more locations. Wildcards are permitted.
[Parameter(Mandatory=$true,
Position=0,
ParameterSetName="Basic",
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
HelpMessage="Path to one or more locations.")]
[ValidateNotNullOrEmpty()]
[SupportsWildcards()]
[ValidateScript({$_ | Test-Path})]
[System.IO.FileInfo]
$Path
)
process
{
$dumpFileFilePath = $Path.BaseName + '.il'
$outFile = "C:\LibDump\$dumpFileFilePath"
Start-Process -FilePath 'c:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\ildasm.exe' -ArgumentList "/UNICODE /OUT=`"$outFile`" `"$($Path.FullName)`"" -Wait
"Dump from:`n$(Resolve-Path -Path $Path.FullName -Relative)" | Out-File -FilePath $outFile -Encoding:unicode -Append
}
}
# Use
Get-ChildItem -Path $PathToLibFolder -Filter '*.dll' -File -Recurse | Get-LibDump
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With