Fun with universal binaries

December 08, 2006

Yesterday I had to debug a Mac OSX program and therefore I had to learn about how Mac Universal Binaries work.

Universal Binaries contain (most of the time) PowerPC code and Intel x86 code as well. While they could easily also feature code for other architectures, like your toaster or microwave, it usually looks somewhat like this: [Header|PowerPC|Intel]. The operating system decides which code it needs and executes the part of the file suitable for its architecture.

Now in order to see what kind of binary information is "sandwiched" in the file, there is a header, very nicely described in the Mac OS X ABI Mach-O File Format Reference.

It starts off with a "magical number", that funnily reads 0xCAFEBABE in hexadecimal. -- Cafe babe? Yup.

Cafebabe

Looks like the programmers had some fun coming up with a readable magic number. :)

For a more in-depth explanation of how universal binaries look like, I recommend this blog post.

(thanks to the t-shirt model ;) )

Was this helpful? Buy me a coffee with Bitcoin! (What is this?)

Updating Adobe Flash Without Restarting Firefox

No reason for a Flash upgrade to shut down your entire browser, even if it claims so.It's 2015, and the love-hate relationship of the Web...… Continue reading

Reddit's Fail-Alien (or "Fail-ien?")

Published on January 15, 2015