Golfed binaries

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

Collection of golfed binaries.

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

58B hello in linux ELF

hello_linux_elf_x86.out .

Created by kik.

63B hello in linux a.out

hello_linux_aout_x86.out .

Created by me .

75B hello in FreeBSD

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 in Windows

hello_windows_pe_x86.exe , generated by this code .

Created by me , based on firewood's work .

130B hello in x86 MacOSX

hello_macosx_macho_x86.out .

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

248B hello in PPC MacOSX

hello_macosx_macho_ppc.out .

Created by me , referring shotaro_tsuji's work .

250B hello in 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 in linux binfmt_misc

Just kidding.

i@u ~> cat > hello
#!/bin/sh
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_ gmail.com / shinichiro.h