Author Topic: Is anyone using ILSpy?  (Read 13947 times)

0 Members and 1 Guest are viewing this topic.

TheMaster

  • Guest
Is anyone using ILSpy?
« on: March 28, 2012, 03:23:43 PM »
The beta of version 2.0 has been online for a few months and
after playing with it, I'm ready to say 'adios Reflector'.

There's even a version that runs on Metro.

Best of all, its open sourced and you can hack on it to your heart's content.

http://build.sharpdevelop.net/BuildArtefacts/#ILSpyMaster
« Last Edit: March 28, 2012, 03:27:23 PM by TheMaster »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Is anyone using ILSpy?
« Reply #1 on: March 28, 2012, 03:42:36 PM »

Thanks for the heads up Tony - an alternative is handy.
I've had a look at dotPeek from JetBrains ... good, but not up to Reflector yet.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

TheMaster

  • Guest
Re: Is anyone using ILSpy?
« Reply #2 on: March 28, 2012, 08:50:05 PM »

Thanks for the heads up Tony - an alternative is handy.
I've had a look at dotPeek from JetBrains ... good, but not up to Reflector yet.

Speaking of Reflector, here's some interesting observations:

 http://community.sharpdevelop.net/blogs/dsrbecky/archive/2011/02/19/ilspy-ensuring-correctness.aspx

« Last Edit: March 28, 2012, 08:57:42 PM by TheMaster »

exmachina

  • Guest
Re: Is anyone using ILSpy?
« Reply #3 on: March 28, 2012, 08:59:02 PM »
Red Gate Reflector some times do not show code ofuscated with Red gate Smartassembly. Why?  :lmao:

 The best free "decompiler" is Telerick JustDecompile

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Is anyone using ILSpy?
« Reply #4 on: March 28, 2012, 10:02:06 PM »
The best free "decompiler" is Telerick JustDecompile
Especially when looking at acdbmgd.dll & acmgd.dll
 
JustDecompile is hands down the best at decompiling the code to this 

 
 
 
Thanks for that link!!
Wish I would of known about this before I paid for Reflector.

exmachina

  • Guest
Re: Is anyone using ILSpy?
« Reply #5 on: March 28, 2012, 10:53:57 PM »
The best free "decompiler" is Telerick JustDecompile
Especially when looking at acdbmgd.dll & acmgd.dll
 
JustDecompile is hands down the best at decompiling the code to this 

Thanks for that link!!
Wish I would of known about this before I paid for Reflector.
Sorry. I do not understand, perhaps because I do not speak English : Il & C#


exmachina

  • Guest
Re: Is anyone using ILSpy?
« Reply #6 on: March 28, 2012, 11:07:35 PM »
 :oops: :oops: :oops: Ok. You're right


TheMaster

  • Guest
Re: Is anyone using ILSpy?
« Reply #7 on: March 29, 2012, 04:16:45 AM »

Red Gate Reflector some times do not show code ofuscated with Red gate Smartassembly. Why?  :lmao:


Refector is only accurate with IL produced by the Microsoft C# compiler.

IL produced via any other means (e.g., another language) may not
be accurately decompiled.

Quote

  The best free "decompiler" is Telerick JustDecompile


Hate to disagree :grin:

Can you debug managed code with JustDecompile ?

ILSpy 2.0 (beta) is a debugger as well as a decompiler.

You can set breakpoints, launch an executable or attach
to a running process, and step through any code in any
assembly that's loaded, regardless of whether it is your
code, the .NET framework, or AutoCAD's managed runtime.

