Tuesday, December 9, 2008

My potential IOCCC entry...

Let's get this blog rolling... Here's a piece of code I just wrote with the goal of obfuscating it wildly:


#include <iostream>
int i;main(){for (;i<13\
;++i){printf("%c",((("$2667\02\
6\020;7962\020£\013@\015%\""[i]%60)*2)+(i["\0\1\0\0\1\
\0\0\1\1\0\0\0\1\1\0\0\0\1\1\1\0\
\1\1\0\0\0\1\0\1\1\1\1\0\0\1\0\0\
"]?1:0)));}}///0/0/0/0/1/0/exit(0);}


It prints "Hello, world!".

Basically there are two strings, as the loop iterates they are used to calculate the final letter. I used an ascii table for this. All of these values are <60, so modulo-ing them by 60 does nothing to them. That means, go through string one and find the char with ascii value twice of the current char. If the corresponding entry in string two is true, add one to the result (this is how I fixed it to work with odd numbers as well). The \000 values are octal numbers, which i had to use for the lower numbers like the space and the !.

I don't feel like explaining more now and would much rather drink more beer.
Until next time..
-h3x

Hello World

1st!!!11one

This blog is run on code and powered by beer. It will host the various technological exploits of h3x and Ðãrk§ølø. And maybe some guest writers, nothing is yet known.



Until next time...
-h3x