private void ReadSectionOffsets(IFileFormatReader elfReader) { var sectionByName = (IDictionary)elfReader.GetType().BaseType.GetField("sectionByName", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(elfReader); sectionOffsets = new Dictionary <string, ulong>(); foreach (DictionaryEntry sectionKeyValue in sectionByName) { var value = sectionKeyValue.Value; ulong offset = (ulong)value.GetType().GetField("sh_offset").GetValue(value); sectionOffsets.Add((string)sectionKeyValue.Key, offset); } }