- substr: documentation ( source)
- chr: documentation ( source)
- octdec: documentation ( source)
- strrev: documentation ( source)
- hexdec: documentation ( source)
- strtolower: documentation ( source)
- define: documentation ( source)
<?php
function decrypt($a)
{
$strings = strtolower(strrev($a));
$MyKey = hexdec(substr($strings, 0, 4)) ^ hexdec('BFF') ^ hexdec('D77D');
$Temps = substr($strings, 4);
unset($tmp);
//echo $n;
for ($i = 0; $i < strlen($Temps); $i+=6)
{
++$n;
$cal = ($n * $n) ^ hexdec("3E");
//echo chr(octdec(hexdec(substr($Temps, $i, 6))) ^ ($MyKey ^ hexdec("AFE43") ^ hexdec("399AA3") ^ $cal)) . "\n";
$tmp = $tmp . chr(octdec(hexdec(substr($Temps, $i, 6))) ^ ($MyKey ^ hexdec('AFE43') ^ hexdec('399AA3') ^ $cal));
}
return $tmp;
}
define('__FLAG__', 'flag{hidden_flag}');
if(decrypt('DEFBFD2EFBFDBCFBFD58FBFD56FBFD31FBFDDFEBFD3BEBFD48EBFD16EBFD83EBFD2DDBFDDFDBFDBCDBFDCBDBFD87DBFDB9DBFDB5DBFD76DBFDF6DBFDF5DBFDD5DBFD82ED') == 'pwning_the_phpreverse!')
{
echo __FLAG__;
}
?>