IndexOutOfRange exception
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- reverse-engineering
Research direction
Reproduce the failure with ILSpyCmd 11.1.0.9782, using the packed sample and the reported -il -o ./disasm command. Start in ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs at WriteParameters line 1147 and DisassemblePropertyHeaderInternal line 1456; done means the affected child CIL components no longer terminate with either reported exception.
Written by the indexing model from the issue text.
Description
Steps to reproduce
I've encountered an error using ILSpyCmd to disassemble CIL components of this packed sample from VirusTotal: https://www.virustotal.com/gui/file/ee38d2feb95a01c192ef7b60631b78e6feab9360a0af2fc2d0518c68a63686c6/details
I've unpacked the exe, deobfuscated the CIL components with DE4Dot, and tried to disassemble them with ILSpyCmd using ilspycmd -il -o ./disasm path/to/exec.
Error message shown
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Collections.Immutable.ImmutableArray`1.get_Item(Int32 index)
at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.WriteParameters(MetadataReader metadata, IEnumerable`1 parameters, MethodSignature`1 signature) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 1147
at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.DisassembleMethodHeaderInternal(MetadataFile module, MethodDefinitionHandle handle, MetadataGenericContext genericContext) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 305
at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.DisassembleMethod(MetadataFile module, MethodDefinitionHandle handle) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 159
at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.DisassembleType(MetadataFile module, TypeDefinitionHandle type) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 1688
at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.WriteModuleContents(MetadataFile module) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 2203
at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.ShowIL(String assemblyFileName, TextWriter output) in D:\a\ILSpy\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 682
at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.<OnExecuteAsync>g__PerformPerFileAction|114_0(String fileName, <>c__DisplayClass114_0&, <>c__DisplayClass114_1&) in D:\a\ILSpy\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 368
at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.OnExecuteAsync(CommandLineApplication app) in D:\a\ILSpy\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 314
or
System.BadImageFormatException: Read out of bounds.
at System.Reflection.Throw.OutOfBounds()
at System.Reflection.Metadata.BlobReader.ReadSignatureHeader()
at System.Reflection.Metadata.Ecma335.SignatureDecoder`2.DecodeMethodSignature(BlobReader& blobReader)
at System.Reflection.Metadata.PropertyDefinition.DecodeSignature[TType,TGenericContext](ISignatureTypeProvider`2 provider, TGenericContext genericContext)
at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.DisassemblePropertyHeaderInternal(MetadataFile module, PropertyDefinitionHandle handle, MetadataReader metadata, PropertyDefinition propertyDefinition) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 1456
at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.DisassembleProperty(MetadataFile module, PropertyDefinitionHandle property) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 1428
at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.DisassembleType(MetadataFile module, TypeDefinitionHandle type) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 1711
at ICSharpCode.Decompiler.Disassembler.ReflectionDisassembler.WriteModuleContents(MetadataFile module) in /_/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs:line 2203
at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.ShowIL(String assemblyFileName, TextWriter output) in D:\a\ILSpy\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 682
at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.<OnExecuteAsync>g__PerformPerFileAction|114_0(String fileName, <>c__DisplayClass114_0&, <>c__DisplayClass114_1&) in D:\a\ILSpy\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 368
at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.OnExecuteAsync(CommandLineApplication app) in D:\a\ILSpy\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 314
depending on which child CIL component of the packed exe I'm trying to analyze.
Details
I am using ILSpyCmd version 11.1.0.9782.
- Dominant language
- C#
- Stars
- 26.6k
- Forks
- 3.8k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 76
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from icsharpcode/ILSpy
-
Tests
Difficulty 4/5 3-5 days Newbie friendliness 48/100
icsharpcode/ILSpy#4262 ·
Maintainers usually reply within 1 day
-
In disassembly, scrollbar window should be greater than scrollbar unitPossibly taken @christophwille claimed this 4 days ago. OpenBug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
icsharpcode/ILSpy#4219 · 1 comment ·
Maintainers usually reply within 1 day
-
Shift+MouseWheel (horizontal scrolling) moves in pixel incrementsPossibly taken @christophwille claimed this 4 days ago. OpenEnhancement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
icsharpcode/ILSpy#4173 · 4 comments ·
Maintainers usually reply within 1 day
-
WPF project export misses the transitive references the XAML markup compiler needsPossibly taken @LiquidSnake0 claimed this 8 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 68/100
icsharpcode/ILSpy#4155 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
icsharpcode/ILSpy#4151 ·
Maintainers usually reply within 1 day
All issues in icsharpcode/ILSpy
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
KnifeLemon/Filee#294 ·
Maintainers usually reply within 1 day
-
応募に出す、展示スペースの図面を作るOpenmtg-decide submission
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Fialuxe/MouthOfGod_System#288 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
gavin-wolfe/wolfden#104 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
[BUG] Still libmicrohttpd dependency is not removed properly from External-Dependency-Info.txt filePossibly taken A pull request linked to this issue is open or already merged. Opentype/bug
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day