kaitai_struct_formats icon indicating copy to clipboard operation
kaitai_struct_formats copied to clipboard

MachO parser can't handle fat binaries

Open mikehearn opened this issue 2 years ago • 3 comments

MachO files can be effectively glued together with a small header that indicates this has happened, Apple calls this a "fat" binary.

https://www.symbolcrash.com/2019/02/26/mach-o-universal-fat-binaries/

The current mach_o.ksy doesn't know about this and also doesn't check the magic at the start, so just crashes when trying to read a fat binary.

mikehearn avatar Jun 16 '22 18:06 mikehearn

I suppose the pull request #515 should add support for the "fat" format.

generalmimon avatar Jun 16 '22 18:06 generalmimon

Ah! Thank you! I did search but didn't find that PR, I think I was spelling MachO / Mach-O differently :/

That PR does indeed look like what's needed. Any reason it wasn't merged, or just waiting review?

mikehearn avatar Jun 16 '22 18:06 mikehearn

Any reason it wasn't merged, or just waiting review?

Just awaiting review.

generalmimon avatar Jun 16 '22 18:06 generalmimon

Is there a Kaitai maintainer capable of reviewing that PR? I'm another potential user of it.

I can also do a review as an independent user (one who's intimately familiar with Mach-O), but I figured I'd hold off until someone from the project itself can chime in.

woodruffw avatar Sep 21 '22 19:09 woodruffw

FWIW I've been using it for a while now and it seems to work fine.

mikehearn avatar Sep 22 '22 07:09 mikehearn

Resolved by https://github.com/kaitai-io/kaitai_struct_formats/pull/515

generalmimon avatar Oct 01 '22 12:10 generalmimon