RSS Feed

Annoying Coding Methods (solved)

Posted on Saturday, March 22, 2008 in Coding

So I finally figured out how to decrypt the insanity of the footer for this theme.

To see what I started out with see the first post –> Annyoing Coding Methods

Simply changing the eval() to echo just printed out a ?> because I found out the first thing in the code was a ?>, so it ended the PHP tag and simply printed out the ending ?> tag.

So… I decided to remove all PHP tags… like <?php <? and ?> with:


<?php
$remove = array(">","<");
$replace = array("&gt;","&lt;");
$string = 'FREAKISHLY LONG ENCRYPTED STRING HERE';
echo str_replace($remove,$replace,gzinflate(str_rot13(base64_decode($string))));
# echo str_replace($remove,$replace,gzinflate(base64_decode($string)));<br />
?>

So that worked liked I hoped it would, BUT it prints out nearly the exact same thing I had to begin with, just with another random string. So I keep replacing cryptic code in the $string variable over and over. The output varied from eval(gzinflate(str_rot13(base64_decode($string)))); to eval(gzinflate(base64_decode($string))); Hence the extra (commented) line in the above code. I probably repeated this method at least 50 times until I actually saw the real source code. (And yes, after doing that I realize that I could have just written a little code to loop through it, but I had no idea how many iterations it would take)

The string of data got smaller and smaller each time. The last string before the real code is only about a fifth of the length of the original:

I repeated the workflow one more time and was excited to see real code!

You’ll notice instead of <?php it printed out php because they were removed with the str_replace function. There’s also no ending ?> tags at the end of the PHP code but simply replace them where they belong and remove the links in the end and you’re done!
Update: changed the str_replace() search/replace terms so now everything will look like it should (for some reason I overlooked this simple correction a week ago … lol
I’ve got no idea why the person that made this theme felt it necessary to keep their blasted links so sacred … whatever.

  1. Good site I “Stumbledupon” it today and gave it a stumble for you.. looking forward to seeing what else you have..later

  2. Tahnks for posting

  3. found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later ..

Leave a Comment