Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

input: cache file. Output: readable file (maybe .html or .php)

http://www.frozax.com/blog/2011/05/recover-file-google-chrome-cache-gzipped/

// 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;

Open in new window



I want to recover files from my chrome://cache

I think this php is for linux
and I have windows

I do not see .bin or .log files in my cache,
no files contain extension
ASKER CERTIFIED SOLUTION
Avatar of Insoftservice inso
Insoftservice inso
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

// cache.log is a copy of chrome cache page with only the file content section
$cacheString = file_get_contents("cache.log"); //this is the location of file
$matches = array();
preg_match_all('/s[0-9a-f]{2}s/', $cacheString, $matches);
$f = fopen("t.bin","wb"); // this file does not exist; will script crash
foreach ($matches[0] as $match)
{
  fwrite($f,chr(hexdec($match)));
}
fclose($f);

ob_start();
readgzfile("t.bin"); // this file does not exist; will script crash
$decoded_data=ob_get_clean();
echo $decoded_data;

Open in new window

Avatar of rgb192

ASKER

Did I make correct change to code?
Avatar of rgb192

ASKER

What change should I make?
Or what additional information should I provide?
Avatar of rgb192

ASKER

the answer provides guidance on how to ask the question again.

thanks