ILSpy icon indicating copy to clipboard operation
ILSpy copied to clipboard

Support disassembling single file bundle for ILSpy

Open cshung opened this issue 10 months ago • 10 comments

Problem

https://github.com/icsharpcode/ILSpy/issues/3397

Solution

  • To support disassembling PE images stored only in memory,
  • The ReadyToRunReader is updated in this PR to support disassembling input given as a ImmutableArray<byte>.
  • This change provide the image content to the ReadyToRunReader so that it can perform the disassembling duty.
  • [x] The change is tested by disassembling a simple single file bundle, with locally built ReadyToRunReader.

~This change will NOT compile until we have the package updated, this CI is expected to fail for now.~

cshung avatar Feb 13 '25 22:02 cshung

@cshung will that also close #3337 or is the work you mentioned still open?

christophwille avatar Feb 25 '25 13:02 christophwille

@cshung will that also close #3337 or is the work you mentioned still open?

This PR is unrelated to #3337. I think #3337 should be closed with #3340 as the package is already updated there.

cshung avatar Feb 25 '25 15:02 cshung

What are the chances we can get this in during March?

christophwille avatar Mar 09 '25 07:03 christophwille

What are the chances we can get this in during March?

I have merged the change on the runtime repo side, however, it looks like the new package is going to depend on System.Reflection.Metadata with version 10.0.0-preview.3.25152.4 or above.

cshung avatar Mar 12 '25 18:03 cshung

Although even today we "up" the dependency for SRM in ILSpy vs ICS.Decompiler, taking on a preview dependency for a RTM version of ours (your PR was dog-eared for 9.1) might be a hard pill to swallow.

christophwille avatar Mar 13 '25 06:03 christophwille

@cshung I suppose this https://www.nuget.org/packages/System.Reflection.Metadata/10.0.0-preview.3.25171.5 would be the new package? (to replace 9.0.1 here https://github.com/icsharpcode/ILSpy/blob/5428a9b53a57d9c0ebd25c4a2e872dd00aef20fb/Directory.Packages.props#L45)

christophwille avatar Apr 11 '25 04:04 christophwille

@cshung I suppose this https://www.nuget.org/packages/System.Reflection.Metadata/10.0.0-preview.3.25171.5 would be the new package? (to replace 9.0.1 here)

Yes! Assuming we are going to upgrade SRM to 10, I have rebased my PR and upgraded the package. This PR is now functional to disassemble ready to run code in a single file bundle.

cshung avatar Apr 13 '25 17:04 cshung

ICSharpCode.Decompiler.csproj should not be touched - the "old" packages there are very much intentional (yes, a bog standard NuGet update will unknowingly wreak havoc)

christophwille avatar Apr 14 '25 05:04 christophwille

@christophwille, hello?

cshung avatar May 06 '25 20:05 cshung

@siegfriedpammer is working on moving ILSpy to. NET 10, that is why we postponed merging this PR. Sorry for not telling you.

christophwille avatar May 07 '25 05:05 christophwille

@cshung thanks and sorry it took so long!

christophwille avatar Jul 05 '25 07:07 christophwille