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

All methods failed to decompile #330

Closed
ghost opened this issue Jun 19, 2024 · 2 comments
Closed

All methods failed to decompile #330

ghost opened this issue Jun 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jun 19, 2024

dnSpyEx version

6.5.0 (69f8e3d)

Describe the Bug

This is the first time I encounted a Unity game that fails to decompile on dnSpy. All methods can't be decompiled, it always throw this error

/*
An exception occurred when decompiling this method (06000949)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Collections.Generic.List`1<System.String> Game.ConfigValidator::CheckGameData(Game.Model.GameData)
 ---> System.OverflowException: Array dimensions exceeded supported range.
   at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackSlot.ModifyStack(StackSlot[] stack, Int32 popCount, Int32 pushCount, ByteCode pushDefinition) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 50
   at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackAnalysis(MethodDef methodDef) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 403
   at ICSharpCode.Decompiler.ILAst.ILAstBuilder.Build(MethodDef methodDef, Boolean optimize, DecompilerContext context) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 278
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 103
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.<>c__DisplayClass90_0.<AddMethodBody>b__0() in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1672
*/;

How To Reproduce

  1. Open this file in dnSpy 0.zip
  2. Open any methods or getter/setter methods

Expected Behavior

Be able to decompile to C#

Actual Behavior

See "Describe the Bug"

Additional Context

No response

@ghost ghost added the bug Something isn't working label Jun 19, 2024
@ElektroKill
Copy link
Member

Hello, the file you uploaded does not contain valid IL code in the method bodies. You can see this when you switch to the IL disassembler.
image

The code in the assembly is obviously encrypted or protected in some way. In order to decompile, you will have to analyze the game and see what kind of protection is being employed in order to undo it and decompile the file. This is not something I can help you with as it is unrelated to dnSpy. dnSpy crashes since the code it is being fed is not valid.

Closing the issue as it is out of the scope of dnSpy.

@ghost
Copy link
Author

ghost commented Jun 21, 2024

Ok, thanks for infomation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant