New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ILSpy support #2

Closed
KOLANICH opened this Issue Aug 28, 2014 · 28 comments

Comments

Projects
None yet
8 participants
@KOLANICH

KOLANICH commented Aug 28, 2014

Would you add ILSpy support?

@GeorgeHahn

This comment has been minimized.

Show comment
Hide comment
@GeorgeHahn

GeorgeHahn Sep 30, 2014

Hi @sailro, what it would take to make this happen? I saw on SF that you said it was in progress, is there a branch I could hack on? This is a feature I'd really love to see, but I'd rather not start from scratch if there's already something in motion.

Let me know if there is anything I can do to help; I'd be happy to come at this from the Reflexil side or the ILSpy side. Thanks!

GeorgeHahn commented Sep 30, 2014

Hi @sailro, what it would take to make this happen? I saw on SF that you said it was in progress, is there a branch I could hack on? This is a feature I'd really love to see, but I'd rather not start from scratch if there's already something in motion.

Let me know if there is anything I can do to help; I'd be happy to come at this from the Reflexil side or the ILSpy side. Thanks!

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Sep 30, 2014

Owner

Yes, this is definitively something i want to do. I already have a working prototype with an old Reflexil/ILSpy version.

The fact is:

  • ILSPy and Reflexil are using custom builds of Mono.Cecil
  • ILSpy and Reflexil are using different version of NRefactory
  • ILSPy is using WPF and Reflexil WinForms (this is not a big thing but i still have some focus issues)

So i'm currently thinking of the best way to integrate.

Owner

sailro commented Sep 30, 2014

Yes, this is definitively something i want to do. I already have a working prototype with an old Reflexil/ILSpy version.

The fact is:

  • ILSPy and Reflexil are using custom builds of Mono.Cecil
  • ILSpy and Reflexil are using different version of NRefactory
  • ILSPy is using WPF and Reflexil WinForms (this is not a big thing but i still have some focus issues)

So i'm currently thinking of the best way to integrate.

@sailro sailro self-assigned this Sep 30, 2014

@sailro sailro added the enhancement label Sep 30, 2014

@GeorgeHahn

This comment has been minimized.

Show comment
Hide comment
@GeorgeHahn

GeorgeHahn Sep 30, 2014

I just took a look at what it would take to update from NRefactory 4 to 5
and phew... that's significant. The update breaks
ICSharpCode.SharpDevelop.Dom, and, unless I'm mistaken, that library
appears to have been largely refactored away. Additionally, the changes
from v4 to v5 appear to be quite significant.

I'll spend some tie reading through the Reflexil code to see what I can do.
It looks like the code completion engine is one of the more broken parts.
I'm tempted to nop the whole thing to see where it gets me.

On Tue, Sep 30, 2014 at 3:17 AM, Sebastien LEBRETON <
notifications@github.com> wrote:

Yes, this is definitively something i want to do. I already have a working
prototype with an old Reflexil/ILSpy version.

The fact is:

  • ILSPy and Reflexil are using custom builds of Mono.Cecil
  • ILSpy and Reflexil are using different version of NRefactory

So i'm currently thinking of the best way to integrate.


Reply to this email directly or view it on GitHub
#2 (comment).

GeorgeHahn commented Sep 30, 2014

I just took a look at what it would take to update from NRefactory 4 to 5
and phew... that's significant. The update breaks
ICSharpCode.SharpDevelop.Dom, and, unless I'm mistaken, that library
appears to have been largely refactored away. Additionally, the changes
from v4 to v5 appear to be quite significant.

I'll spend some tie reading through the Reflexil code to see what I can do.
It looks like the code completion engine is one of the more broken parts.
I'm tempted to nop the whole thing to see where it gets me.

On Tue, Sep 30, 2014 at 3:17 AM, Sebastien LEBRETON <
notifications@github.com> wrote:

Yes, this is definitively something i want to do. I already have a working
prototype with an old Reflexil/ILSpy version.

The fact is:

  • ILSPy and Reflexil are using custom builds of Mono.Cecil
  • ILSpy and Reflexil are using different version of NRefactory

So i'm currently thinking of the best way to integrate.


Reply to this email directly or view it on GitHub
#2 (comment).

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Dec 9, 2014

Owner

Just started prototyping

image

Owner

sailro commented Dec 9, 2014

Just started prototyping

image

@GeorgeHahn

This comment has been minimized.

Show comment
Hide comment
@GeorgeHahn

GeorgeHahn Dec 9, 2014

Hooray! 💛

GeorgeHahn commented Dec 9, 2014

Hooray! 💛

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Dec 13, 2014

