[techtalk] Code Snippit - Nifty.

Chris J/#6 sixie at nccnet.co.uk
Thu Dec 9 23:50:39 EST 1999


I'm slowly decoding this - it's actually not too bad. It shows the power (and 
potential complexity) of the ?: operator. It's also showing recursion of 
main(). It's also showing main() to have non-standard arguments (ie, instead 
of:
	main (int argc, char **argv, char **envp)
it uses:
	main (int t, int _, char *a)

Where t, _, and a I haven't (yet) worked out precisely what they do :) 't' 
and '_' control the decoding of the message string, where 'a' is a pointer 
into them message string. On initialisation, t = 1 (it is essentially argc, 
and a program with no parameters has argc set to 1).

The only left to work out, really, is the encryption of the string. Got a few 
clues from observation, but rest I need to work out :)

Chris...

> Completely benign, with fun output. Ouch at the obfuscation. Courtesy
> of my kid brother.
> 
> -Ian
> 
> #include <stdio.h>
> int main(int t,int _,char *a)
> {return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
> main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94, -27+t, a
> )&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main(_,
> 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;# ){n\
> l]!/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(a[31]):main(-65,_,a+1):main((*a == '/')+t,_,a\
> +1 ):0<t?main ( 2, 2 , "%s"):*a=='/'||main(0,main(-61,*a, "!ek;dc \
> i at bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}
> 
> 
> --
> <cosmo> wow, this is kinda nifty. the Win98 protocol stack is like a chinese puzzle, twist and turn in the right places, and it pops right off.
>                                                                    -Seen on EFNet IRC
> 
> 
> 
> ************
> techtalk at linuxchix.org   http://www.linuxchix.org
> 

-- 
@}-,'--------------------------------------------------  Chris Johnson --'-{@
    / "(it is) crucial that we learn the difference / sixie at nccnet.co.uk  \
   / between Sex and Gender. Therein lies the key  /                       \ 
  / to our freedom" -- LB                         / www.nccnet.co.uk/~sixie \ 



************
techtalk at linuxchix.org   http://www.linuxchix.org




More information about the Techtalk mailing list