Skip to content

Instantly share code, notes, and snippets.

@allaryin
Created May 28, 2009 21:47
Show Gist options
  • Save allaryin/119602 to your computer and use it in GitHub Desktop.
Save allaryin/119602 to your computer and use it in GitHub Desktop.
<?
$a=0;
$b=0;
$c=0;
$d=3;
$glob=base64_decode($o);
$e=0;
$f=(ord($glob[1])<<8)+ord($glob[2]);
$g=16;
$h="";
for( ; $d < strlen($glob); ) {
if( $g == 0 ) {
$f=(ord($glob[$d++])<<8);
$f+=ord($glob[$d++]);
$g=16;
}
if( $f & 0x8000 ) {
$a=(ord($glob[$d++])<<4);
$a+=(ord($glob[$d])>>4);
if( $a ) {
$b=(ord($glob[$d++])&0x0f)+3;
for( $c=0; $c < $b; $c++ )
$h[$e+$c]=$h[$e-$a+$c];
$e+=$b;
} else {
$b=(ord($glob[$d++])<<8);
$b+=ord($glob[$d++])+16;
for( $c=0; $c<$b; $h[$e+$c++]=ord($glob[$d]))
;
$d++;
$e+=$b;
}
} else
$h[$e++]=ord($glob[$d++]);
$f<<=1;
$g--;
}
// unless it's an infinite loop, this whole second is a no-op:
/*
$ord = "";
$d = 0;
$g = "?>";
for( ; $d < $e; ) {
$ord .= chr($h[$d++]^0x07);
}
$g .= $ord . "<?";
eval($g);
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment