-
Notifications
You must be signed in to change notification settings - Fork 226
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
Binary Ninja fails to process ELF files with corrupted sections #1686
Comments
I just ran into this as well, actually. Here a super simple repro: test.zip ELF provided, but you can make it yourself with: The most strange part is that hex view is broken under the ELF, though it looks fine under raw. Remove the |
I will look into this very soon. It needs to be fixed! |
Hey, was just wondering if there had been any updates on this issue. I'm still seeing on BinaryNinja version 2.1.2263. I recently ran into this myself when looking at a ELF that appears to have had the section headers removed by I've attached a minimal test case with this comment. The I can provide more examples if needed. Thanks! EDIT: I also attached an example where the |
I have been busy with other tasks so I have to get a chance to fix it. The good news is I already know how to fix it, just need some time to actually write the code. |
@jvinnedge-novetta, Binary Ninja is up to version |
Wow, you guys are fast! I didn't expect a reply this quick, much less on a weekend. Thanks for the pointer, I'll switch over to the dev channel and give that a shot. Thanks! |
By the way I did find another bug related to the test-mips binary. We were missing all of the imports due to some improper relocation handling. I pushed a fix for that issue in |
The library
libshella-2.9.0.2.so
in the attachments has corrupted sections such as Binary Ninja fails to load it. Generally speaking, sections are not used by ELF loaders [1] so that tools which only rely on these elements are prone to be broken on the corner cases.It would be very convenient to have the option to load ELF files by only using segments [2].
While most of the information are available with ELF segments (dynamic symbols, relocations, ...)
the tricky point is the computation of the number of dynamic symbols [3]. An example of solution is available in LIEF: Parser.tcc#L478-L527
[1] Android ELF loader added some checks on the consistency of the section table compared to the Linux ELF loader.
[2] A Linux binary can run without sections (see
ls.sectionless
in the attachments)[3] You don't have a
DT_XXX
entry that provides the dynamic symbol table sizeSamples: https://github.com/Vector35/binaryninja-api/files/4654836/samples.zip
The text was updated successfully, but these errors were encountered: