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

Failed to decompile file .NETCoreApp v8 #3255

Closed
danthespal opened this issue Aug 9, 2024 · 7 comments
Closed

Failed to decompile file .NETCoreApp v8 #3255

danthespal opened this issue Aug 9, 2024 · 7 comments
Labels
Bug Decompiler The decompiler engine itself

Comments

@danthespal
Copy link

Input code

System.BadImageFormatException: Read out of bounds.
   at System.Reflection.Throw.OutOfBounds()
   at System.Reflection.Metadata.MethodDebugInformation.GetSequencePoints()
   at ICSharpCode.ILSpyX.PdbProvider.PortableDebugInfoProvider.GetSequencePoints(MethodDefinitionHandle method) in /_/ICSharpCode.ILSpyX/PdbProvider/PortableDebugInfoProvider.cs:line 101
   at ICSharpCode.Decompiler.Disassembler.MethodBodyDisassembler.Disassemble(MetadataFile module, MethodDefinitionHandle handle) in /_/ICSharpCode.Decompiler/Disassembler/MethodBodyDisassembler.cs:line 129
   at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.DisassembleMethodBlock(MetadataFile module, MethodDefinitionHandle handle, MetadataGenericContext genericContext) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 375
   at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.DisassembleMethod(MetadataFile module, MethodDefinitionHandle handle) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 153
   at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.DisassembleType(MetadataFile module, TypeDefinitionHandle type) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 1650
   at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.DisassembleType(MetadataFile module, TypeDefinitionHandle type) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 1627
   at ICSharpCode.ILSpy.ILLanguage.DecompileType(ITypeDefinition type, ITextOutput output, DecompilationOptions options)
   at ICSharpCode.ILSpy.TreeNodes.TypeTreeNode.Decompile(Language language, ITextOutput output, DecompilationOptions options)
   at ICSharpCode.ILSpy.TextView.DecompilerTextView.DecompileNodes(DecompilationContext context, ITextOutput textOutput)
   at ICSharpCode.ILSpy.TextView.DecompilerTextView.<>c__DisplayClass53_0.<DecompileAsync>b__0()

Details

  • Product in use: ILSpy 9.9.9.7706 pull 3243 debug preview 2
@danthespal danthespal added Bug Decompiler The decompiler engine itself labels Aug 9, 2024
@siegfriedpammer
Copy link
Member

It seems that there is a broken PDB file next to the assembly file you are trying to decompile.

Would it be possible for you to provide these files? Thanks!

@christophwille christophwille added the Feedback Needed This issue requires user feedback label Aug 10, 2024
@danthespal
Copy link
Author

GameHelper.zip
yes sure

@siegfriedpammer
Copy link
Member

Sorry, I cannot reproduce the issue... starting from an empty assembly list, can you provide a detailed list of steps that you perform in ILSpy to get this error? Thanks!

@danthespal
Copy link
Author

I open ILSpy, import the file, change from C# to IL, select the the Configurator under " { } - > Configurator" same on PrivateImplementationDetails

@siegfriedpammer
Copy link
Member

The error is not reproducible on my machine, the PDB is not loaded. This is because the DLL you sent does not contain any entries in the Debug Directory, which ILSpy uses to detect whether to look for a PDB or not:

image

Can you please tell us, what ILSpy displays in the assembly tooltip? On my machine it reads:

image

Thanks!

Something really strange is going on here...

@danthespal
Copy link
Author

GameHelper-Release-v6.0.13.zip
maybe this will help

@siegfriedpammer siegfriedpammer removed the Feedback Needed This issue requires user feedback label Aug 17, 2024
@siegfriedpammer
Copy link
Member

So, in the end I manually loaded the PDB using the "Select PDB" feature and then I was able to reproduce the problem. Thanks for reporting this issue!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Decompiler The decompiler engine itself
Projects
None yet
Development

No branches or pull requests

3 participants