YOLO – collection of applications that live only once.

YOLO, is one of the most weird Github repositories I know. The repo contains a bunch of simple application that destroys theirself if the source code is executed. It could be a modern art or philosophy statement or it could be a gush of a really really bored programmer. My favorite is Ruby. Just three lines to delete itself.

Examples

Java

import java.io.File;

public class Yolo {
    public static void main(String[] args) {
        System.out.println("YOLO!");
        File file = new File("./" + (new Yolo()).getClass().getName().replaceAll("\.", "/") + ".class");
        file.delete();
    }
}

Ruby (the king of self-destruction)

#!/usr/bin/env ruby
puts "YOLO!"
File.delete __FILE__

Assembler

section .text
    global _start
    _start:

    mov rax, 1  ; 1 = system call for write
            ; (see arch/x86/include/generated/uapi/asm/unistd_64.h
            ; for more syscalls)
    mov rdi, 1  ; 1 = stdout
    mov rsi, msg    ; YOLO :DDD
    mov rdx, len
    syscall

    mov rax, 87 ; unlink
    pop rcx     ; rcx first points to argc, we do not want this.
    pop rcx     ; rcx now points to argv (or just argv[0]...)
    mov rdi, rcx
    syscall

    mov rax, 60 ; 60 = system call for exit
    xor rdi, rdi    ; exit status 0
    syscall

section .data

msg db  "YOLO", 10  ; 10 = 0x0a = "n"
len equ $-msg

Schreibe einen Kommentar

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s