{"id":12289,"date":"2015-09-15T12:09:07","date_gmt":"2015-09-15T16:09:07","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=12289"},"modified":"2025-07-08T21:53:42","modified_gmt":"2025-07-09T01:53:42","slug":"parsing-mach-o-files","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/09\/15\/parsing-mach-o-files\/","title":{"rendered":"Parsing Mach-O Files"},"content":{"rendered":"<p><a href=\"http:\/\/lowlevelbits.org\/parse-mach-o-files\/\">Alex Denisov<\/a>:<\/p>\n<blockquote cite=\"http:\/\/lowlevelbits.org\/parse-mach-o-files\/\">\n<p>Mach-O doesn&rsquo;t have any special format like XML\/YAML\/JSON\/whatnot, it&rsquo;s just a binary stream of bytes grouped in meaningful data chunks. These chunks contain a meta-information, e.g.: byte order, cpu type, size of the chunk and so on.<\/p>\n<p>Typical Mach-O file (corresponding to the <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/DeveloperTools\/Conceptual\/MachORuntime\/index.html\">official documentation<\/a>) consists of a three regions[&#8230;]<\/p>\n<p>[&#8230;]<\/p>\n<p>OS X doesn&rsquo;t provide us with any <code>libmacho<\/code> or something similar, the only thing we have here - a set of C structures defined under <code>\/usr\/include\/mach-o\/*<\/code>, hence we need to implement parsing on our own. It might be tricky, but it&rsquo;s not that hard.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Alex Denisov: Mach-O doesn&rsquo;t have any special format like XML\/YAML\/JSON\/whatnot, it&rsquo;s just a binary stream of bytes grouped in meaningful data chunks. These chunks contain a meta-information, e.g.: byte order, cpu type, size of the chunk and so on. Typical Mach-O file (corresponding to the official documentation) consists of a three regions[&#8230;] [&#8230;] OS X [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-07-09T01:53:44Z","apple_news_api_id":"20760dde-6ccd-41ea-b19b-05873b1f5ab3","apple_news_api_modified_at":"2025-07-09T01:53:44Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AIHYN3mzNQeqxmwWHOx9asw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[45,31,30,2792,74,71],"class_list":["post-12289","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-c","tag-ios","tag-mac","tag-mach-o","tag-opensource","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/12289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=12289"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/12289\/revisions"}],"predecessor-version":[{"id":12290,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/12289\/revisions\/12290"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=12289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=12289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=12289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}