I have some encoded code and if I change eval to $some, then add:
$some= ereg_replace('eval', 'echo', $some);
eval ($some); before ?> I get the decoded.
Im trying to build a little script which would do this, using $_POST, but it dont echo the decoded it just echos whats been inserted.
Heres the code which I've come up with:
<form action="index2.php" method='post'>
<textarea name='so' rows="8" cols="20"></textarea><br>
<input type='submit' name='submit' value='Submit'/><br>
</form>
<?php
$so = $_POST['so'];
$so = str_replace('?>', "", $so);
$so = str_replace('eval($_G', '$some($_G', $so);
$submit= $_POST['submit'];
if($so == "") echo "";
else {
if($submit == "Submit") {
echo $so;
$some= ereg_replace('eval', 'echo', $some);
eval ($some);
echo "?>\n";
}
}
?>
All help is greatly apreciated.
Thank You.