eliben / pyelftools

Parsing ELF and DWARF in Python
Other
1.99k stars 507 forks source link

Exceptions on malformed ELF header contents #552

Closed sevaa closed 4 months ago

sevaa commented 4 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 4 months ago

No more magic constants.