Ticket #167 (new enhancement)

Opened 1 year ago

Last modified 1 year ago

ELF parser improvements

Reported by: nneonneo <nneonneo@gmail.com> Assigned to: haypo
Priority: normal Milestone:
Component: parser Keywords:
Cc:

Description

Attached are some improvements to the ELF parser.

There are two attachments: one contains patches which change ElfFile? to use SeekableFieldSet?, and the other one has everything the first patch has minus SFS dependant edits.

Changes: Fix descriptions for a few fields (they were incorrect or very misleading) Fix minor technical issues (wrong padding size leading to a non-existant field being added, "align" field in the wrong place, etc.) Added many values to the enums Added "SectionHeader?32Flags" which is simply a description wrapper around UInt32, which interprets the flags given (this is NOT a bit field because the bits are stored within the value of the integer, and hence, for big-endian integers, cannot be parsed as bitfields) Added a TypeNameClass? class which is a wrapper around dict, allowing it to assume certain descriptions for large ranges of values (0x70000000 to 0xFFFFFFFF) Added some interpretation of link & info fields

SeekableFieldSet?-only changes: Added ability to read (but not yet parse) section data (interleaved with the section headers) -- parsing section data should be very simple with the modifications made Added proper names to the description; this causes some problems in Hachoir-wx (first time it loads, it skips all field between the first section header and the section header string table; refreshing the view by any means fixes it). This bug can be worked out in the future.

Note that the two patches are not meant to be applied incrementally; instead, if you like the SFS changes, apply the SFS patch, otherwise, apply the non-SFS patch.

Attachments

elf_with_sfs.diff (10.9 kB) - added by nneonneo <nneonneo@gmail.com> on 07/20/07 21:12:53.
Patch (using SeekableFieldSet?) to hachoir-parser/hachoir_parser/program/elf.py
elf_without_sfs.diff (8.8 kB) - added by nneonneo <nneonneo@gmail.com> on 07/20/07 21:13:09.
Patch (not using SeekableFieldSet?) to hachoir-parser/hachoir_parser/program/elf.py

Change History

07/20/07 21:12:53 changed by nneonneo <nneonneo@gmail.com>

  • attachment elf_with_sfs.diff added.

Patch (using SeekableFieldSet?) to hachoir-parser/hachoir_parser/program/elf.py

07/20/07 21:13:09 changed by nneonneo <nneonneo@gmail.com>

  • attachment elf_without_sfs.diff added.

Patch (not using SeekableFieldSet?) to hachoir-parser/hachoir_parser/program/elf.py

07/20/07 21:14:35 changed by nneonneo <nneonneo@gmail.com>


Add/Change #167 (ELF parser improvements)