-
Notifications
You must be signed in to change notification settings - Fork 163
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
Support for lossy MachO parsing #386
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting PR, thank you! so as per the comments, I don't want to expose a parse_2
name publicly, needs to be parse
and parse_lossy
or something, with the parse_impl
getting forwarded whether it's lossy or not.
the only other consideration is whether you want to think about future lossy parsing, where a config is passed in to the lossy form, and this determines which things get dropped/ignored, etc., though that might be overkill, i don't know.
I'm also not totally sold on the lossy
name, but it's ok.
Some other random alternatives that are probably worse names:
- strict/unstrict
- infallible
all said and done lossy is probably the best name?
Elf also has a similar, but slightly orthogonal support for "lazy" parsing, which doesn't parse the whole thing, but iirc, this was ostensibly to allow infallible parsing when some parts are broken/let user decide if they want to fail or not, may want to look at that, so we have a more unified api/approach to lossy/infallible/lazy parsing?
Thanks for review, finally got around addressing your comments. Please let me know if you need anything else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test would be nice for this if you have time, otherwise lgtm
@h33p CI is failing on rustfmt |
once format fixed this is good to go |
This should be good to go now @m4b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
note: non-breaking |
released in 0.8.1 |
Made it possible to parse MachO objects in less strict manner. However, default behavior is not changed. Therefore, there now is a new function
parse_2
which accepts additional argument for lossyness.Open questions:
parse_2
could be made private.parse_2
sufficient name, or should this be called something likeparse_lossy
?from_32_2
from_64_2
onSegment
be exposed to the public? I currently have itpub(crate)
.