3 ms·
Tell HN: All macOS executables in /sbin start with 'cafe babe'
find /sbin -type f -print0 | xargs -0 -I{} bash -c "xxd {} | head -n 1"
And get:
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0003 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
00000000: cafe babe 0000 0002 0100 0007 0000 0003 ................
At least on Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:19 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T8103 arm64
- sph 3y agohttps://en.wikipedia.org/wiki/Mach-O#Multi-architecture_binaries https://en.wikipedia.org/wiki/Mach-O#Multi-architecture_bina... It was previously 0xfeedface. Personally, I quite like 0xdeadbeef (I'm not vegetarian), less morbid than 0xdeadbabe anyway.
- jdsalaro 3y agoThis is hilarious:D
- thesuperbigfrog 3y agoThey probably are not Java bytecode despite using the same magic number: https://en.wikipedia.org/wiki/Java_class_file https://en.wikipedia.org/wiki/Java_class_file
- beardyw 3y agoI hope they are. Or else what is the use of a magic number?
- keepamovin 3y agoCool story: http://radio-weblogs.com/0100490/2003/01/28.html http://radio-weblogs.com/0100490/2003/01/28.html
- cpach 3y agoAFAICT the magic number here is cafe babe 0000 0002 0100 0007 0000 0003.
- thesuperbigfrog 3y agoYes. The same magic number (0xCAFEBABE) is being used for Java bytecode and Mach-O Multi-architecture binaries: https://en.wikipedia.org/wiki/Java_class_file https://en.wikipedia.org/wiki/Java_class_file https://en.wikipedia.org/wiki/Mach-O#Multi-architecture_binaries https://en.wikipedia.org/wiki/Mach-O#Multi-architecture_bina...