ILSpy-For-MacOSX icon indicating copy to clipboard operation
ILSpy-For-MacOSX copied to clipboard

READ: Better way to use official ILSpy command-line tool on Mac, Windows and Linux

Open Arcitec opened this issue 7 years ago • 5 comments

Step 1:

  • Mac) Install Visual Studio for Mac (http://visualstudio.microsoft.com/vs/mac/). It has MonoDevelop, all .NET tools, a full IDE, etc...
  • Windows) Install Visual Studio or any other way to get the "dotnet" command line tool.
  • Linux) Get the "dotnet" command line tool.

Step 2: Go to a Terminal prompt and type dotnet tool install ilspycmd -g to install the official ilspy command line version.

Step 3: Read usage instructions here: https://github.com/icsharpcode/ILSpy/tree/master/ICSharpCode.Decompiler.Console. It is very simple. Most of the time you just run it with ilspycmd -p -o <folder> <dll file> to decompile to an output folder and make a buildable project file (that is what -p does).

Arcitec avatar Sep 15 '18 15:09 Arcitec

I suggest changing the name of the issue from "Better" to "Alternative".

The method suggested in this issue seems like a lot more complex dependencies, than just using this repository. I can't even tell if "Visual Studio for Mac" is free/libre/open-source.

So, this repository is simpler and easier, and for me at least better, for people who want to only use free/libre/open-source software we've compiled ourselves (I use it on GNU/Linux, rather than Mac).

ethus3h avatar Sep 16 '18 01:09 ethus3h

@ethus3h ILSpy is created by https://github.com/icsharpcode/ILSpy and is fully open source. That repository is updated almost daily to fix bugs/improve decompilation and has 62 contributors.

This repository here is a fork of ILSpy which forked on Nov 28, 2015, and since then has 1 contributor (who of course did a great job before an official command-line client of ILSpy existed), and only gets a few commits per year. It's far behind.

The fork here has done a good job with many of its features, and creating the first-ever console version of the application. But the "bad" part is how it's far behind the official project and its constant improvements and serious fixes to the decompiler core. For example, I have come across binaries that wouldn't decompile at all until they fixed ILSpy. So updates matter... But with 1 author here, it's of course impossible to stay on track of all changes to the official ILSpy. I wouldn't want to constantly update it either if I was him.

But then, a while ago (on Sept 17, 2017), they finally added an official cross-platform (Mac/Windows/Linux) command-line GUI for the actual ILSpy project. It solved everything: Finally you get the latest decompiler core with its constant bugfixes and improvements. On any platform.

So that explains the "Better" word. It's much better at decompiling, which really matters for a decompiler tool like this! But I've now edited the title and first post to clarify one thing: The official command line tool is not just for Mac; it's for Windows and Linux too.

As for how to install their official command line tool: They publish Mac, Windows and Linux binaries via the "dotnet" service, so on any OS you just install that tool and then run dotnet tool install ilspycmd -g.

Lastly: If you always want to compile it yourself, just clone https://github.com/icsharpcode/ILSpy and read the short build-instructions for Unix: https://github.com/icsharpcode/ILSpy#how-to-build

Arcitec avatar Sep 16 '18 12:09 Arcitec

Cool, thank you for the information! :D

ethus3h avatar Sep 16 '18 19:09 ethus3h

dotnet tool install ilspycmd -g

No executable found matching command "dotnet-tool"

walter211 avatar Jan 09 '19 12:01 walter211

can we just have a doc to decompile a exe file?

walter211 avatar Jan 10 '19 05:01 walter211