Skip to content
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

[ILSpyCmd] IlSpy can open, but IlSpyCmd gives "PE file does not contain any managed metadata" #3154

Open
NBKRedSpy opened this issue Jan 15, 2024 · 2 comments
Labels

Comments

@NBKRedSpy
Copy link

NBKRedSpy commented Jan 15, 2024

Steps to reproduce

  1. Run "ilspycmd ModLoaderInstaller-win32.exe_Beware_AutoUpdates.bak" on attached file.

Error message shown

ICSharpCode.Decompiler.Metadata.PEFileNotSupportedException: PE file does not contain any managed metadata.
   at ICSharpCode.Decompiler.Metadata.PEFile..ctor(String fileName, PEReader reader, MetadataReaderOptions metadataOptions) in /_/ICSharpCode.Decompiler/Metadata/PEFile.cs:line 70
   at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.GetDecompiler(String assemblyFileName) in D:\a\ILSpy\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 273
   at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.Decompile(String assemblyFileName, TextWriter output, String typeName) in D:\a\ILSpy\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 324
   at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.<OnExecuteAsync>g__PerformPerFileAction|53_0(String fileName, <>c__DisplayClass53_0& ) in D:\a\ILSpy\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 245
   at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.OnExecuteAsync(CommandLineApplication app) in D:\a\ILSpy\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 166

ILSpy does work

  • Steps to reproduce

  1. open ILSpy
  2. open the "ModLoaderInstaller-win32.exe_Beware_AutoUpdates.bak" attached file.

Result:

Is able to open and decompile the file.
ModLoaderInstaller-win32.exe_Beware_AutoUpdates.bak.zip

Details

  • ILSpyCmd Version:

ilspycmd: 8.2.0.7535
ICSharpCode.Decompiler: 8.2.0.7535

  • ILSpy Vesion:
    ILSpy version 8.2.0.7535
    .NET version 6.0.26-servicing.23605.8+dc45e96840243b203b13e61952230e225d2aac52
@NBKRedSpy NBKRedSpy added the Bug label Jan 15, 2024
@Sid110307
Copy link

The file could be a DLL, not a .NET executable. You can use a tool like PEiD (Windows) or Detect It Easy (Cross-platform) to check.

@ElektroKill
Copy link
Contributor

Use the latest build from master branch, it is capable of reading this bundle file.

Download can be found here: https://github.com/icsharpcode/ILSpy/actions/runs/9405226877

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants