MACHO: Section class inconsistency
Both load commands and segments have an associated data field with the underlying raw data. Why not expose one for the section, that would have the underlying raw data used to parse the section from?
Does sections are mandatory in a MachO File ?
You can have a binary without sections, like the micro_macho has shown. But if you do have sections, I'd like to have access to the raw data of it, without reparsing myself, from the segment raw data.
I'm not sure to understand your question
How would you calculate the entropy of a particular section header?
I'm asking to add a data field to the MachO.Section class that will hold the underlying raw data of the section.
I suggest to not add an attribute since it would be a duplication of the other attributes. Instead we could have a method let's say raw_header that would return the same raw as:
https://github.com/lief-project/LIEF/blob/master/src/MachO/Builder.tcc#L87-L95