PDA

View Full Version : perl offuscato


Steve
18-06-2004, 10:24
Ricevo e volentieri inoltro... :D

#!/usr/bin/perl

$/='*';print map{s;\s;;g;y|HEo_asDNLmASclIeThr|RB1=;X2/+4Y.WU,:98367|;
s/U/VX/g;s/(\D)(\d+)/join("",map{$1}(0..$2-1))/eg;"$_\n"}<DATA>__END__



iIYV4 XV9
YVYVY2VY4I 4Y3
IYV3Y9V2YV4XV5YI +.*tYU6U4V3YV
12YV17X5U7V2Yi.*iYXRXR3X11V2XUV8X3UV2X
14R 9XVi.*tVR15XRX14R2X4R4X7R12XV+.*tVR2B3RMBR
9X2R5Xt=+;5=2iUR4X4R8M2BR4Xi,*tVR2BMB2M2B5MB2RB3
RBX+2=+2;6:;3IR4X2R3B6M2B3R2Xi,*iVRM14BRB2M2V=2iI
VYIi=;4:3;2XR6B2M8B2R2Xi.*iVRM19Y;IBW4M2XYi=;:5;R B
3M14B2Xi,*+VRM 2RBM14Y+;VM7RXIi=;:5=V2X3R3M8B2MXi;
*=tY2V3XR3X 2 RBM 5V+;=RB2 M3XU2VYt;:6t2Y
2VYV2RM6BX2VI +=* ;=tIY
2VY6V3M3 Bt=; 2+i= IBi+
t=2;2i; :6+ i 2t I2t2YR
M5RXV2I=;* ; = I4 Y3I4t
2IYItIt;2=V2 Y XB IVRXV
2XI;:6;+i2t5 VM 2 B R 3V3I+
,*;+3t3I t4 i 4 + i+ 2=2;
2RM3BX 2M3XI+;:6;+ it4itY U VY2
IYVIi;2 *;= 3i3t2 i2 Iiti3 +2; 4:I
VRVi=iBXVI i;: 8 ;=2+5 i3t2i2+3
=; 2*;2=2+i10 +3= ; 6VYV Ii3V2t+
;:8;+10iti+ 4= ; 2* ;2 =+2i
4+i+5i3 = 2;3:2tXY I2 YI i+=
;:5 , : 2;+17= ;2*;3+ = 2
+i2+5i5 t = ;
2:5=5;3 :10+3
i +9i +3;3 *;3=2
+=+i5t3I4 +;3:,:2,;4:;=;3:2,:4=
+8 =2 +6;
3 *:
; =4+
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5 ,8 :
2 ,* ,1
5; =+ i
t= :3 ,
10 ., .
6, 2. ,
. 10, 8:
2* :, 1 6
: =: , 1
4 .2 2 ,
., 2. ,. ,
2 :* : ,
1 7: , 10
.2 ,. 2 4
, .2 , .3
, 2: * ,1
9. 37 , .
7, 2 *, 9
., 7. 4
7, 2 *it i
t2 i5 +=+2= ;
2= i7 t2i6+i3=3
;+2i3ti7 +=5+i2
=+i*

blaze
18-06-2004, 23:04
meraviglioso :) ripropongo questo:


#!/usr/bin/perl -w * * * * * * * * * * * * * * * * * * *# camel code
use strict;

