
Basic Mach-O binary parser - invalid_name
https://github.com/afrighetto/Mach-O/blob/master/main.c
======
haberman
HN is funny sometimes. A 50-line C file that reads a Mach-O header hits the
front page, but last week my new tool for reading ELF/Mach-O binaries and
showing size profiles didn't.
([http://blog.reverberate.org/2016/11/07/introducing-bloaty-
mc...](http://blog.reverberate.org/2016/11/07/introducing-bloaty-
mcbloatface.html)) Oh well, c'est la vie. :)

FWIW, here is the ELF parser from Bloaty; I'm happy with how it turned out
(the first 400 lines are the ELF parser):
[https://github.com/google/bloaty/blob/master/src/elf.cc](https://github.com/google/bloaty/blob/master/src/elf.cc)

~~~
invalid_name
Surely I'm gonna look on it :)

------
daeken
This is a bit of an odd link. The linked file doesn't really do much of
anything -- just opens it and checks to make sure the magic number is valid,
essentially. The actual file reader is at
[https://github.com/afrighetto/Mach-O/blob/master/parser/mach...](https://github.com/afrighetto/Mach-O/blob/master/parser/mach-o.c)

~~~
invalid_name
Yeah, problem is I messed up with links.