Owner

Today I have a working preview build. Packed with exactly the same set of features than the Reflector plugin version.

If someone want to have a look, feel free to download and give feedback:
http://www.filedropper.com/reflexilforilspypreview

As with Reflector, ILSpy and Reflexil object models are not in sync (we use distinct Cecil versions). I will now investigate how to tell ILSpy to refresh its own object model when you change something in Reflexil (without the need to save the assembly from Reflexil then reload from ILSpy).

Would be great to see the decompiler view updating when you alter IL opcodes or inject C#.

Owner

sailro commented Dec 13, 2014

Today I have a working preview build. Packed with exactly the same set of features than the Reflector plugin version.

If someone want to have a look, feel free to download and give feedback:
http://www.filedropper.com/reflexilforilspypreview

As with Reflector, ILSpy and Reflexil object models are not in sync (we use distinct Cecil versions). I will now investigate how to tell ILSpy to refresh its own object model when you change something in Reflexil (without the need to save the assembly from Reflexil then reload from ILSpy).

Would be great to see the decompiler view updating when you alter IL opcodes or inject C#.

@GeorgeHahn

This comment has been minimized.

Show comment
Hide comment
@GeorgeHahn

GeorgeHahn Dec 14, 2014

Awesome!

Two crashes I came across:

When right clicking an entity in the code pane:
capture

When clicking the entry point dropdown on the assembly attributes tab:

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Reflexil.Forms.GenericMemberReferenceForm`1.GetTypeDefinition(TypeReference item)
   at Reflexil.Forms.GenericMemberReferenceForm`1.GetMethodDefinition(MethodReference item)
   at Reflexil.Forms.GenericMemberReferenceForm`1.SelectItem(MemberReference item)
   at Reflexil.Forms.GenericMemberReferenceForm`1..ctor(T selected)
   at Reflexil.Editors.GenericMemberReferenceEditor`1.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Minor crashes aside, I was able to edit an assembly's IL no problem!

GeorgeHahn commented Dec 14, 2014

Awesome!

Two crashes I came across:

When right clicking an entity in the code pane:
capture

When clicking the entry point dropdown on the assembly attributes tab:

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Reflexil.Forms.GenericMemberReferenceForm`1.GetTypeDefinition(TypeReference item)
   at Reflexil.Forms.GenericMemberReferenceForm`1.GetMethodDefinition(MethodReference item)
   at Reflexil.Forms.GenericMemberReferenceForm`1.SelectItem(MemberReference item)
   at Reflexil.Forms.GenericMemberReferenceForm`1..ctor(T selected)
   at Reflexil.Editors.GenericMemberReferenceEditor`1.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Minor crashes aside, I was able to edit an assembly's IL no problem!

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Dec 15, 2014

Owner

#.1 is fixed, #.2 should but i was not able to reproduce on my side. If you have a test assembly + a repro it would be great.

And good news, i'm now able to alter ILSpy object model from modifications made in Reflexil. Like if you inject/remove something or you change IL, you will see updates in the decompiler view + nodes.

Owner

sailro commented Dec 15, 2014

#.1 is fixed, #.2 should but i was not able to reproduce on my side. If you have a test assembly + a repro it would be great.

And good news, i'm now able to alter ILSpy object model from modifications made in Reflexil. Like if you inject/remove something or you change IL, you will see updates in the decompiler view + nodes.

@GeorgeHahn

This comment has been minimized.

Show comment
Hide comment
@GeorgeHahn

GeorgeHahn Dec 15, 2014

Repro:
From attached zip, load SOVND.Client.exe and SOVND.Client.Patched.exe. With the SOVND.Client assembly selected, click the entry point dropdown.

sovnd zip.gif (Rename to .zip)

GeorgeHahn commented Dec 15, 2014

Repro:
From attached zip, load SOVND.Client.exe and SOVND.Client.Patched.exe. With the SOVND.Client assembly selected, click the entry point dropdown.

sovnd zip.gif (Rename to .zip)

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Dec 15, 2014

Owner

Thanks, fixed in d944e13

The issue was that unlike Reflector, with ILSpy you can load the "same" assembly twice (i.e. having the same exact name+version+key) like in your repro with SOVND.Client.exe and SOVND.Client.Patched.exe. (of course this is usefull because they have distinct bits).

Reflector will act as if the assembly is already loaded and will only keep the first loaded file.

Btw this is now fixed.

Owner

sailro commented Dec 15, 2014

Thanks, fixed in d944e13

