m4b / goblin

An impish, cross-platform binary parsing crate, written in Rust
MIT License
1.2k stars 160 forks source link

elf: Handle SHN_XINDEX for strtab section index (#304) #316

Closed tux3 closed 2 years ago

tux3 commented 2 years ago

This attempts to fix #304.
With this patch, I no longer reproduce the issue using the same large object file that triggered it before.

I've also updated the test code to handle XINDEX for the strtab, however I don't know a good way to generate a test case for an ELF file with >=2^16 sections without embedding a very large blob, so I've left it for future work.
(If I've missed a simple way to do this, happy to do it now)

m4b commented 2 years ago

And thank you for stepping up and fixing that issue!

m4b commented 2 years ago

released in 0.5.3 on crates; thanks for fixing this @tux3!