Skip to content

Decompiling error with deobfuscated file #3549

Description

@onurdumangoz

Steps to reproduce

  1. Just click Save Code button

Error message shown

Error decompiling @06003DF6 log4net.Appender.RollingFileAppender.ActivateOptions
in assembly "C:\Users\...\...exe"
 ---> System.ArgumentNullException: Value cannot be null. (Parameter 'methodReference')
   at ICSharpCode.Decompiler.TypeSystem.MetadataModule.ResolveMethod(EntityHandle methodReference, GenericContext context) in MetadataModule.cs:line 424
   at ICSharpCode.Decompiler.IL.ILReader.ReadAndDecodeMethodReference() in ILReader.cs:line 227
   at ICSharpCode.Decompiler.IL.ILReader.DecodeCall(OpCode opCode) in ILReader.cs:line 1705
   at ICSharpCode.Decompiler.IL.ILReader.DecodeInstruction() in ILReader.cs:line 856
   at ICSharpCode.Decompiler.IL.ILReader.ReadBlock(ImportedBlock block, CancellationToken cancellationToken) in ILReader.cs:line 520
   at ICSharpCode.Decompiler.IL.ILReader.ReadInstructions(CancellationToken cancellationToken) in ILReader.cs:line 487
   at ICSharpCode.Decompiler.IL.ILReader.ReadIL(MethodDefinitionHandle method, MethodBodyBlock body, GenericContext genericContext, ILFunctionKind kind, CancellationToken cancellationToken) in ILReader.cs:line 707
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileBody(IMethod method, EntityDeclaration entityDecl, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 1703
-- continuing with outer exception (ICSharpCode.Decompiler.DecompilerException) --
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileBody(IMethod method, EntityDeclaration entityDecl, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 1761
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompile(IMethod method, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 1609
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.<>c__DisplayClass73_0.<DoDecompile>g__DoDecompileMember|0(IEntity entity, RecordDecompiler recordDecompiler, PartialTypeInfo partialType) in CSharpDecompiler.cs:line 1484
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompile(ITypeDefinition typeDef, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 1347
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompileTypes(IEnumerable`1 types, DecompileRun decompileRun, ITypeResolveContext decompilationContext, SyntaxTree syntaxTree) in CSharpDecompiler.cs:line 622
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileTypes(IEnumerable`1 types) in CSharpDecompiler.cs:line 921
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.<>c__DisplayClass50_0.<WriteCodeFilesInProject>b__5(IGrouping`2 file) in WholeProjectDecompiler.cs:line 302
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) in offset 259
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in offset 17
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source) in offset 0
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) in offset 607
   at System.Threading.Tasks.TaskReplicator.Replica.Execute() in offset 35

Details

  • Product in use: ILSpy
  • Version in use: 10.0 Preview 1

The file I'm trying to extract is obfuscated with Eziriz .NET Reactor. I can extract it in this state, but it's not useful for me.
After deobfuscating it with .NETReactorSlayer, the code is largely corrected, but I get the error above when I try to save it as a project with ILSpy.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions