public static Image ReadPortablePdb(Disposable <Stream> stream, string file_name)
{
try
{
ImageReader imageReader = new ImageReader(stream, file_name);
uint num = (uint)stream.value.Length;
imageReader.image.Sections = new Section[1]
{
new Section
{
PointerToRawData = 0,
SizeOfRawData = num,
VirtualAddress = 0,
VirtualSize = num
}
};
imageReader.metadata = new DataDirectory(0u, num);
imageReader.ReadMetadata();
return(imageReader.image);
}
catch (EndOfStreamException inner)
{
throw new BadImageFormatException(stream.value.GetFileName(), inner);
}
}