Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

IndexOutOfRange exception

Aperta
#4,203 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug Obfuscated
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.

Lingua principale
C#
Stelle
26.8k
Fork
3.8k
Merge medio
1g 3h
PR unite (30g)
66

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di icsharpcode/ILSpy

Tutte le issue di icsharpcode/ILSpy

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.