-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"ELF Number of sections >= SHN_LORESERVE (0xff00)" is not implemented in library #89
Comments
I changed the code myself. Issue solved.
|
Thanks for the input, I'll try to implement your solution. Would it be possible for you to provide a test binary? |
Hi Konrad, Thanks for the update. However, this solution does not work. Because you inserted (sectionHeaderEntryCount == 0) case into ReadSections method. However, exception occurs inside "ReadStringTable" method. (Reading string table also reads a section) When I put "(sectionHeaderEntryCount == 0)" case to the end of "ReadFields" method, it works. Sorry, but I cannot provide you the binary. First, it is very big (0.5GB). Second, it is a software of my company. Thanks for the effort... |
Right. Please check version 2.15.2. |
Konrad, v2.15.2 works good. Thank you. |
Hello,
Thx for this library.
I noticed an exception when reading an ELF file:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at ELFSharp.ELF.ELF
1.ReadSectionHeader(Int32 index) at ELFSharp.ELF.ELF
1.ReadStringTable()at ELFSharp.ELF.ELF`1..ctor(String fileName)
at ELFSharp.ELF.ELFReader.TryLoad(String fileName, IELF& elf)
at ELFSharp.ELF.ELFReader.Load(String fileName)
e_shnum (number of entries in the section header table) is 0. Then, library tries to read section index = 1... That causes exception.
After some googling, I found below:
If the number of sections is greater than or equal to SHN_LORESERVE (0xff00), this member has the value zero and the actual number of section header table entries is contained in the sh_size field of the section header at index 0. (Otherwise, the sh_size member of the initial entry contains 0.)
I believe, if the above description is implemented, the problem will be solved.
Thx,
Murat
The text was updated successfully, but these errors were encountered: