Abstract out the Mach-O Header and refactor the majority of Mach-O processing to not depend on a specific MachO Header #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a precursor to Vector35/binaryninja-api#290, Vector35/binaryninja-api#3176, and Mach-O kernelcache parsing (which does not have an associated issue.). It makes no changes to the actual processing output.
This should not interfere with Vector35/binaryninja-api#133, and primarily paves the way for subclasses of MachOView to not duplicate code. It also makes it possible to provide a "Load Everything" option not dependent on Container support.
It adds a new
MachOHeader
struct which houses all relevant info for a given Mach-O Header.These are built using the old MachOView constructor code, refactored to support loading an arbitrary amount of headers from provided addresses, at any point.
They are then initialized using the old Initialization code, which was also refactored for the same purposes.
The entirety of the processing methods used by Init() were refactored to no longer pull info from the "main" header, and now support loading it from any arbitrary header.