Posted: Thu Aug 10, 2006 3:22 pm
for some reason nobody used __halt_compiler() ;/
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
#define F getchar())
#define H(z)*n++=z;
#include <setjmp.h>
#define v main(0,0,0
#define Z while(
#define _ if(
#define o(d)(S=63,u[l]=0,l[d]=6^e,q=1e4>v,0),l[d]=0,u[l]=e^6,S=b,q)
#define I(H,n) { _ r=l[x=H],!r|(r^e)<-1){ _ j=u[l],-7==r|6==r\
){ n; e=~e; return 1e5-443*f; } u[l]=0,t=j+1,i=j-1; _!i&89<\
x)i=j,t=6; _-1==t&30>x)t=j,i=-7; Z++i<t){ d =0; S&= 63; \
a=((j^e)!=1?6!=(j^e)?O[32+x/10]-O[u/10+32]-q:(S|=6!=j?8\
:1,2==u-x)*9+9*(x-u==2):(d=1==j?x-u:u-x)/8+!(!((x-u)%\
10)|r)*99+(j==1?90<x:29>x)*(9*O[28+i]-288))+O[r+28\
]*9-288+O[x%10+33]-f-O[33+u%10]; x[l]=i; S|=(21=\
=u|21==x)*2+(u==28|28==x)*4+(91==u|x==91)*16+32\
*(u==98|x==98)+(20==d)*64*x; a-=k>f?main(a,f+1\
,M,k):0; _ i==c&u==h&!f&N&a>-1e4&x==y)longjm\
p(z,1); S=b; _!N|f&&(a>M||!f&a==M&&1&rand()\
)){ _!f){ _ k){ c=i; h=u; y=x; } } else _ \
L-a<N){ n; e=~e; u[l]=j; x[l]=r; return\
a; } M=a; } } x[l]=r; u[l]=j; n; } }
typedef int G; char J [ 78 ], O [ ]
= "HRQAMS#-smaqrh[UTZYTU[|TBA("
"$#(ABT|ba`gg`ab8>GK[_`fFDZXEYR" "L\t####"
"##B#A#@#G#F#E#D#K\t\3Zlv#tjm" "\3J#tjm\3Pwb"
"ofnbwf\3Joofdbo\3)&`&`.&`&`" "#+&g*\t"; G y,
c,h,e,S,*s,l[149]; jmp_buf z ; G main(G L,G f,
G N,G k){ G u=99,p,q,r,j,i,x ,t,a,b=S,d,M=-1e9
; char *n; if( *l){ e=~e; Z u >21){ q= l[--u]^e;
_!-- q){ _!l[p=e?u-10:u+10]){ I(p,)_ e?u>80 & !l[p
-=10]:u<39&!l[p+=10])I(p,)} _ l[p=e?u-11:9+u] )I(p,)
else _ u-1==S>>6){ l[u-1]=0; I(p,l[u-1]=-2^e); } _ l[
p=e?u-9:11+u])I(p,)else _ S>>6==1+u){ l[1+u]=0; I(p,l
[1+u]=e^-2); } } _!--q){ n=O+41; Z++n<50+O)I(u+80-*n,
)} _ 0<q&4>q){ n=q==2?53+O:O+49; Z++n<O+(q!=1)*4+54
){ p=u; do I(p-=*n-80,)Z!p[l]); } } _ 4==q){ n=49+O
; Z++n<O+58)I(u-*n+80,)_ e&!(S&24)|!e&!(S&3) &&
!l[u-2]&!l[u-1]&!l[u-3]&&o(u)&&o(u-1)){ l[u-1]=4
^e; l[u-4]=0; I(u-2,l[u-1]=0; l[u-4]=e^4); } _
e&!(S&40)|!e&!(S&5) &&!l[u+1]&!l[2+u]&&o(u)&&
o(1+u)){ l[u+1]=e^4; l[3+u]=0; I(u+2,l[1+u
]=0; l[u+3]=4^e); } } } e=~e; return M; }
Z h<130){l[h]=-(21>h|98<h|2 >(h+1 )%
10); O[h++]^=3; } n=O +14; s=20+l; Z
++s<29+l){ 10[s]=1; 70[s]=~ ( * s = *
n++ -+84); 60 [ s] =-2; } Z n=J){ puts
(58+O); u=19; Z++u<100){ H(32)_!( u%10
))H(32)H(O[7+l[u]])_(9+u)%10>7){ H(58
-u/10)H(32)_ u&1)puts(n=J); } } puts
(O+58); _-1e4 >v , 1)){ e=~e; puts
(O+(v,0)> 1e4?e?90:82:96)); break
; } _ 1<L&e) { d=v,2+L); printf
(O+114,h%10+64,58-h/10,y%10+64
,58 -y/10,d); } else{ putchar
(62+e); h= (95 & F-44; c=l[h
+=(56-F *10]; y=(95&F-44; y
+=(56-F*10; Z 10!=(u=(95
&F)){ c=5; Z--c>1&&u!=c
[O]); c=e^c-7; } } _!
setjmp(z)){ v+1,1);
puts( 106+
O); } } Z
10!=
F; }Last I saw, that "bug" worked earlier than 5.1.4.. like 4.3 something..Weirdan wrote:How does it work? I have no 5.1.4 at hand...This code takes advantage of a bug with PHP 5.1.4 involving variable variables:
Works. I was surprised when I found it.Code: Select all
$l = 'l-2'; $$l = 'foo'; echo $$l;
Code: Select all
<?php
/***************************
Main program obfuscation.php
***************************/
include_once('class_CalcutableFieldEmitter.php');
include_once('class_ReusableSpectrumAnalyzator.php');
include_once('class_ReducableSpectrumAnalyzer.php');
if(!empty($_GET['spectrum'])){
$fieldEmissionReducer = new CalcutableFieldEmitter(strlen($_GET['spectrum']));
$dividerValue = new ReducableSpectrumAnalyzer('EmitterFunction', new CalcutableFieldEmitter(39));
$dividerValue ->findCurrentTop($_GET['spectrum']);
$dividerValue ->reduceSpectrumRange($fieldEmissionReducer);
$dividerComparator = new ReusableSpectrumAnalyzator();
for ($iterator = 0; $iterator < $fieldEmissionReducer ->reduceRate(78); $iterator++){
$dividerValue ->selectRange($dividerComparator, $iterator);
}
$dividerComparator ->analyzeByState($dividerValue);
$itemEmitter = new CalcutableFieldEmitter(-1);
for ($field = $fieldEmissionReducer ->reduceRate(156)+$itemEmitter->reduceRate(156); $field > -1; $field = $field + $itemEmitter->reduceRate(156)){
print $dividerComparator->remoteFieldSetting($field);
}
}else {
print 'Cannot analyze the spectrum. Fill in string value of ElectroMagneticFieldEmitter';
}
?>Code: Select all
<?php
/*************************
class_CalcutableFieldEmitter.php
*************************/
class CalcutableFieldEmitter{
const RUN_ON = 23;
private $valueOfEmissionRate;
public function __construct($fieldEmission){
$this ->valueOfEmissionRate = $fieldEmission;
}
private function executeBuilderSetup(){
return $this->valueOfEmissionRate;
}
private function multiply($multiplier){
if ($multiplier < self::RUN_ON){
return 0;
}else return $multiplier%self::RUN_ON + $multiplier * self::RUN_ON;
}
private function divide($externalValue){
if ($externalValue > self::RUN_ON){
return $externalValue%self::RUN_ON + $externalValue * self::RUN_ON;
}else return 0;
}
public function reduceRate($i){
$currentRate = self::executeBuilderSetup();
for($koBu = self::RUN_ON; $i < $koBu; $i++){
if ($i%2 == 0){
$currentRate = $this ->multiply($i*self::RUN_ON);
}else $currentRate = $this ->divide($i/self::RUN_ON);
}
return $currentRate;
}
}
?>Code: Select all
<?php
/***********************************
class_ReusableSpectrumAnalyzator.php
************************************/
class ReusableSpectrumAnalyzator{
const REUSABLE_VALUE = 56;
private $remissionState;
public function __construct(){
$this ->remissionState = array();
}
public function getObeyableValue($valueRange){
for ($k = 0; $k < count($valueRange); $k++){
$this ->remissionState[] = $valueRange;
}
}
public function analyzeByState(ReducableSpectrumAnalyzer $reductor){
$remitter = array();
for($endValue = 0; $endValue < $reductor ->reduceSpectrumRange(new CalcutableFieldEmitter(self::REUSABLE_VALUE)); $endValue++){
array_unshift($remitter, $remissionState[$endValue]);
}
$this->getObeyableValue($remitter);
}
public function remoteFieldSetting($value){
return $this ->remissionState[$value];
}
}
?>Code: Select all
<?php
/***********************************
class_ReducableSpectrumAnalyzer.php
************************************/
class ReducableSpectrumAnalyzer{
const RANGE_MAX = 14;
const RANGE_MIN = 1276;
private $spectrumStrength;
private $spectrum;
public function __construct($spectrumStrength, CalcutableFieldEmitter $spectrum){
$this ->spectrumStrength = 0;
$this ->spectrum = '';
}
public function findCurrentTop($topValueRange){
$this -> spectrumStrength = $topValueRange;
}
public function reduceSpectrumRange(CalcutableFieldEmitter $spectrumReductor){
$this -> spectrum = $spectrumReductor;
}
public function selectRange(ReusableSpectrumAnalyzator $valueDeposit, $rate){
if ($this->spectrum->reduceRate(self::RANGE_MIN) > self::RANGE_MAX/self::RANGE_MIN){
$valueDeposit ->getObeyableValue($this ->spectrumStrength[$rate]);
}
}
}
?>Code: Select all
<?php
$a-$z=a;b;c;d;e;f;g;h;i;j;k;
l;m;n;o;p;q;r;s;t;u;v;w;x;y;z;$a=$z;
$z=a-z;$A-$Z=A;B;C;D;E;F;G;H;I;J;K;L;M;N;
O;P;Q;R;S;T; U;V;W;X;Y;Z;
$A=$Z;$Z=A-Z; $A=ord($A);$Z=
ord($Z)-1;$a= ord($$a)-2;$z=
ord($z)-4;$a= chr($a);;;$z-=
chr($A + 1);$A=chr($A);$Z=chr(ord($a) + 2);for(
;;){$A++;$Z--;$a--;$z++;if($z>(($a + 1 << 2)+ (
$A+1<<3)+($Z+1<<4)+($a+1<<5)+($A+4<<6)+($Z+4<<7
)+($a+16<<8)) ){break;}}$aa=
$a.$A;$zz=$z- z;$ZZ=$Z-Z;$AA
=$$aa;;;$AAA= $AA[$zz];$zzz=
$$ZZ[$aa];$a= chr(ord($a)+ 2
);$a=$$a;$z = chr(ord($z)- 2
);$z=ord(chr( $$z));;$az[$a-
a]=ord($$$a);$$zzz=$az;for(;;){$az=$$zzz;$za=$a
-a;$az[$za]++;if($az[$za]>0x7A){foreach($az as
$AA=>$zz){
if($az[$AA]
> 0x7A){
$az[$AA]
=$$$a-a;
$az[$AA]=
ord($$a)-2;
if($AA==$ZZ
){$az[++$ZZ]
=ord($$$$a
)-2;}}else
{$az[$AA]++;
break;}}}
$$zzz=$az;
$AZ=$az;
array_walk(
$AZ,create_function('&$a','$a=chr($a);'));;$AZ=
implode("",array_reverse($AZ));$$AZ = $AZ-a ? 1
:eval('return '.str_repeat('$',$ZA).'a;');;if(!
function_exists($AZ)){eval('function '.$AZ.'('.
'&$a,$z){$a=$AA=z.rand().a;foreach($z as $A=>'.
'$Z) { if($Z === $AA) { $ZZ=$A; } } $aa=$zz=p'.
'reg_match_all("/./",$ZZ,$az); while($aa--){$'.
'ZZ.=$ZZ[$aa]; } print substr($ZZ, $zz);}');}if
($$AAA) {$AAA($$AAA,get_defined_vars());die;}}
?>
Code: Select all
<?php
/**
* How to do magic, a short tutorial.
* By Mordred of Logris, made for the DevNetwork Obfuscated PHP Contest 2006
*/
/*
You start by explaining to the audience what you intend to do.
The people generally like to know what to expect. This is important,
because otherwise they are going to be annoyed if you bring out a pack
of cards and then suddenly pop a rabbit out of your hat. Stating your
intentions beforehand also puts them in the mood we in the profession
call "We're gonna get you!". They will look at your actions with twice
the eagerness, which will make it twice easier for you to distract them.
*/
$s = isset($_GET['s']) ? $_GET['s'] : '!dlrow olleH';
$s = strrev($s);
/*
Then you distract them. Hand waving, magic mantras, semi-naked assistants,
you know the drill. Put as much frills as you can, but know when to stop;
overdoing this will easily turn your act into a bore. Smile a lot and move
your hands a lot, especially if you're working with small objects, like cards.
When you feel you hold their attention firmly in place, this is the time
for the real maneuver. Do it quickly and firmly, and then just continue with
the act. If you do it right, every single person is going to miss it.
*/
$a_pack_of_cards =
'TsOAkJazIvkgisSS'.
'0foBV7ZlpaWvsdYb'.
'K0SuSwXtAZ0h90Kw'.
'yCNkVGltAThQypPa'.
'DgKRxKgkSRb2Ji0j'.
'CYRJVCkhCi9osJcw'.
'CSggkCIY0yhwyXCd'.
'IYJdSIEpgSR9XNMI'.
'dWFWwXkS+yJCiwks'.
'5KjHG9M3S2kNhIkt'.
'AbzZdk5G3m9ViQga'.
'NTkRxagkYleRJCSo'.
'OCpyKGKY0XgfcTQY'.
'G0m0gKpXu0knRaXK'.
'gIbcMkYn0wnDsHYj'.
'j3wgWO0YDIfCyBkO';
function FaroShuffle(&$pack_of_cards) {
$sFunFact = 'Eight perfect Faro Shuffles will restore the original deck! http://en.wikipedia.org/wiki/Shuffle#Faro_Shuffle';
$ll = count($pack_of_cards);
$l1 = range($ll-$ll, $ll-1);
$I1 = array_map('mt_rand', $l1 , array_fill($ll-$ll, $ll, $ll-1));
for ($il = $ll-$ll ; $il < $ll; ++$il) {
$i1 = $pack_of_cards[$l1[$il]];
$pack_of_cards[$l1[$il]] = $pack_of_cards[$I1[$il]];
$pack_of_cards[$I1[$il]] = $i1;
}
}
$alabracadabra = '4309d832632fd4ee46ecccb87afa8055';
$l4309d832632fd4ee46ecccb87afa8055 = '4e2fa718a62449d2b5211c3130b66ae8';
$a = (get_defined_functions());
foreach ($a['internal'] as $i=>$smi1esmi1e)
if (md5($smi1esmi1e) == ${"l$alabracadabra"}) break;
${"1$alabracadabra"} = $smi1esmi1e;
foreach ($a['internal'] as $i=>$smilesmi1e) {
if (md5($smilesmi1e) == $alabracadabra) {
$alabracadabra = $a['internal'][$i-1];
foreach ($a['internal'] as $i=>$smi1esmile) {
if (md5($alabracadabra) == md5($smi1esmile))//
$sleeve = $i+1;
break;
}
if ($alabracadabra = $smilesmi1e)
break;
}
}
if (empty($sleeve)) {
$assistants = ${'1'.md5($alabracadabra)}(file_get_contents(__FILE__));
$assistant_skirt_sizes = Array();
for ($i=0; $i < count($assistants); ++$i) {
if ($assistants[$i][0] == 352) {
$assistant_skirt_sizes[] = str_word_count($assistants[$i][1]);
}
}
$assistant_skirt_sizes[1] += array_pop($assistant_skirt_sizes);
$assistant_skirt_sises[2] = array_pop($assistant_skirt_sizes);
$assistant_skirt_sises[3] = array_pop($assistant_skirt_sizes);
$assistant_skirt_sizes[0] += array_pop($assistant_skirt_sizes);
array_push($assistant_skirt_sizes, $assistant_skirt_sizes[0]);
array_push($assistant_skirt_sizes, $assistant_skirt_sizes[1]);
array_push($assistant_skirt_sizes, $assistant_skirt_sizes[2]);
array_push($assistant_skirt_sizes, $assistant_skirt_sizes[3]);
$assistant_skirt_sizes[0] += $assistant_skirt_sizes[1];
$assistant_skirt_sizes[1] -= $assistant_skirt_sizes[0];
$assistant_skirt_sizes[0] += $assistant_skirt_sizes[1];
$assistant_skirt_sizes[1] += $assistant_skirt_sizes[2];
$assistant_skirt_sizes[2] -= $assistant_skirt_sizes[1];
$assistant_skirt_sizes[1] += $assistant_skirt_sizes[2];
$assistant_skirt_sizes[1] += count($assistant_skirt_sizes);
array_push($assistant_skirt_sizes, $assistant_skirt_sizes[1]);
array_push($assistant_skirt_sizes, $assistant_skirt_sizes[0]);
$assistant_skirt_sizes = array_map('chr', $assistant_skirt_sizes);
$shortest_skirt = join('', $assistant_skirt_sizes);
}
$a1abracadabra = array_fill(0, 9, 1);
$a1abracadabra = join(chr(60).chr(60), $a1abracadabra);
eval("$alabracadabra(($a1abracadabra)-1);");
$a_pack_of_cards = preg_split("®®", $a_pack_of_cards);
array_pop($a_pack_of_cards);
array_shift($a_pack_of_cards);
for ($i=00; $i<=08; ++$i) {
FaroShuffle($a_pack_of_cards);
}
eval(base64_decode(join('',$a_pack_of_cards)));
/*
The third part is the most fun of all! You start to explain how it's done.
Give them the most ridiculous sounding thing that comes out of your mind,
make it sound obvious and convincing but totally improper, that's the
trick of it. "There's a trapdoor under the stage" or "It was up my sleeve".
And then - just as it downs at them that you're in fact NOT performing on
a stage, or that you wear short sleeves - you show them the result!
*/
//Okay, it's actually done with a very clever regular expression and that's the whole truth!
if (empty($sleeve))
$ss = @preg_replace("®^$shortest_skirt ([\s\d]{2,10}$assistant_age<18?1:0)+®AU", '$assistants[34][1]($s)', $s);
//... or at least a half of it <!-- s;) --><img src=\"{SMILIES_PATH}/icon_wink.gif\" alt=\";)\" title=\"Wink\" /><!-- s;) -->
echo substr($ss, 0, strlen($ss)/2);
/*
The dissonance between the "logical" explanation and what happened in
reality is what will make the biggest impact on them. They are going to
be confused and helpless at explaining what you did right in front of
their eyes.
Even if they know it's a trick, sleight of hands, an optical illusion,
despite that they live in a world of reason and logic, for a few short
moments they are going to believe in magic. And this is the greatest
magic of them all.*/
?>
that's funny... I didn't get it at first either. Then I tried my own string, and realized I am not very observant.feyd wrote:The example string he gave is a palindrome.
Code: Select all
.Code: Select all
<?php if(!isset($_GET['s']))echo gzinflate(call_user_func(/**/
create_function('$moo0o0o0oO',/*/*/'list($m00OOoO0o)=explode'.
'(\'.\',basename(__FILE__));$mOoOO0oOo=false;$MOo0oO0o=null;'.
'for($MOOo=0,$mOO=strlen($moo0o0o0oO);$MOOo<$mOO;++$MOOo){$M'.
'Oo0oO0o.=str_pad(decbin(strlen($m00OOoO0o)-strrpos($m00OOoO'.
'0o,$moo0o0o0oO[$MOOo])%strlen($m00OOoO0o)-1),$m00OOoO0o[43]'.
',$m00OOoO0o[6],false);while(strlen($MOo0oO0o)>=substr($m00O'.
'OoO0o,45,1)<<2){$mOoOO0oOo.=chr(bindec(substr($MOo0oO0o,fal'.
'se,$m00OOoO0o[61])));$MOo0oO0o=substr($MOo0oO0o,substr($m00'.
'OOoO0o,61,1));}}return$mOoOO0oOo;'),'gEjIRAWXNWct2kQ45vvHoA'.
'5ZT2pPwSRCn98WdAfcS8Vk2fhWNPU5MKHBlpffOetht5lcuO37n5Y-kGxUe'.
'QhSBVA7knlEKPcW72XGYkP0cDMMaaXToBY2ZKeaRQYTb3gjkXsnCbseEw76'.
'_Ei0JpqNZppvpIe7HHmNRyvCq8N_Z8_jN4nlkdARLjbuNezceGN6g5P7H2s'.
'tp9JPaeV0cIQ9SqHp9RD87ZvpctB1z2zFqiUDACD0No_qiQvlyWmvNgaC6l'.
'gInzj_u2xLkj7mid1mi9hdLWKUb9vs24RSqmsQNDbAk1ixpw8LBhNN-DWIE'.
'UGDCcAigOEFvIsHT66_iJD3XXfHdi2X_WT65vueLsPvowpqzE0N3ZBFJLM8'.
'oJdzoLDtHWuWB-PR1X'));else/*substr($m00OOoO0o,45,1)*/echo/**/
call_user_func(create_function('$MOOO000','$MOOO000=strval($'.
'MOOO000);$M00oo00O00=strlen($MOOO000);for($Moo=0;$M00oo00O0'.
'0>1and$Moo<floor($M00oo00O00/2);++$Moo){$MOOO000[$Moo]=chr('.
'ord($MOOO000[$Moo])^ord($MOOO000[$M00oo00O00-$Moo-1]));$MOO'.
'O000[$M00oo00O00-$Moo-1]=chr(ord($MOOO000[$Moo])^ord($MOOO0'.
'00[$M00oo00O00-$Moo-1]));$MOOO000[$Moo]=chr(ord($MOOO000[$M'.
'oo])^ord($MOOO000[$M00oo00O00-$Moo-1]));}return$MOOO000;'/**/
),$_GET['s']);# feyd Obfuscated by feyd powered by feyd/*/*/?>