* * * * * * * * * * * * * * * * * * * * * *$_='ev
* * * * * * * * * * * * * * * * * * * *al("seek\040D
* * * * * *ATA,0, * * * * * * * * *0;");foreach(1..3)
* * * *{<DATA>;}my * * * * * * * @camel1hump;my$camel*;
* my$Camel *;while( * * * * * * <DATA>){$_=sprintf("*%-6
9s",$_);my@dromedary * * * * * 1=split(//);if(defin*ed($
_=<DATA>)){@camel1hu*m * * * *p=split(//);}while(@*dromeda
*ry1){my$camel1hump=0 * * *;my$CAMEL=3;if(defin*ed($_=shif
* * * * t(@dromedary1 * *))&&/\S/){$camel1hum*p+=1<<$CAMEL;}
* * * *$CAMEL--;if(d * efined($_=shift(@dro*medary1))&&/\S/){
* * * $camel1hump+=1 *<<$CAMEL;}$CAMEL--;i*f(defined($_=shift(
* * *@camel1hump))&&/\S/)*{$camel1hump+=1<<$CA*MEL;}$CAMEL--;if(
* * *defined($_=shift(@ca*mel1hump))&&/\S/){$c*amel1hump+=1<<$CAME
* * *L;;}$camel.=(split(/*/,"\040..m`{/J\047\1*34}L^7FX"))[$camel1h
* * * ump];}$camel.="\n";}*@camel1hump=split(/\*n/,$camel);foreach(@
* * * camel1hump){chomp;$C*amel=$_;y/LJF7\173\1*75`\047/\061\062\063*\
* * * 064\065\066\067\070/*;y/12345678/JL7F\175*\173\047`/;$_=revers*e;
* * * *print"$_\040$Camel\n*";}foreach(@camel1hu*mp){cho mp;$Camel=$_;*y
* * * * /LJF7\173\175`\047/1*2345678/;y/12345678/*JL7F\175\173\0 47`/;
* * * * *$_=reverse;print"\04*0$_$Camel\n";}';;s/\*s*//g;;eval; * eval
* * * * * *("seek\040DATA,0,0;"*);undef$/;$_=<DATA>;*s/\s*//g;( * );;s
* * * * * * *;^.*_;;;map{eval"pri*nt\"$_\"";}/.{4}/g; __DATA__ * \124
* * * * * * * *\1 * 50\145\040\165\163\1*45\040\157\1 46\040\1 *41\0
* * * * * * * * * * 40\143\141 *\155\145\1 54\040\1 * 51\155\ *141
* * * * * * * * * * \147\145\0 *40\151\156 \040\141 * *\163\16 3\
* * * * * * * * * * *157\143\ * 151\141\16 *4\151\1 * * 57\156
* * * * * * * * * * *\040\167 *\151\164\1 * 50\040\ * * *120\1
* * * * * * * * * * *45\162\ * 154\040\15 * *1\163\ * * *040\14
* * * * * * * * * * *1\040\1 * 64\162\1 * * *41\144 * * * \145\
* * * * * * * * * * *155\14 * *1\162\ * * * 153\04 * * * *0\157
* * * * * * * * * * * \146\ * * 040\11 * * 7\047\ * * * * 122\1
* * * * * * * * * * * 45\15 * * *1\154\1 *54\171 * * * * *\040
* * * * * * * * * * * \046\ * * * * 012\101\16 * * * * * *3\16
* * * * * * * * * * * 3\15 * * * * * 7\143\15 * * * * * * 1\14
* * * * * * * * * * * 1\16 * * * * * *4\145\163 * * * * * \054
* * * * * * * * * * *\040 * * * * * *\111\156\14 * * * * 3\056
* * * * * * * * * * \040\ * * * * 125\163\145\14 * * * * 4\040\
* * * * * * * * * * 167\1 * * * *51\164\1 *50\0 * * * * 40\160\
* * * * * * * * * 145\162 * * * * * * * * * * * * * * *\155\151
* * * * * * * * \163\163 * * * * * * * * * * * * * * * *\151\1
* * * * * * * 57\156\056


sostanzialmente il programma rilegge il suo stesso codice e stampa
una versione del cammello ridotta del 50%

ammirevole!

typedef_c
18-06-2004, 23:05
che perla :D

Steve
18-06-2004, 23:21
# camel code

Uhm, non gli piace la riga 24, quella con l'undef ...

blaze
19-06-2004, 09:14
http://perlmonks.thepen.com/45213.html

preso da qua, magari ho riportato male io!

Steve
19-06-2004, 09:38
http://perlmonks.thepen.com/45213.html

preso da qua, magari ho riportato male io!

Da quello non gli piace la riga 23 :D
Siccome di perl non ci capisco una favola, lascio stare :D
Pero' son dei bei codicini ;)

Progeny
19-06-2004, 10:44
The International Obfuscated C Code Contest
http://www.ioccc.org/

Qui ci sono cose veramente r0cs :D