When a breakpoint is hit, you can examine the call stack,
see the values of  arguments, etc. (no locals/watch window
yet, but that's planned).

Also, it looks like Telerik still has some work to do.

JustDecompile showing the source for System.Linq.Enumerable.ZipIterator:

Code - C#: [Select]
  1.  
  2. Current member / type: System.Collections.Generic.IEnumerable`1<TResult> System.Linq.Enumerable::ZipIterator(System.Collections.Generic.IEnumerable`1<TFirst>,System.Collections.Generic.IEnumerable`1<TSecond>,System.Func`3<TFirst,TSecond,TResult>)
  3. File path: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\System.Core.dll
  4. Product version: 2012.1.214.2
  5. Multiple invocations of finally method
  6.    at ˆ..ˆ(€ handlerInfo, Queue`1 bfsQueue, ILogicalConstruct currentNode)
  7.    at ˆ..‡(€ handlerInfo)
  8.    at ˆ..ƒ(BlockLogicalConstruct theBlock)
  9.    at ˆ.Ž–.‰()
  10.    at ˆ.Ž–.Process(DecompilationContext context, BlockStatement body)
  11.    at Telerik.JustDecompiler.Decompiler.DecompilationPipeline.Run(MethodBody body, ILanguage language)
  12.    at Telerik.JustDecompiler.Decompiler.Extensions.DecompileYieldStateMachine(MethodBody body, ILanguage language, YieldFieldsInformation& fieldsInformation)
  13.    at .‹.()
  14.    at .‹.Match(StatementCollection statements)
  15.    at .‹.Process(DecompilationContext context, BlockStatement body)
  16.    at Telerik.JustDecompiler.Decompiler.DecompilationPipeline.Run(MethodBody body, ILanguage language)
  17.    at Telerik.JustDecompiler.Decompiler.Extensions.(DecompilationPipeline pipeline, ILanguage language, MethodBody body, DecompilationContext& context)
  18.    at Telerik.JustDecompiler.Decompiler.Extensions.Decompile(MethodBody body, ILanguage language, DecompilationContext& context)
  19.    at Telerik.JustDecompiler.Languages.BaseImperativeLanguageWriter.Write(MethodDefinition method)
  20.    at Telerik.JustDecompiler.Languages.BaseLanguageWriter.Write(IMemberDefinition member, Boolean showCompilerGeneratedMembers)
  21.    at JustDecompile.CodeViewer.CodeWriter.Write() in c:\Builds\126\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.CodeViewer\Writers\CodeWriter.cs:line 32
  22.    at JustDecompile.CodeViewer.ViewModels.CodeViewerViewModel.(AssemblyMemberNode member, CancellationToken cancellationToken) in c:\Builds\126\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.CodeViewer\ViewModels\CodeViewerViewModel.cs:line 170
  23.  
  24. mailto: JustDecompilePublicFeedback@telerik.com
  25.  
  26.  

ILSpy showing the same method:

Code - C#: [Select]
  1.  
  2. // System.Linq.Enumerable
  3. private static IEnumerable<TResult> ZipIterator<TFirst, TSecond, TResult>(IEnumerable<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector)
  4. {
  5.         using (IEnumerator<TFirst> enumerator = first.GetEnumerator())
  6.         {
  7.                 using (IEnumerator<TSecond> enumerator2 = second.GetEnumerator())
  8.                 {
  9.                         while (enumerator.MoveNext() && enumerator2.MoveNext())
  10.                         {
  11.                                 yield return resultSelector(enumerator.Current, enumerator2.Current);
  12.                         }
  13.                 }
  14.         }
  15.         yield break;
  16. }
  17.  
  18.  
« Last Edit: March 29, 2012, 05:03:03 AM by TheMaster »

TheMaster

  • Guest
Re: Is anyone using ILSpy?
« Reply #8 on: March 29, 2012, 04:21:22 AM »
The best free "decompiler" is Telerick JustDecompile
Especially when looking at acdbmgd.dll & acmgd.dll
 
JustDecompile is hands down the best at decompiling the code to this 
 
Thanks for that link!!
Wish I would of known about this before I paid for Reflector.

Were you using the assemblies from the SDK or the production
assemblies in the AutoCAD folder?

exmachina

  • Guest
Re: Is anyone using ILSpy?
« Reply #9 on: March 29, 2012, 05:26:48 AM »
@ TheMaster
"Red Gate Reflector some times do not show code ofuscated with Red gate Smartassembly. Why?":
Easy :SmartassemblyAttribute

ILSpy
http://wiki.sharpdevelop.net/ILSpy.ashx
Debug? where you see that?.
Why anyone needs debug 3rth party assemblies?: only for hacking or cracking.  And read carefully at ILSpy - Further Down the Road:
Assembly editing capabilities (similar to Reflexil <- This is an Hackers Tool

kaefer

  • Guest

exmachina

  • Guest
Re: Is anyone using ILSpy?
« Reply #11 on: March 29, 2012, 07:09:00 AM »
@ kaefer
Thanks, i proves it.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Is anyone using ILSpy?
« Reply #12 on: March 29, 2012, 09:34:08 AM »
The best free "decompiler" is Telerick JustDecompile
Especially when looking at acdbmgd.dll & acmgd.dll
 
JustDecompile is hands down the best at decompiling the code to this 
 
Thanks for that link!!
Wish I would of known about this before I paid for Reflector.

Were you using the assemblies from the SDK or the production
assemblies in the AutoCAD folder?

The ones located in same location as acad.exe not the sdk's or ones that are just the signatures.

Draftek

  • Guest
Re: Is anyone using ILSpy?
« Reply #13 on: March 29, 2012, 09:44:50 AM »
Thanks Tony.

TheMaster

  • Guest
Re: Is anyone using ILSpy?
« Reply #14 on: March 29, 2012, 02:09:44 PM »
Why anyone needs debug 3rth party assemblies?: only for hacking or cracking. 

Why does anyone need to debug 3rd party assemblies?

Why does Visual Studio allow you to debug .NET framework code?

exmachina

  • Guest
Re: Is anyone using ILSpy?
« Reply #15 on: April 02, 2012, 11:29:35 AM »
Why does Visual Studio allow you to debug .NET framework code?

I do not know. If someone has an (real life) example , please send it.
Thanks.

TheMaster

  • Guest
Re: Is anyone using ILSpy?
« Reply #16 on: April 02, 2012, 03:21:11 PM »
Why does Visual Studio allow you to debug .NET framework code?

I do not know. If someone has an (real life) example , please send it.
Thanks.

Microsoft made the source available for debugging so that if you need to know what the framework is doing when you call one of its APIs, you can step into the source code to find out.

exmachina

  • Guest
Re: Is anyone using ILSpy?
« Reply #17 on: April 02, 2012, 05:11:37 PM »
What about pdb files and others files like this?. In any case, i respect your opinion but i do not understand what may be the purpose of debugging that:
Debugging System.Drawing.Graphics.DrawString
« Last Edit: April 02, 2012, 05:17:05 PM by exmachina »

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Is anyone using ILSpy?
« Reply #18 on: April 02, 2012, 07:34:32 PM »
Many reasons and on one hand you have people checking and testing your code for free.
 
Using your example lets say you keep getting a exception that your brush is null and you use a decompiler to look at code.
Code - C#: [Select]
  1.         public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
  2.         {
  3.             if (brush == null)
  4.             {
  5.                 throw new ArgumentNullException("brush");
  6.             }
  7.             if ((s != null) && (s.Length != 0))
  8.             {
  9.                 if (font == null)
  10.                 {
  11.                     throw new ArgumentNullException("brush");
  12.                 }
  13.                 GPRECTF layoutRect = new GPRECTF(layoutRectangle);
  14.                 IntPtr handle = (format == null) ? IntPtr.Zero : format.nativeFormat;
  15.                 int status = SafeNativeMethods.Gdip.GdipDrawString(new HandleRef(this, this.NativeGraphics), s, s.Length, new HandleRef(font, font.NativeFont), ref layoutRect, new HandleRef(format, handle), new HandleRef(brush, brush.NativeBrush));
  16.                 this.CheckErrorStatus(status);
  17.             }
  18.         }
  19.  

You tell microsoft and they can't reproduce it and you send them your code for creating a brush and they can't reproduce it.
 
I do not know if you caught it but I changed the exception for font null check (easily could happen by copying pasting and forgetting to change brush to font)
 
If you debug it you would have noticed that it really was your font that was null. I do not see how people can really say they know what there code is doing without debugging it.

exmachina

  • Guest
Re: Is anyone using ILSpy?
« Reply #19 on: April 02, 2012, 08:17:31 PM »
Maybe I have not understood well (sorry, always i have the same problem because i don't speack...etc), In my opinion:

1- I do not work for Microsoft, much less free. So i have no reason to find/debug their mistakes
2- 33 + 33 = 66. Otherwise the problem is the compiler or languaje implementation=>Look@point 1
3- At this level anyone can be distinguish what is his own fault/bug or that of others, so=>Look@point 1

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Is anyone using ILSpy?
« Reply #20 on: August 21, 2012, 05:24:16 PM »
I have not spent much time with it but at least looks cool, a visualizer plug-in for ILSpy.
 
ILSpy Plug-Ins
 
 

BlackBox

  • King Gator
  • Posts: 3770
Re: Is anyone using ILSpy?
« Reply #21 on: August 21, 2012, 06:22:59 PM »
I have not spent much time with it but at least looks cool, a visualizer plug-in for ILSpy.
 
ILSpy Plug-Ins

... That's pretty neat; I'm sure the Assembly Visualizer will come in handy as I progress with .NET development. :beer:
"How we think determines what we do, and what we do determines what we get."

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Is anyone using ILSpy?
« Reply #22 on: August 20, 2013, 02:03:24 AM »
Sorry for opening a oldish thread, but there's just been another release of such "free" inspector/decompiler:
dotPeek: http://www.jetbrains.com/decompiler/
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.