You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ruby-macho currently throws an exception (LoadCommandError) when it can't resolve a load command type to a class.
To prevent the future addition of load commands by Apple from fouling up the parser, we could allow the user to toggle more permissive behavior:
If the load command ID corresponds to a known class, instantiate that class
If the load command doesn't correspond to a known class, instantiate the generic LoadCommand class
We already hard-code this behavior for LC_PREPAGE, since Apple doesn't provide a public structure for it. This behavior could be made generic fairly easily.
The text was updated successfully, but these errors were encountered:
A potential problem: it's not really clear where to draw the line for permissive parsing -- there are lots of other little fields in a Mach-O binary that could be wrong but non-fatal (like cputype and cpusubtype). Thus, the permissive parser option needs to be opinionated: do unknown CPU types and header flag combinations cause an exception, while unknown load commands get a pass?
Decided to go with just permissive load command parsing for now (non-default, the default remains strict) -- making other fields permissive is likely to lead to lots of problems.
ruby-macho currently throws an exception (
LoadCommandError
) when it can't resolve a load command type to a class.To prevent the future addition of load commands by Apple from fouling up the parser, we could allow the user to toggle more permissive behavior:
LoadCommand
classWe already hard-code this behavior for
LC_PREPAGE
, since Apple doesn't provide a public structure for it. This behavior could be made generic fairly easily.The text was updated successfully, but these errors were encountered: