16th IOCCC Winners Announced 147
chongo writes: "The winners of the 16th International Obfuscated C Code Contest (IOCCC) have been selected.
The judges are in the process of notifying the winners by EMail. We expect to release the source code around mid April 2002 after the winners have had a chance to review our writeup of their entries."
Here's an idea for a contest (Score:2, Interesting)
Re:Here's an idea for a contest (Score:1)
Re:Here's an idea for a contest (Score:1, Funny)
It has been done (Score:2, Informative)
Re:Here's an idea for a contest (Score:5, Informative)
Anyway, a few polyglot-related links:
With the crazy-ass language redefinition capabilities in perl 6, i think we can expect to see a resurgence in some very odd polyglots very soon..
Grrr.. mean, mean slashdot editors.. telling us the IOCCC winners were announced just so we can wait in suspense for a full month to see the entries.. bleh. I love the IOCCC..
Re:Here's an idea for a contest (Score:1)
Re:Here's an idea for a contest (Score:2, Informative)
Sorry if i was unclear.
Re:Here's an idea for a contest (Score:1)
Re:Here's an idea for a contest (Score:1, Interesting)
Cheers,
--fred
An easy way to do it in python (Score:1)
if x==z: # {
print y
x+=z
# }
(I can't get it to indent properly, everytime I hit tab IE goes to another part of the form)
Re:Here's an idea for a contest (Score:2, Funny)
Re:Here's an idea for a contest (Score:1)
Re:Here's an idea for a contest (Score:1)
A few days ago
Re:Here's an idea for a contest (Score:2)
Re:Here's an idea for a contest (Score:2)
Notified via Email (Score:4, Funny)
The Shadow Government Knows [lostbrain.com]
tcd004
Assembler (Score:4, Funny)
> around mid April 2002
Will we also get a translation in assembler to help clarify the soure code?
Re:Assembler (Score:3, Insightful)
I know you meant this as a joke in the sense of assembly language being so much more difficult than obfuscated C, but it's only funny to people who are ignorant of programming in assembly.
Back when I used to do a fair amount of assembly programming along with C, I would often run the debugger in assembly mode to see exactly what was happening. Very often I could uncover subtle bugs that way.
I don't really do it as much anymore, primarily because I'm not familiar with the assembly of my modern machines anymore (alas).
Re:Assembler (Score:2)
Actually, the only other tool I use when programming
on windows (other than the compiler.) is a disassembler.
--
Re:Assembler (Score:1)
Nah, real programmers just cat > program ; chmod +x ./program and get on with it.
--JoeRe:Assembler (Score:3, Interesting)
However, it definitely is possible to write highly obfuscated assembly, which would be far worse than anything done in C. Heck, with "db" you can do anything you want, and with an instruction set like IA32 you can do all sorts of insane things. Self-modifying code is also a lot easier in assembly.
Re:Assembler (Score:2)
-Dan
Re:Assembler (Score:2)
Yes, this is terrible for performance (it invalidates the whole trace cache) but it is correct.
Officially, Intel says you have to execute a serializing instruction in between the point of modifcation and the actual instruction, although the newer processors are smart enough to do it automatically.
I wonder if any real software actually modifies in-flight instructions? It's conceivable that an OS loading/executing a really short program on a processor which is deeply speculative could hit that case.
Re:Assembler (Score:2)
To the best of my knowledge, most common OS define text segments of processes as read & execute only.
Re:Assembler (Score:2)
Re:Assembler (Score:1)
Re:Assembler (Score:1)
Re:Assembler (Score:1)
Re:Assembler (Score:1)
> of assembly language being so much more
> difficult than obfuscated C
Yeah, it sounds funny, but on the serious side seeing some of my colleagues unreadable C code, I sometime wish they would have written straight assembler in stead of attempting to get some weird optimisation through a strange C constructs.
Plagerized? (Score:1)
These may be very good test cases for the site.
The list of who won (Score:5, Informative)
We have already had one anonymous winner request to become non-anonymous.
Re:The list of who won (Score:1)
Jeremy
Re: Fear of reprisal (Score:1)
Re: Fear of reprisal (Score:1)
He wrote (in raw machine code) a program to uudecode a text file. If that wasn't impressive enough, he limited his op-code usage to only bytes that had a text representation (32-127), so you could simply paste some text at the begging of the uuencoded data, rename it to foo.com and run it!
He's one of the few truly amazing programmers I have met.
Re:Obfuscated code contests? (Score:2)
Re:Obfuscated code contests? (Score:4, Informative)
To write the most Obscure/Obfuscated C program under the rules below.
To show the importance of programming style, in an ironic way.
To stress C compilers with unusual code.
To illustrate some of the subtleties of the C language.
To provide a safe forum for poor C code. :-)
If you use gcc, you probably have benefited from fixes of bugs those programs have helped uncover.
Silly (Score:2, Informative)
When I say I'm not much of a programmer, I mean that I'm not a programmer at all :-) I don't use gcc, but if this contest has helped to improve it, then maybe I was wrong about it. Thanks for pointing that out to me!
Re:Obfuscated code contests? (Score:1)
Kind of like Web Pages That Suck [webpagesthatsuck.com]: Where you learn good Web design by looking at bad Web design.
Re:Obfuscated code contests? (Score:2)
Re:Obfuscated code contests? (Score:2, Funny)
Re:Obfuscated code contests? (Score:1, Insightful)
Actually, its easy to write bad code which is hard to read, but much much hard to write code that is intentionally convoluted (and still functions). This contest gets some of the most knowledgable programers both submitting and reveiwing the code, so it ends up with code that is logically and syntactically far more twisted than an average bador lazy programmer could come up with.
Re:Obfuscated code contests? (Score:4, Funny)
Re:Obfuscated code contests? (Score:2, Funny)
The 1996 Winner, my favorite sentence of all time:
"Ace, watch your head!" hissed Wanda urgently, yet somehow provocatively, through red, full, sensuous lips, but he couldn't you know, since nobody can actually watch more than part of his nose or a little cheek or lips if he really tries, but he appreciated her warning."
Re:Obfuscated code contests? (Score:1)
Incidentally, one of the IOCCC winners (Brian Westley [westley.org]) had a (dishonorable) mention in the Bulwer-Lytton contest in 1999; namely, for the following:
"So far this year, Cary Yamanaka's skill in karate had netted him three trophies--two bowling, one golf."
Re:Obfuscated code contests? (Score:2)
Creating the immense amount of obfuscation seen in these code snippets requires a great deal of skill, and the people who enter this contest definitely don't code like that in the course of their normal work. (Creating code like that takes too much time, and 2 of the main programmer virtues are "laziness" and "impatience".)
Part of the Linux kernel's oddness is caused by the fact that it's a kernel. Parts are in assembly (stuff under arch/ , and possibly some device drivers) and there are more "goto"s than one might like. These are there for efficiency. Speed is much more critical in the kernel than it is in userspace, since functions may be called while another part of the kernel is holding a spinlock, etcetera.
Also, many of the IOCCC entries become much more legible if you run "gcc -E ioccc.c > preprocessed-ioccc.c && indent preprocessed-ioccc.c" . A fair number of them rely on Fancy Preprocessor Tricks to achieve maximum obfuscation. HTH,
Re:Obfuscated code contests? (Score:1)
I'm just poking fun here, but my point is: Competition is part of human nature. No matter how worthwhile, odd, unhealthy, or just plain crazy. I can't think of anything we don't compete for or about, somewhere in some culture.
I see your point, that when bad behavior is glorified, more people will behave badly, but intellect will never fully triumph over human nature (i.e., we'll never become Vulcans. But that's a good thing).
Re:Obfuscated code contests? (Score:1, Insightful)
Re:Obfuscated code contests? (Score:1)
Re:Obfuscated code contests? (Score:1)
teach people that "goto" can be very useful and a part of beautiful code, and i'd be happy.
Re:Obfuscated code contests? (Score:2, Funny)
Well, unfortunately it's not always that simple. Let's take the Shiny Metal Brute Force Crypt Cracker v3.1.9 as an example. It can crack every single password encrypted with crypt(3) [umich.edu] containing 1 to 8 lowercase latin letters. It uses a sophisticated cryptoanalysis method, which scientists call the "Brute Force". Its main purpose is to hide domain of my electronic-mail address from spammers (see my bio [slashdot.org]). Here's the source code:
#!/usr/bin/perl
#
# Shiny Metal Brute Force Crypt Cracker v3.1.9
#
# Copyright (C) 2001,2002 shiny@key.salt (shiny@output)
# http://slashdot.org/~Shiny+Metal+S./
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General
# Public License along with this program;
# if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
$x=substr$q,q,0,,q,2,if$q=q,plfeY04jaJnYI,;for
(++$_..$_<<3){qq,$q,eq crypt$_,$x and die
qq,$_.$x,for q,a,x$_..q,z,x$_}
As you can clearly see, the main algorithm used in this program (in the main loop) is able to always find every password (from the 1-8 lowercase latin characters set) but what does it mean? I had to use strong cryptography, because otherwise my electronic-mail address could be harvested by spambots (and therefore be used to perform unsolicited commercial mass mailing), but it also means, that this algorithm could be used to crack passwords from your /etc/passwd (or even from /etc/shadow),
which usually contain passwords
encrypted with crypt(3)
and this could compromise
the whole system security
(imagine hackers having
unlimited
access to your PC).
It's a very dangerous problem.
Most of password cracking tools use the,
so called,
"Dictionary Method"
to guess passwords,
which mean that you're safe as long as you have
a password like "wmctsbvg" or
"obwhdrle" or even
"awxolfrk", but this program will guess such passwords.
My point is, that it can be to dangerous
to publish a clear and well documented
source code to such a dangerous tool.
It could be used by one of many
underground
hacker groups,
like the famous
Script Kiddies [tuxedo.org],
who don't even care that reverse engineering
of this code is illegal under the DMCA.
Fortunately, this program was written in
Perl [perlcabal.com], which
was found [slashdot.org]
to be the only language,
with mathematically proved
possibility of secure one-way obfuscating
(also known as WOL - "write only language",
or WORN paradigm - "write once - read never"),
so it is impossible to reverse engineer.
The situation will be even improved when
Perl 6 [perl.org]
is released
(read Apocalypse I [perl.org],
Apocalypse II [perl.org],
Exegesis II [perl.org],
Apocalypse III [perl.org],
Exegesis III [perl.org] and
Apocalypse IV [perl.org]
for a good introduction to this subject).
That way, people can still use crypt(3) to
encrypt their passwords, with no fear that
hackers know how to crack them,
the crypt(3) encryption method is as secure as
before.
When this program will be rewriten in Perl 6,
the crypt(3) method
will be actually even
more secure than before,
thanks to the strong source code
obfuscation method.
I hope I explained where the
obfuscated code can be useful,
but this is only one example,
I'm sure there are many places where
the good old obfuscation will
be priceless for many decades.
If you have any additional questions,
feel free to contact me.
My perl is not as grand as it once was... (Score:1)
$crypt = "plfeY04jaJnYI";
$salt = substr $crypt, 0, 2;
for($i = 1; $i <= 8; ++$i) {
foreach(('a' x $i)
if($crypt eq crypt($_, $salt)) {
print "key $_, salt $salt\n"; exit 0;
}
}
}
Not very difficile, Mister shiny@rfl.pl, but I shall compliment you for at least trying to obfuscate with the silly "q//" perl operateur ^_^ For those who are onlooking, here is a short explanation of how his original code works:
$x=substr$q,q,0,,q,2,if$q=q,plfeY04jaJnYI,;
Firstly, one must recall that the q// operateur works with any delimiteurs, including the virgule (,). One need only replace q,<x>, with 'x' to see that the code becomes:
$x = substr $q, '0', '2', if $q = 'plfeY04jaJnYI';
Since perl automatically changes the strings into numbres, it is really substr $q, 0, 2 which extracts the salt from the crypt hash. The last virgule between the 2 and the if is just a ruse, since substr only uses three arguments ^_^
The "if" statement is another ruse; suffixed "if" is in fact called before the condition of the "if" statement, and he uses this to initialise $q apparently after it's been first used. The above code is in fact equal to this:
$q = 'plfeY04jaJnYI';
$x = substr $q, 0, 2;
And it makes itself apparent that $q is the crypt hash (henceforth called $crypt) and $x is the salt ($salt).
for (++$_..$_<<3){...}
Now you are just being silly
is 8. So the above is just a simple for loop:
for($i = 1; $i <= 8; ++$i) {...}
Which not only looks simpler, but runs faster too ^_^
qq,$q,eq crypt$_,$x and die
qq,$_.$x,for q,a,x$_..q,z,x$_
This one's a bit tricker, but still not very difficile. One must simple look at the end where there is another "for" loop, once again overusing the q// operateur. This causes the $_ within the loop to be local and of a different value than the $_ outside of the loop (which we have renamed to $i for clairitie). Hence the loop morphoses itself to (with parentheses added for easier reading):
foreach(('a' x $i)
$crypt eq crypt($_, $salt) and die "$_.$salt";
}
The "and die" bit just is taking advantage of the short-circuit boolean operateur système. The "die" only is executing when $crypt (the origin hash) and the encrypted form of the current guess are equal, in which case the key has been found and we quit ^_^ I changed it to a nicer looking "print" statement for further clairitie.
Hopefully that wasn't too difficile to follow, my english is not perfect. Just remember, Mr. shiny@rfl.pl, no langue is completely impenetrable (except perhaps Intercal, but that's a small bit pathological
Re:My perl is not as grand as it once was... (Score:2)
If you want to see a really good password cracking program, check out Alec Muffett [dircon.co.uk]'s great and famous Crack [dircon.co.uk]. It's really great, especially when you have good dictionaries [ox.ac.uk]. If you want to check if your password is easily cracked by Crack, you can use Alec Muffett's CrackLib [dircon.co.uk]. Check out my online Password-Guessability-O-Meter [hosting.rfl.pl], I wrote it some time ago to demonstrate to one of my clients how does the CrackLib work. You just enter your desired password, and it tells you if (and why) it is easy to guess, using English, Polish, Czech, French and Latin dictionaries.
I use CrackLib for online registrations CGI scripts etc. so users can't have silly and easy to guess passwords. It can also be used with passwd program. Great library, and easy to use (there's Crypt::Cracklib [cpan.org] Perl interface), but may be quite difficult to set up for the first time.
Thanks.I just run this benchmark:
and with Perl 5.6.1 I got this results:But in my code this loop has only eight iterations, where the 8th one takes two years, so the loop control overhead itself doesn't really matter here. The inner loop is more important but crack() function takes most of the time, anyway.
Older versions of Perl (I don't know which exactly) created a temporary array for the range operator in foreach loop, so the code like:
could easily take all of the memory, but now it's fixed. Fortunately, it doesn't create a temporary array any more, and it's highly optimized, so it's safe to use it now for large ranges. Yes, there were print and exit in the original version. You have exactly reconstructed my way of thinking. Well done.I think you're very good, really. Most of people have no idea how to analyze such obfuscated code. Actually I'm quite disappointed that decrypting my code was so easy for you... :)
I'll tell you why and how I wrote this program. I was inspired by this code:
and few JAPH signatures. I wanted to write a small program, that it would be impossible to tell what it writes, until you run it. Most of such programs are very obfuscated but after enough work you can usually find the printed message, without running them. So I thought that the message could be ciphered using some one-way alghoritm, like crypt(3) or MD5, and the code would just brute-force crack it. That way it's really impossible to tell what the message is, until you run the code. The code itself only cracks, but doesn't know what is being cracked and when it finishes. Using crypt(3) had this advantage, that it has 2-character salt, which can act as country code in domain name.So I wrote the first working version and started to make it as small as possible. Originally it didn't have to be obfuscated, just small. This is the smallest version I've written so far:
with 98 characters. But today I shrinked it some more, to 93 characters: and few minutes ago (while I write this comment!) I found a better idea and wrote this: which having only 79 characters is my record so far (thanks to Perl's magical auto-increment operator) and finally fits in one line! Your english is OK, don't worry. Actually, I like the way you use French spelling for some words, like difficile. It's like a French accent in written text, very nice in my opinion. Good point.This Unlambda program "calculates and prints the Fibonacci numbers (as lines of asterisks)":
I wanted to show a Hello world example of Brainf*** [catseye.mb.ca], but I got this error:
Visit Esoteric Topics in Computer Programming [catseye.mb.ca], great stuff if you want to go mad.You like Perl, so if you know Inline::C [cpan.org] and Inline::CPR [cpan.org] (if you don't, read Pathologically Polluting Perl [perl.com] by Brian Ingerson) you may enjoy understanding this code:
It's great, once you really understand it.Are you up to date with Perl 6 [perl.org] development? It's going to be great and extremely powerful language. Read Larry Wall's Apocalypses and Damian Conway's Exegeses if you're interested:
Re:Obfuscated code contests? (Score:2)
My personal sorry.... For whats it's worth... I woulda modded you up... Just let your Karma Suffer for now...
Bleh (Score:1, Insightful)
What was the point? (Score:1, Informative)
Try again when there's something to *see*.
Re:What was the point? (Score:1)
As opposed to posting as an AC?
what's the friggin point of posting this to slashdot NOW?
You should ask......
Sigh (Score:1)
10 minutes later and it's already /. (Score:3, Funny)
.
Re:10 minutes later and it's already /. (Score:3, Funny)
Good idea. There are so many technologies that could be used in a way that obfuscates sites; Flash, JavaScript, DHTML, tables, tag soup, box model abuse etc; unfortunately I suspect some existing and popular sites may well prove too hard to beat.
Still, could serve as a nice ironic way to point out why avoiding and abusing standards is Bad[tm].
Re:10 minutes later and it's already /. (Score:1)
http://www.teleportacia.org [teleportacia.org]
Or http://art.teleportacia.org [teleportacia.org]
Net.Art ...
GPL Abuser WINS the IOCCC CONTEST! (Score:3, Funny)
I'm still waiting for the FORTRAN contest (Score:1)
Re:I'm still waiting for the FORTRAN contest (Score:2)
Secret Society (Score:1)
Because everyone knows, grand master programmers don't need comments.
I just wish I didn't work with grand master wannabes.
Re:Secret Society (Score:2, Funny)
I sense much fear in this one. Train you, I cannot.
To Fill In Those Who Are Slashdotted (Score:4, Funny)
The winner on this years contest is Microsoft for their submission of
Microsoft Corporation End User Agreement
Contributed by an anonymous user.
Re:To Fill In Those Who Are Slashdotted (Score:2, Funny)
GPL? (Score:2)
Re:GPL? (Score:1, Insightful)
To find out whether the gobbletygook you distribute is source code or not is simple: if you normally add features to the program by editing the gobbletygook, it's source. If you instead edit the stuff that you compiled to gobbletygook and then recompile it, then the stuff you distributed isn't source and it's a clear-cut GPL violation.
Re:GPL? (Score:2)
This is so cruel... (Score:2)
We expect to release the source code around mid April 2002
To quote Homer: 40 seconds? But I want it NOW!
Any of the winners care to link to their source? (Obviously nothing would get past the lameness filter ;-)
An old anecdote (Score:5, Funny)
The highlight of the annual Computer Bowl occurred when Bill Gates, who was a judge, posed the following question to the contestants:
"What contest, held via Usenet, is dedicated to examples of weird, obscure, bizarre, and really bad programming?"
After a moment of silence, Jean-Louis Gassee (ex-honcho at Apple) hit his buzzer and answered "Windows."
Mr. Bill's expression was, in the words of one who was there, "classic."
(source [netfunny.com])
Re:An old anecdote (Score:1)
I've never ran across a video of this ACB episode, so the whole thing could be just a rec.humor.funny joke. But as they say in Italy, "Se non è vero è ben trovato" (it might not be true, but it's good anyway).
By the way, at least one guy at Microsoft seems to have a sense of humor: see this page [microsoft.com]. Here's another good one I found there:
From: johnny99@sydney.dialix.oz.au
Two computer people discussing those old stories about Bill Gates' name adding up to 666 in ASCII:
``I hear that if you play the NT 4.0 CD backwards, you get a satanic message.''
``--That's nothing. If you play it forward, it installs NT 4.0!''
winning entry (Score:2, Funny)
#define S(s)char x[]=#s;s
#define Q(x)x
#define A(x,y)y##x
#define B(x,y)A(y,x)
#define C(x,y)B(y,x)
#define Z(s,t,u)case s:if(*p!=32){t;}else{u;}break;
S(B( A( a
=0;B(A(n , i),t)s =0;B( f
w, s),i))( s){ Z( 0,t+=8 *8-00
( 2, t++
Re:winning entry (Score:2, Informative)
Look out of your good eye next time
Obfuscated Wok Contest (Score:3, Funny)
Best Abuse of User: Edward Rosten (England) - Greasy mouse
also qualifies for the Iron Chef competition. Or am I alone in thinking that Greasy Mouse sounds like some sort of England variant on Chinese/Indian cookery? *grin* (I can't wait to see this entry. I love the Abuse of User programs...)
Heads up potential employers. (Score:2, Funny)
anyone who has anything to do with IOCCC, should
be in your "not to hire" black-list.
Unless you want your project to be implemented as
a self-printing pelindromic asciiz, that has a built in tetris.
--
Nonsense. (Score:1)
Re:Nonsense. (Score:1)
Re:Nonsense. (Score:1)
Anonymous 4 (Score:2)
- Worst driver
Anonymous 4 (USA) - A driver gameHey, I didn't know Anonymous 4 [anonymous4.com] did programming too?
Har har. Anyway, compared to today's high-level languages, C is boring. Let's see some obfuscated Ruby programs.
Re:Anonymous 4 (Score:3, Funny)
Or obfuscated perl scripts. Oh, wait a minute...
Re:Anonymous 4 (Score:2)
From Tomasz Wegrzanowski ([ruby-talk:30377] [ruby-talk.org]):
$\=(?c??d:?e).chr+%Q%\n%;$,=%q=o, =;;%q{leHrow}=~/(...)(...)/;print [$1,$2].map{|l|l.reverse+%q|l|}
Showing the more Perlish side of Ruby.
I recall seeing one that calculated Pi with code of a similar quality too, along with a few quines, although I'm yet to seen an obfuscated one.
The bad news... (Score:3, Funny)
wouldn't it have been better... (Score:1)
interesting tidbit (Score:2)
Compiling Oneself? (Score:1)
What, again, is the point of a program that can compile itself? (see Best Abuse of the Rules winner)
Re:Compiling Oneself? (Score:1)
you do not need anything else to keep developing the compiler.
updated list of who won (Score:3, Interesting)
Best of Show
Most likely to amaze
Best abuse of the rules (Most complete program)
Best X11 Game
Best Short Program
Best position-independent code
Best Abuse of CPP
Best Abuse of User
Best One-Liner
Best curses Game
Most eye-crossing
Most obfuscated sound
Best primal ASCII graphics
Best AI
Worst driver
Re:Did Microsoft enter this year? (Score:4, Interesting)
There was the Bill Gates award [ioccc.org] that was given out back in 1993.
On a slightly related topic, one can use the Best Utility [ioccc.org] from 1998 to pootify Microsoft's web site for better reading. :-)