Skip to content

This repository contains a database of all the winners in the IOCCC.

License

Notifications You must be signed in to change notification settings

nir-mo/ioccc-db

Repository files navigation

IOCCC Winners Database

This repository contains a database of all the winners in the International Obfuscated C Code Contest (IOCCC). The database includes information about each winner, including their source code, spoiler, hint (if available), and the year of their participation.

The information in this database was gathered from the official IOCCC repository available at https://github.com/ioccc-src/winner. We are grateful to the IOCCC community for providing this valuable collection of obfuscated C code entries.

Introduction

The International Obfuscated C Code Contest is a renowned competition that celebrates the art of writing creative, puzzling, and obfuscated C code. This database aims to provide a comprehensive collection of IOCCC winners, making it easier for enthusiasts and researchers to explore and analyze the contest's historical entries.

How to Access the Database

The IOCCC Winners Database is available in SQLite format, allowing for easy integration with various applications and programming languages. To access the database, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/nir-mo/ioccc-db.git
    
  2. Navigate to the repository directory:

    cd ioccc-db
    
  3. The SQLite database file is located at ioccc_winners.sqlite. You can use your preferred SQLite client or library to connect to the database and perform queries.

Explore the IOCCC winners DB

import pandas as pd
import sqlite3

# Connect to the SQLite database
conn = sqlite3.connect('ioccc_winners.sqlite')

# Query to select 10 rows of data from the "winners" table
query = "SELECT * FROM winners WHERE year < 1998 LIMIT 10"

# Read the table into a pandas DataFrame
df = pd.read_sql_query(query, conn)

conn.close()
df
name year spoiler prog hint
0 litmaath 1988 sorts each arg using only argc, argv, and 'whi... b'main(argc, argv)\nint\targc;\nchar\t**argv;\... Best small program:\n\n\tMaarten Litmaath\n\tF...
1 phillipps 1988 'first day of christmas', tables, heavily main... b'main(t,_,a )\nchar\n*\na;\n{\n\t\t\t\treturn... Least likely to compile successfully:\n\n\tIan...
2 reddy 1988 prints name of 'char *(*(foo[16])();', compressed b'#include<stdio.h>\n#include<ctype.h>\n#defin... Most useful Obfuscated C program:\n\n\tAmperif...
3 westley 1988 prints '3.141', circle made of '_-_-_-_' in la... b'#define _ -F<00||--F-OO--;\nint F=00,OO=00;m... Best layout:\n\n \tMerlyn LeRoy (Brian West...
4 applin 1988 massive #define stuff, includes itself; prints... b'I a\nU a\nI b\nU b\nI c\nU c\nI d\nU d\nI e\... Best of show:\n\n \tJack Applin\n\tHewlett-...
5 spinellis 1988 #include "/dev/tty" b'#include "/dev/tty"\n' Best abuse of the rules:\n\n \tDiomidis Spi...
6 robison 1988 print e in any base, uses only --, >=, and whi... b'#include <stdio.h>\nunsigned char w,h,i,l,e,... Best abuse of C constructs:\n\n \tArch D. R...
7 dale 1988 prints command line, using lots of system calls b'#define _ define\n#_ P char\n#_ p int\n#_ O ... Best abuse of system calls:\n\n \tPaul Dale...
8 isaak 1988 table driven table of the elements; cpp, self-... b'main(){}\x0c\n#define P define\n#P U ifdef\n... Best visuals:\n\n \tMark Isaak\n\tImagen Co...
9 bright 1986 hex dump, cpp compressed, uses lost of << for ... b'#include <stdio.h>\n#define O1O printf\n#def... # Most useful obfuscation \n\nWalter Bright\n\...

print the obfuscated program

westley = df[df.name == "westley"]
prog = westley.prog.values[0]

import codecs
print(codecs.decode(prog))
#define _ -F<00||--F-OO--;
int F=00,OO=00;main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO()
{
            _-_-_-_
       _-_-_-_-_-_-_-_-_
    _-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_
    _-_-_-_-_-_-_-_-_-_-_-_
        _-_-_-_-_-_-_-_
            _-_-_-_
}

How to Generate the Database

To generate the IOCCC Winners Database, follow these steps:

  1. Install the required dependencies:

    pip install -r requirements.txt
    
  2. Fetch the submodule from the IOCCC winners repository:

    git submodule update --init
    

    OR, If you encounter any issues with the submodule, you can clone the IOCCC winners repository manually into the winners directory:

    git clone https://github.com/ioccc-src/winner winners
    
  3. Run the ioccc_db/cli.py script, specifying the directory containing the IOCCC winner entries:

    python ioccc_db/cli.py --verbose --force --output_file=../ioccc_winners.sqlite --ioccc_winners_directory=ioccc/winners.directory
    
  4. The script will generate the ioccc_winners.sqlite file, which contains the SQLite database with all the winners information.

Technical Debts

The following are the known technical debts and areas for improvement in this repository:

  • Add unit tests to ensure the correctness of the database generation process.
  • Add support for hints with the encoding of Latin-1 to handle special characters and non-ASCII characters in the hint field.

License

This project is licensed under the MIT License. For more information, please refer to the LICENSE file.

About

This repository contains a database of all the winners in the IOCCC.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages