Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

link goes to parking domain; so point to web.archive.org instead
Source Link
Joshua
  • 3.5k
  • 1
  • 22
  • 25

x86 ELF executable, 45 bytes

Unlike the vast majority of these answers, this is a truly complete program, as in a free-standing executable program.

00000000: 7f45 4c46 0100 0000 0000 0000 0000 0100 .ELF............
00000010: 0200 0300 2000 0100 2000 0100 0400 0000 .... ... .......
00000020: ebfe 31c0 40cd 8000 3400 2000 01 [email protected]. ..

The guts of the program are at byte 0x20 ebfe, which is featured in another answer as the smallest NASM program. If you assemble that with NASM however, you get an executable with thousands of un-needed bytes. We can get rid of most of them using the technique outlined here here. You may note that this program isn't even as big as the ELF header! This bit of executable golfing malforms the ELF header and program header so they can occupy the same bytes in the file and inserts our program into some unused bytes within the header. Linux will still happily read the header and start execution at offset 0x20 where it spins forever.

x86 ELF executable, 45 bytes

Unlike the vast majority of these answers, this is a truly complete program, as in a free-standing executable program.

00000000: 7f45 4c46 0100 0000 0000 0000 0000 0100 .ELF............
00000010: 0200 0300 2000 0100 2000 0100 0400 0000 .... ... .......
00000020: ebfe 31c0 40cd 8000 3400 2000 01 [email protected]. ..

The guts of the program are at byte 0x20 ebfe, which is featured in another answer as the smallest NASM program. If you assemble that with NASM however, you get an executable with thousands of un-needed bytes. We can get rid of most of them using the technique outlined here. You may note that this program isn't even as big as the ELF header! This bit of executable golfing malforms the ELF header and program header so they can occupy the same bytes in the file and inserts our program into some unused bytes within the header. Linux will still happily read the header and start execution at offset 0x20 where it spins forever.

x86 ELF executable, 45 bytes

Unlike the vast majority of these answers, this is a truly complete program, as in a free-standing executable program.

00000000: 7f45 4c46 0100 0000 0000 0000 0000 0100 .ELF............
00000010: 0200 0300 2000 0100 2000 0100 0400 0000 .... ... .......
00000020: ebfe 31c0 40cd 8000 3400 2000 01 [email protected]. ..

The guts of the program are at byte 0x20 ebfe, which is featured in another answer as the smallest NASM program. If you assemble that with NASM however, you get an executable with thousands of un-needed bytes. We can get rid of most of them using the technique outlined here. You may note that this program isn't even as big as the ELF header! This bit of executable golfing malforms the ELF header and program header so they can occupy the same bytes in the file and inserts our program into some unused bytes within the header. Linux will still happily read the header and start execution at offset 0x20 where it spins forever.

Commonmark migration
Source Link

#x86 ELF executable, 45 bytes

x86 ELF executable, 45 bytes

Unlike the vast majority of these answers, this is a truly complete program, as in a free-standing executable program.

00000000: 7f45 4c46 0100 0000 0000 0000 0000 0100 .ELF............
00000010: 0200 0300 2000 0100 2000 0100 0400 0000 .... ... .......
00000020: ebfe 31c0 40cd 8000 3400 2000 01 [email protected]. ..

The guts of the program are at byte 0x20 ebfe, which is featured in another answer as the smallest NASM program. If you assemble that with NASM however, you get an executable with thousands of un-needed bytes. We can get rid of most of them using the technique outlined here. You may note that this program isn't even as big as the ELF header! This bit of executable golfing malforms the ELF header and program header so they can occupy the same bytes in the file and inserts our program into some unused bytes within the header. Linux will still happily read the header and start execution at offset 0x20 where it spins forever.

#x86 ELF executable, 45 bytes

Unlike the vast majority of these answers, this is a truly complete program, as in a free-standing executable program.

00000000: 7f45 4c46 0100 0000 0000 0000 0000 0100 .ELF............
00000010: 0200 0300 2000 0100 2000 0100 0400 0000 .... ... .......
00000020: ebfe 31c0 40cd 8000 3400 2000 01 [email protected]. ..

The guts of the program are at byte 0x20 ebfe, which is featured in another answer as the smallest NASM program. If you assemble that with NASM however, you get an executable with thousands of un-needed bytes. We can get rid of most of them using the technique outlined here. You may note that this program isn't even as big as the ELF header! This bit of executable golfing malforms the ELF header and program header so they can occupy the same bytes in the file and inserts our program into some unused bytes within the header. Linux will still happily read the header and start execution at offset 0x20 where it spins forever.

x86 ELF executable, 45 bytes

Unlike the vast majority of these answers, this is a truly complete program, as in a free-standing executable program.

00000000: 7f45 4c46 0100 0000 0000 0000 0000 0100 .ELF............
00000010: 0200 0300 2000 0100 2000 0100 0400 0000 .... ... .......
00000020: ebfe 31c0 40cd 8000 3400 2000 01 [email protected]. ..

The guts of the program are at byte 0x20 ebfe, which is featured in another answer as the smallest NASM program. If you assemble that with NASM however, you get an executable with thousands of un-needed bytes. We can get rid of most of them using the technique outlined here. You may note that this program isn't even as big as the ELF header! This bit of executable golfing malforms the ELF header and program header so they can occupy the same bytes in the file and inserts our program into some unused bytes within the header. Linux will still happily read the header and start execution at offset 0x20 where it spins forever.

Source Link
casey
  • 659
  • 4
  • 4

#x86 ELF executable, 45 bytes

Unlike the vast majority of these answers, this is a truly complete program, as in a free-standing executable program.

00000000: 7f45 4c46 0100 0000 0000 0000 0000 0100 .ELF............
00000010: 0200 0300 2000 0100 2000 0100 0400 0000 .... ... .......
00000020: ebfe 31c0 40cd 8000 3400 2000 01 [email protected]. ..

The guts of the program are at byte 0x20 ebfe, which is featured in another answer as the smallest NASM program. If you assemble that with NASM however, you get an executable with thousands of un-needed bytes. We can get rid of most of them using the technique outlined here. You may note that this program isn't even as big as the ELF header! This bit of executable golfing malforms the ELF header and program header so they can occupy the same bytes in the file and inserts our program into some unused bytes within the header. Linux will still happily read the header and start execution at offset 0x20 where it spins forever.

AltStyle によって変換されたページ (->オリジナル) /