Golfed binaries

since: 2007-09-13 update: 2007-09-13 count:

Collection of golfed binaries.

I defined hello world program should produce "Hello, world!\n".

58B hello for x86 linux ELF

hello_linux_elf_x86.out .

Created by kik.

You may need to run the following command to run this program.

sudo sh -c 'echo 0 > /proc/sys/vm/mmap_min_addr'

63B hello for x86 linux a.out

hello_linux_aout_x86.out .

Created by me .

104B hello for x86-64 linux ELF

hello_linux_elf_x64.out .

Created by me .

75B hello for x86 FreeBSD ELF

hello_freebsd_elf_x86.out .

Created by me . It doesn't work on recent version of FreeBSD. My environment is 4.10-RELEASE-p24r1.

97B hello for x86 Windows PE

hello_windows_pe_x86.exe , generated by this code .

Created by me , based on firewood's work .

130B hello for x86 MacOSX Mach-O

hello_macosx_macho_x86.out .

Created by me , generated by this code . Brief sketch of this code .

248B hello for PPC MacOSX Mach-O

hello_macosx_macho_ppc.out .

Created by me , referring shotaro_tsuji's work .

250B hello for JVM

Code.class . Note that the file name is very important.

Created by mame . He stripped debug information and changed println("Hello, world!") to print("Hello, world!\n") from my code, and mizu also produced 251B code .

0B hello for linux binfmt_misc

Just kidding.

i@u ~> cat > hello
echo Hello, world!
i@u ~> chmod 755 hello
i@u ~> sudo sh -c "echo ':hello:E::hello::$HOME/hello:' > /proc/sys/fs/binfmt_misc/register"
i@u ~> touch foo.hello
i@u ~> chmod 755 foo.hello
i@u ~> /bin/ls -l foo.hello
-rwxr-xr-x 1 i i 0 2007-08-27 05:28 foo.hello
i@u ~> ./foo.hello
Hello, world!

See also

A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux (or, "Size Is Everything") .

home / index

shinichiro.hamaji _at_ / shinichiro.h