Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract out the Mach-O Header and refactor the majority of Mach-O processing to not depend on a specific MachO Header #3

Closed
wants to merge 6 commits into from

Conversation

0cyn
Copy link
Member

@0cyn 0cyn commented Feb 15, 2023

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.

@0cyn
Copy link
Member Author

0cyn commented Feb 15, 2023

Diff for this is nigh-unparsable. Would recommend going commit-by-commit. Should probably not be squashed for the same reason.

@0cyn 0cyn requested a review from plafosse March 15, 2023 14:23
@0cyn
Copy link
Member Author

0cyn commented Mar 23, 2023

Merged via 05ede3d (and preceding commits)

@0cyn 0cyn closed this Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants