sectionHeaderEntryToB...: use struct.pack instead of manual int writing
_parseDynamicSymbol: use struct.unpack_from() instead of manual parsing
parseElf: struct.unpack instead of manual int parsing

Shorter. Easier to read and verify.
generateElf: use struct.pack instead of manual integer writing
generateElf: while+append -> if+extend; simpler writing