I have to decode the binary content data of one of my Chrome cache files which I name cache.log. The way I am trying to decode it is by using a php script I found here
http://www.frozax.com/blog/2011/05/recover-file-google-chrome-cache-gzipped/
I have installed php with the following command already
sudo apt-get install php5 libapache2-mod-php5
sudo apt-get install php5-cgi
When I try to run the index1.php script I get the following in Terminal
s3z@s3z-laptop:~/Desktop$ php index1.php
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
// cache.log is a copy of chrome cache page with only the file content section
$cacheString = file_get_contents("cache.log");
$matches = array();
preg_match_all('/\s[0-9a-f]{2}\s/', $cacheString, $matches);
$f = fopen("t.bin","wb");
foreach ($matches[0] as $match)
{
fwrite($f,chr(hexdec($match)));
}
fclose($f);
ob_start();
readgzfile("t.bin");
$decoded_data=ob_get_clean();
echo $decoded_data;
As you can see, all it is doing is echoing the script.
How do I actually run the script?
It doesn’t look like the code is wrapped in:
If it doesn’t have that, it will just echo instead of executing. The reason for this is that PHP lets you mix server scripting and HTML in the same file.