The issue was that unlike Reflector, with ILSpy you can load the "same" assembly twice (i.e. having the same exact name+version+key) like in your repro with SOVND.Client.exe and SOVND.Client.Patched.exe. (of course this is usefull because they have distinct bits).

Reflector will act as if the assembly is already loaded and will only keep the first loaded file.

Btw this is now fixed.

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Dec 19, 2014

Owner

Here is a new Build:
http://we.tl/0qxGkdwks2

With a cool feature:

image

Note that the ILSpy object model is auto updated when injecting, renaming or deleting.

This is still a custom ILSpy build to support that. I have also added the Reflector like "Used By" analyzer for types. I made a PR for that, feel free to support me on the PR thread :)
icsharpcode/ILSpy#525

image

Owner

sailro commented Dec 19, 2014

Here is a new Build:
http://we.tl/0qxGkdwks2

With a cool feature:

image

Note that the ILSpy object model is auto updated when injecting, renaming or deleting.

This is still a custom ILSpy build to support that. I have also added the Reflector like "Used By" analyzer for types. I made a PR for that, feel free to support me on the PR thread :)
icsharpcode/ILSpy#525

image

@oldmud0

This comment has been minimized.

Show comment
Hide comment
@oldmud0

oldmud0 Jan 11, 2015

Hey, would you mind if you uploaded the build on a less volatile host? I'm interested in this endeavor, but the download links seem to be dead. Thanks!

oldmud0 commented Jan 11, 2015

Hey, would you mind if you uploaded the build on a less volatile host? I'm interested in this endeavor, but the download links seem to be dead. Thanks!

@sailro

This comment has been minimized.

Show comment
Hide comment

@sailro sailro added this to the 2.0 milestone Jan 12, 2015

@XODE0

This comment has been minimized.

Show comment
Hide comment
@XODE0

XODE0 Jan 16, 2015

hello
i waited all time to see reflexil in ILSpy
thanks
however,there's a problem when start ILSpy
capture

XODE0 commented Jan 16, 2015

hello
i waited all time to see reflexil in ILSpy
thanks
however,there's a problem when start ILSpy
capture

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Jan 21, 2015

Owner

Did you use the preview file attached to this thread ?

Because you cannot compile yet yourself the plugin and use it with an official ILSpy release.
I need some upgrades, i made a PR for that:
icsharpcode/ILSpy#523
But no response so far from ILSpy team.

