• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

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
0
rgb192
Asked:
rgb192
  • 4
1 Solution
 
InsoftserviceCommented:
To create cache.log copy the "file content" view the image given in the link which part is file content paste it in notepad and then save as "cache.log"
don't worry for .bin and .gz
0
 
rgb192Author Commented:
// 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

0
 
rgb192Author Commented:
Did I make correct change to code?
0
 
rgb192Author Commented:
What change should I make?
Or what additional information should I provide?
0
 
rgb192Author Commented:
the answer provides guidance on how to ask the question again.

thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now