Obfuscated
C code
ob.fus.cate [LL obfuscatus, pp. of obfuscare] 1 a: darken b: to make
obscure 2: confuse.
Code obfuscation means applying a set of transformations to a program,
preserving its black box specification in order to make it more difficult
to reverse-engineer.
Generally, obfuscated code is source code that has been made very difficult
to read and understand. “Obfuscators” achieve this by altering
the structure that makes a program human-readable. They also use macro
pre-processors to mask the standard syntax and grammar from the main
body of code.
Obfuscations can also create artistic effects through keyword substitutions
or the use, or non-use, of white space.
Obfuscated C Codes are highly creative examples of coding employing
the “C” programming language. These programs combine an
executable function with an aesthetic quality of the source code. Since
1984 there have been programming contests such as the “International
Obfuscated C Code Contest” in which the best programmers worldwide
compete. The challenge is to employ programming languages like C, C++
and Perl under particularly restrictive rules but in an extremely creative
way. The obfuscated C code contest rules are quite simple - “Write,
in 512 bytes or less, the worst complete C program”.
The aims of the contest are to present the most obscure and obfuscated
C program, to demonstrate the importance of ironic programming style,
to give prominence to compilers with unusual code and to illustrate
the subtleties of the C language.
Winner
of the International Obfuscated C Code Contest 2000
Don
Yang won the IOCCC in 2000 in the “best layout category”
with the Saitou Hajime code. This program generates a set of mutually
reproducing programs which all have a different layout. The Saitou.C
code is written in the shape of the face of Saitou Hajime, a Japanese
samurai and manga star. The program, when executed, is able to generate
a further program, which can then also be executed. The three following
source code files have the shape of the words “aku”, “soku”
and “zan” (sin, swift, slay) which are Saitou’s motto.
Winner
of the International Obfuscated C Code Contest 1998
This
example of obfuscated C code was the winning entry in the 1998 “International
Obfuscated C Code Contest” (IOCCC), in the “Best of Show”
category.
It is a flight simulator done in 1536 bytes of real code. The code,
if executed, enables the user to pilot a Piper Cherokee airplane through
different landscapes.
The program has only 2 kilobytes of code, with accurate 6-degree-of-freedom
dynamics, loadable (3D) wireframe scenery and a small instrument panel;
it runs on Unix-like systems with X Windows.
A special highlight is the layout aesthetic - the source code of the
program draws the shape of an airplane. This was written in the ANSI
C programming language. Form and content are a unity, so we could call
it literature. Or is it just a technical game? Once compiled and executed,
it is a three-dimensional wireframe flight simulator. The aircraft is
a subjective view, and the scenario being explored is read from another
file.