ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Can you read and understand C? :-))

(1/2) > >>

JoTo:
Hi,

13 Years ago in 1993 there was a special programmers contest. The goal was to write the obfuscated C-code ever written. At that time i downloaded the winner code from the contest page.

If you want to have fun, look (like me) at the code and try to understand. I am willing to admit, that until today i never have understand that pointerstew.  :D

But i promise the following:

- The program can be compiled unmodified (at least the core functionality - maybe you have to adjust some compiler instructions and/or includefiles) with a normal C-Compiler with no errors and only one ignorable warning. A "ready to build" Microsoft Visual C++ .NET 2003 solution is included in the ZIPfile.

- The program creates an understandable output in the console window. (Its a console app, so open a commandprompt window first and start it from there). I will not reveal the output, try it by yourself.  :P

Click me to see the code
--- ---// Code93.cpp

#include "stdafx.h"

rmain(int t,int _,char* a)
{
return!

0<t?
t<3?

rmain(-79,-13,a+
rmain(-87,1-_,
rmain(-86, 0, a+1 )


+a)):

1,
t<_?
rmain(t+1, _, a )
:3,

rmain ( -94, -27+t, a )
&&t == 2 ?_
<13 ?

rmain ( 2, _+1, "%s %d %d\n" )

:9:16:
t<0?
t<-72?
rmain( _, t,
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+,/+#n+,/#;\
#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/+k#;\
q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){nl]!/n{n#'; \
r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
\
n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;\
{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:
t<-50?
_==*a ?
putchar(31[a]):

rmain(-65,_,a+1)
:
rmain((*a == '/') + t, _, a + 1 )
:

0<t?

rmain ( 2, 2 , "%s")
:*a=='/'||

rmain(0,

rmain(-61,*a, "!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry")

,a+1);}

int _tmain(int argc, _TCHAR* argv[]){

rmain(1,

0,NULL

); return 0;
}


For those that don't want or can't compile the code itself, i upload a ready to run compiled windows exe too.

Have fun!
CU
JoTo

Rover:
Un-freaking real  :P

It doesn't look like there is enough text in the source to generate the output!

Weird.

jgpaiva:
Amazing!  ;D ;D ;D

f0dder:
Hehe cute...

there's plenty of obfuscated C source out there, btw. I've seen files formatted to look like x-mas trees and nuke signs and whatnot :)

allen:
I'm guessing it recurses through the verses and such, so in the source each gift only had to be typed once and reused to minimize text used in the source, but . . . man, that's amazing.

Navigation

[0] Message Index

[#] Next page

Go to full version