Skip to content

ModuleDefinition.ReadModule can throw many (possibly) unexpected exceptions #556

Open
@Metalnem

Description

@Metalnem

ModuleDefinition.ReadModule can throw many (possibly) unexpected exceptions when reading modules from the attached archive. These are:

  • ArgumentNullOrEmptyException
  • ArgumentOutOfRangeException
  • AssemblyResolutionException
  • IndexOutOfRangeException
  • NullReferenceException
  • OverflowException

ModuleDefinition.ReadModule usually throws BadImageFormatException, NotImplementedException, and NotSupportedException when attempting to read malformed modules, so I'm not really sure which exceptions are really expected. You can run the following code to reproduce this (the path variable should contain the path to one of the extracted files):

ModuleDefinition.ReadModule(path, new ReaderParameters(ReadingMode.Immediate));

Found via SharpFuzz.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions