konrad-kruczynski / elfsharp

Pure managed C# library for reading ELF, UImage, Mach-O binaries.
https://elfsharp.it
Other
150 stars 56 forks source link

Sections / segments count #60

Closed dnezamaev closed 4 years ago

dnezamaev commented 4 years ago

Hi. Cannot find way to get number of sections and segments count. Looks like they are stored in sectionHeaderEntryCount and segmentHeaderEntryCount, but fields are private and have no getters. Is there another way to get info? If no, suggesting to add public getter to all data from global elf header =)

konrad-kruczynski commented 4 years ago

Hi @dnezamaev, I have just implemented and committed a small improvement. Sections and Segments properties are now of type IReadOnlyList instead of IEnumerable, so now you should be able to get sections count easily by elf.Sections.Count.

konrad-kruczynski commented 4 years ago

This should soon be available on nuget as version 2.5.