(You can also build ILSpy from my fork https://github.com/sailro/ILSpy)

Owner

sailro commented Jan 21, 2015

Did you use the preview file attached to this thread ?

Because you cannot compile yet yourself the plugin and use it with an official ILSpy release.
I need some upgrades, i made a PR for that:
icsharpcode/ILSpy#523
But no response so far from ILSpy team.

(You can also build ILSpy from my fork https://github.com/sailro/ILSpy)

@XODE0

This comment has been minimized.

Show comment
Hide comment
@XODE0

XODE0 Jan 23, 2015

yes i used the one attached in previous comment
(this one https://www.dropbox.com/s/jdu8h32whqo6h30/reflexil.for.ILSpy.2.0-preview3.zip)
,i will try to build ILSpy from your fork .
even ILSpy forum is dead i don't know what happens but i wish they could continue there development for both ILSpy and SharpDevelop .
thank you.

XODE0 commented Jan 23, 2015

yes i used the one attached in previous comment
(this one https://www.dropbox.com/s/jdu8h32whqo6h30/reflexil.for.ILSpy.2.0-preview3.zip)
,i will try to build ILSpy from your fork .
even ILSpy forum is dead i don't know what happens but i wish they could continue there development for both ILSpy and SharpDevelop .
thank you.

@GeorgeHahn

This comment has been minimized.

Show comment
Hide comment
@GeorgeHahn

GeorgeHahn Feb 16, 2015

I ran into an issue with IL editing today. I edited a LDSTR instruction in a function that returned a generic List. The saved binary threw an exception for Could not load type 'System.Collections.Generic.List1' from assembly. It looks like the generic<...>part of theList` was dropped.

The binary in question was JBSCore.dll from John's Background Switcher. The function was Pixabay.GetPhotos. Let me know if you need any other info.

GeorgeHahn commented Feb 16, 2015

I ran into an issue with IL editing today. I edited a LDSTR instruction in a function that returned a generic List. The saved binary threw an exception for Could not load type 'System.Collections.Generic.List1' from assembly. It looks like the generic<...>part of theList` was dropped.

The binary in question was JBSCore.dll from John's Background Switcher. The function was Pixabay.GetPhotos. Let me know if you need any other info.

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Feb 20, 2015

Owner

I will check that. Thanks. By the way is the ILSpy + Reflexil experience good so far ?

Owner

sailro commented Feb 20, 2015

I will check that. Thanks. By the way is the ILSpy + Reflexil experience good so far ?

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Mar 6, 2015

Owner

Yes related to #14

Owner

sailro commented Mar 6, 2015

Yes related to #14

@lwlin

This comment has been minimized.

Show comment
Hide comment
@lwlin

lwlin Mar 15, 2015

https://github.com/icsharpcode/ILSpy/releases/tag/2.3
ILSpy has relased 2.3 and i find this Improved extensibility for Reflexil ,may be you can update the plugin .Also i got puzzle that the window of Reflexil will take place of the window of analyzer ,i think it is inconvenience

lwlin commented Mar 15, 2015

https://github.com/icsharpcode/ILSpy/releases/tag/2.3
ILSpy has relased 2.3 and i find this Improved extensibility for Reflexil ,may be you can update the plugin .Also i got puzzle that the window of Reflexil will take place of the window of analyzer ,i think it is inconvenience

@GeorgeHahn

This comment has been minimized.

Show comment
Hide comment
@GeorgeHahn

GeorgeHahn Mar 16, 2015

Ah, sorry I missed your previous reply. Yes, Reflexil + ILSpy is a wonderful combo. Really enjoying it!

GeorgeHahn commented Mar 16, 2015

Ah, sorry I missed your previous reply. Yes, Reflexil + ILSpy is a wonderful combo. Really enjoying it!

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Apr 20, 2015

Owner

Work in progress (about generic issue):

image

Result:
image

Owner

sailro commented Apr 20, 2015

Work in progress (about generic issue):

image

Result:
image

@egorchik007

This comment has been minimized.

Show comment
Hide comment
@egorchik007

egorchik007 Apr 28, 2015

Hi! I've downloaded the latest release of both reflexil and ILSpy, but how do I use them together?
I've noticed that ILSpy contains the same DLLs that are shipped with reflexil build, but I don't have clue how to make it work as on your screenie. Thanks!

egorchik007 commented Apr 28, 2015

Hi! I've downloaded the latest release of both reflexil and ILSpy, but how do I use them together?
I've noticed that ILSpy contains the same DLLs that are shipped with reflexil build, but I don't have clue how to make it work as on your screenie. Thanks!

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro Apr 29, 2015

Owner

The demo build available in this thread was made with a custom ILSpy version.
Now that latest ILSpy release contains everything Reflexil need to work (i made several PR for that and they were accepted in the ILSpy repository), you should take the Reflexil/ILSpy demo build and overwrite everything using the official ILSpy release.

When Reflexil 2.0 will be released, only the necessary Reflexil dll will be shipped.

Owner

sailro commented Apr 29, 2015

The demo build available in this thread was made with a custom ILSpy version.
Now that latest ILSpy release contains everything Reflexil need to work (i made several PR for that and they were accepted in the ILSpy repository), you should take the Reflexil/ILSpy demo build and overwrite everything using the official ILSpy release.

When Reflexil 2.0 will be released, only the necessary Reflexil dll will be shipped.

@andreinitescu

This comment has been minimized.

Show comment
Hide comment
@andreinitescu

andreinitescu May 10, 2015

I am a bit confused.
The latest released version of Reflexil (v1.9) does not work with ILSpy, correct?
Only the preview version you attached in this thread does?

andreinitescu commented May 10, 2015

I am a bit confused.
The latest released version of Reflexil (v1.9) does not work with ILSpy, correct?
Only the preview version you attached in this thread does?

@sailro

This comment has been minimized.

Show comment
Hide comment
@sailro

sailro May 11, 2015

Owner

Yes you are right. You can also use the master to compile a working version.

I have some extended tests to perform and finalizing some work on generics/GUI then i will release a v2 with everything.

Owner

sailro commented May 11, 2015

Yes you are right. You can also use the master to compile a working version.

I have some extended tests to perform and finalizing some work on generics/GUI then i will release a v2 with everything.

@andreinitescu

This comment has been minimized.

Show comment
Hide comment
@andreinitescu

andreinitescu May 11, 2015

thank you.
oh, and your work is amazing :)

andreinitescu commented May 11, 2015

thank you.
oh, and your work is amazing :)

@sailro sailro closed this Aug 12, 2015

@oldmud0

This comment has been minimized.

Show comment
Hide comment
@oldmud0

oldmud0 Aug 12, 2015

Yay! Mission success!

oldmud0 commented Aug 12, 2015

Yay! Mission success!

@sailro sailro referenced this issue Oct 14, 2015

Closed

Feature request #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment