eliben / pyelftools

Parsing ELF and DWARF in Python
Other
2.03k stars 512 forks source link

Exceptions on malformed ELF header contents #552

Closed sevaa closed 7 months ago

sevaa commented 7 months ago

Addresses #369, #370. Instead of infinite loops, the library will raise exceptions.

I don't know what was the original motivation for making e_shentsize and e_phentsize variable; assuming it was for some kind of vendor extensions, but if the size is less than the mandated fields, ELFFile will now throw.

sevaa commented 7 months ago

No more magic constants.