From 5657b216ae0664e68a9c330f0a33fa4ae35e20b5 Mon Sep 17 00:00:00 2001 From: Filip Jeremic Date: Sun, 1 Mar 2020 14:00:06 -0500 Subject: [PATCH] Restore saved position after reading ELF file --- BinaryTools.Elf/ElfFile.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BinaryTools.Elf/ElfFile.cs b/BinaryTools.Elf/ElfFile.cs index fae73ad..9d08681 100644 --- a/BinaryTools.Elf/ElfFile.cs +++ b/BinaryTools.Elf/ElfFile.cs @@ -130,6 +130,8 @@ public static ElfFile ReadElfFile(BinaryReader reader) var sections = new ElfSectionHeaderTable(reader, header); var segments = new ElfProgramHeaderTable(reader, header, sections); + reader.BaseStream.Position = savedPosition; + return new ElfFile(header, segments, sections); } catch (InaccessibleAddressException exception)