I'm having a hard time trying to (Dis)assemble a dll using the Visual Studio command prompt, don't look that simple as I see in the microsoft page.
I'm using the ildasm for these way:
ildasm myLibrary.dll output:MyLibrary.il
And I get: Unable to open 'MyLibrary.il' for output.
I also tried the full path:
ildasm directory\myLibrary.dll output:directory\MyLibrary.il
And I get: MULTIPLE INPUT FILES SPECIFIED
Using the ildasm GUI actually works, but when I use the ilasm:
ilasm myLibrary.il /dll
I get: Could not open 'myLibrary.il', when I use the full path I get the same error.
What's wrong here?
simple, let's take this line of code:
Let us compile
App.cstoApp.exe. This executable now prints Inside main … when we run it.Now let us attempt to change the output of this executable without touching its source files.
You run
ildasm App.exe /out:App.ilto generate the IL code corresponding to the executable. You can now edit this il code in notepad and change theldstrfrom “Inside main …” to “Inside main changed …” as shown below:To
Now let us rebuild the executable from this il file by running
ilasm App.il.This generates a new App.exe. If you run App.exe you will get the following output “Inside main changed …”There are useful posts in social.msdn and in c-sharpcorner as well guiding through the use of ILDASM and ILASM.