4 ms·
Basic Mach-O binary parser
- daeken 10y agoThis 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-o.c https://github.com/afrighetto/Mach-O/blob/master/parser/mach...
- invalid_name 10y agoYeah, problem is I messed up with links.
- haberman 10y agoHN 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-mcbloatface.html http://blog.reverberate.org/2016/11/07/introducing-bloaty-mc...) 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 10y agoSurely I'm gonna look on it :)