<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>mikeash.com pyblog/friday-qa-2012-11-30-lets-build-a-mach-o-executable.html comments</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-11-30-lets-build-a-mach-o-executable.html#comments</link><description>mikeash.com Recent Comments</description><lastBuildDate>Mon, 17 Aug 2026 10:14:50 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Rasmus - 2014-05-08 11:11:26</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-11-30-lets-build-a-mach-o-executable.html#comments</link><description>LC_SOURCE_VERSION is used, for example, used by CrashReporter in the "Version" field of crash reports for processes that lack an Info.plist (typically Unix commands like /bin/ls), so I guess it's the version of the source code used to build the binary.</description><guid isPermaLink="true">12fc342a0de315b63d4e7ec0dd434cf2</guid><pubDate>Thu, 08 May 2014 11:11:26 GMT</pubDate></item><item><title>Liu - 2012-12-21 22:16:20</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-11-30-lets-build-a-mach-o-executable.html#comments</link><description>nice one. I'm actually doing something similar, but only crafting a bare bone Mach-O binary. check it out: &lt;a href="http://blog.softboysxp.com/post/38426183643/a-minimal-mach-o-x64-executable-for-os-x-mountain-lion"&gt;http://blog.softboysxp.com/post/38426183643/a-minimal-mach-o-x64-executable-for-os-x-mountain-lion&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;also an earlier version that doesn't even require dyld: &lt;a href="http://blog.softboysxp.com/post/7688131432/a-minimal-mach-o-x64-executable-for-os-x"&gt;http://blog.softboysxp.com/post/7688131432/a-minimal-mach-o-x64-executable-for-os-x&lt;/a&gt;</description><guid isPermaLink="true">a1436357196c8ead973fc78386c30df8</guid><pubDate>Fri, 21 Dec 2012 22:16:20 GMT</pubDate></item><item><title>Gwynne Raskind - 2012-12-01 00:45:40</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-11-30-lets-build-a-mach-o-executable.html#comments</link><description>Oh, and &lt;code&gt;dyldinfo&lt;/code&gt; and its source code.</description><guid isPermaLink="true">f94e87cc10025113c414f9815be39adf</guid><pubDate>Sat, 01 Dec 2012 00:45:40 GMT</pubDate></item><item><title>Gwynne Raskind - 2012-12-01 00:41:46</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-11-30-lets-build-a-mach-o-executable.html#comments</link><description>&lt;b&gt;SSteve&lt;/b&gt;: A whole list of sources. The Mach-O Reference from Apple's dev docs is one, I meant to link to it in the article but forget :(. I also made extremely heavy use of the &lt;code&gt;mach-o/{nlist,loader,fat,stab}.h&lt;/code&gt; headers, &lt;code&gt;otool&lt;/code&gt;, &lt;code&gt;dsymutil&lt;/code&gt;, &lt;code&gt;dwarfdump&lt;/code&gt;, &lt;code&gt;unwinddump&lt;/code&gt;, &lt;code&gt;hexdump&lt;/code&gt;, and the Hopper Disassembler. In short, I tore the binary Clang generated apart from every possible direction and stitched it back together one piece at a time :)</description><guid isPermaLink="true">ae17749a89fa974d508a08e32e1f08f0</guid><pubDate>Sat, 01 Dec 2012 00:41:46 GMT</pubDate></item><item><title>Gwynne Raskind - 2012-12-01 00:38:50</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-11-30-lets-build-a-mach-o-executable.html#comments</link><description>&lt;b&gt;nevym&lt;/b&gt;: You're welcome :). I'm hoping to update the article, or post a part 2, with a fully working executable.
&lt;br /&gt;
&lt;br /&gt;As for your nits, that was supposed to be "stdio.h" and "time.h", but Mike and I forgot to HTML-escape them. Your spelling correction is, of course, correct! I'm sure Mike will take care of both as soon as he reads the comment. &lt;i&gt;Right, Mike?&lt;/i&gt; ;)</description><guid isPermaLink="true">c13be47a17b36588f45323b40e560e39</guid><pubDate>Sat, 01 Dec 2012 00:38:50 GMT</pubDate></item><item><title>SSteve - 2012-12-01 00:37:44</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-11-30-lets-build-a-mach-o-executable.html#comments</link><description>What a huge, opaque, mass (or mess) of data! Where do you even go to find out all this stuff?</description><guid isPermaLink="true">92926a488ec1ff279cf67c2e1d757f81</guid><pubDate>Sat, 01 Dec 2012 00:37:44 GMT</pubDate></item><item><title>nevyn - 2012-11-30 22:41:35</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-11-30-lets-build-a-mach-o-executable.html#comments</link><description>Whew! That's an awesome amount of information, looking forward to returning to it for reference. Thanks!
&lt;br /&gt;
&lt;br /&gt;(some nitpics: "#include and #include" -&amp;gt; "#include and #import" I assume; "or prefex tree" -&amp;gt; "or prefix tree")</description><guid isPermaLink="true">8f546588a8504e86f6967af89a9335cb</guid><pubDate>Fri, 30 Nov 2012 22:41:35 GMT</pubDate></item></channel></rss>
