98byte ELF executable

use this forum to show your cool code and projects
Or show how bad you've abused the C preprocessor
Post Reply
User avatar
anna
Site Admin
Site Admin
Posts: 9
Joined: Sat Nov 16, 2024 3:11 am
Pronouns: it/its they/them she/her
OS/distro: endeavourOS
Contact:

pride flags

98byte ELF executable

Post by anna »

A whole executable program, in 98bytes, hows that happen?

Code: Select all

❯ hexdump -C a.out
00000000  7f 45 4c 46 01 01 01 00  00 00 00 00 00 00 00 00  |.ELF............|
00000010  02 00 03 00 01 00 00 00  50 80 04 08 34 00 00 00  |........P...4...|
00000020  00 00 00 00 00 00 00 00  34 00 20 00 01 00 00 00  |........4. .....|
00000030  00 00 00 00 01 00 00 00  00 00 00 00 00 80 04 08  |................|
00000040  00 80 04 08 62 00 00 00  62 00 00 00 05 00 00 00  |....b...b.......|
00000050  b0 04 b3 01 8d 0d 60 80  04 08 b2 02 cd 80 eb f0  |......`.........|
00000060  3a 33                                             |:3|
00000062

^ thats how

and it aint a lame exit 0 either, nah it actually does stuff

Code: Select all

:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3

^ very :3

Heres the source code

Code: Select all

BITS 32
org 0x08048000

ehdr:
    db 0x7f, "ELF"
    db 1, 1, 1, 0
    times 8 db 0
    dw 2
    dw 3
    dd 1
    dd _start
    dd phdr - $$
    dd 0
    dd 0
    dw 52
    dw 32
    dw 1
    dw 0
    dw 0
    dw 0

phdr:
    dd 1
    dd 0
    dd $$
    dd $$
    dd _end - $$
    dd _end - $$
    dd 5

_start:
    mov al, 4
    mov bl, 1
    lea ecx, [msg]
    mov dl, 2
    int 0x80
    jmp _start

msg: db ":3"

_end:

thanks to @GAIA for the idea of using smaller registers :3

feel free to make any optimizations or ur own version in the replies :neofox_googly:

We don't need memory safety where we are going.

  • Anna, about t����������
    Segmentation fault (core dumped)
User avatar
GAIA
Posts: 1
Joined: Sat Nov 16, 2024 6:00 pm
Pronouns: She/her

pride flags

Re: 98byte ELF executable

Post by GAIA »

meowww

User avatar
anna
Site Admin
Site Admin
Posts: 9
Joined: Sat Nov 16, 2024 3:11 am
Pronouns: it/its they/them she/her
OS/distro: endeavourOS
Contact:

pride flags

Re: 98byte ELF executable

Post by anna »

GAIA wrote: Sun Nov 17, 2024 4:19 pm

meowww

mraowww :neofox_floof:

We don't need memory safety where we are going.

  • Anna, about t����������
    Segmentation fault (core dumped)
notveddev
Posts: 3
Joined: Sat Nov 16, 2024 9:23 am

pride flags

Re: 98byte ELF executable

Post by notveddev »

what the flip? is that assembly or something? :neofox_think_googly: idk

silly
User avatar
anna
Site Admin
Site Admin
Posts: 9
Joined: Sat Nov 16, 2024 3:11 am
Pronouns: it/its they/them she/her
OS/distro: endeavourOS
Contact:

pride flags

Re: 98byte ELF executable

Post by anna »

notveddev wrote: Mon Dec 16, 2024 10:45 am

what the flip? is that assembly or something? :neofox_think_googly: idk

yeh :neofox_floof:

We don't need memory safety where we are going.

  • Anna, about t����������
    Segmentation fault (core dumped)
Post Reply