2

I'm interested in viewing the data stored within my chrome cache files at C:\Users\%user%\AppData\Local\Google\Chrome\User Data\Default\Cache In the same way as CacheView: How can I read Chrome Cache files?

I've looked at databases History and Cookies . Using the following SQLite commands:
History: Urls

select id,url,title,visit_count,typed_count,time(last_visit_time / 1000000 + (strftime('%s', '1601-01-01')), 'unixepoch') AS Date,hidden from urls

History: Downloads

SELECT downloads.id, downloads_url_chains.url, downloads.received_bytes, downloads.total_bytes,
                                downloads.state, downloads.target_path, time(downloads.start_time / 1000000 + (strftime('%s', '1601-01-01')), 'unixepoch') AS Date, time(downloads.end_time / 1000000 + (strftime('%s', '1601-01-01')), 'unixepoch') AS Date,
                                downloads.opened, downloads.danger_type, downloads.interrupt_reason, downloads.etag,
                                time(downloads.last_modified / 1000000 + (strftime('%s', '1601-01-01')), 'unixepoch') AS Date, downloads_url_chains.chain_index
                            FROM downloads, downloads_url_chains WHERE downloads_url_chains.id = downloads.id

History: Downloads_Url_Cache

SELECT downloads_url_chains.id, downloads_url_chains.url, downloads_url_chains.chain_index FROM downloads_url_chains

Cookies

SELECT host_key,name,encrypted_value,value FROM cookies WHERE value = ''

Of which do not carry the underlying metadata of filetypes, sizes or url origin for generally cached data (pngs, mp4s, etc).

Application purpose The resulting application is expected to attain current files count from the cache. Self-updating of course, as a background thread.

I'm therefore over 8hours into this subject, including an initial header-handling class for the first 10characters via binaryReader and UTF-8 decoding. Big mistake. Research branched towards HttpHeader handling, with some Regex.

Question: How does a developer access cached files(ie png's) via c-sharp?

Researching further without a developers input, leads me down the HEX memory pointers route. Throwing in some Regex while streaming the file using StreamReader. It has to be easier than that?

More References: Chrome_Disk_Cache_Format and How to read IE and Chrome Cache content programmatically (C#)?

Update: Some psuedo

Fails due encoding and padding.

GetEncoding(); // Returns ASCII
// freezes System.Text.Encoding.ASCII.GetString(buf);
// symbol no System.Text.Encoding.UTF8.GetString(buf);
// encoding no string finalLines = Convert.ToBase64String(thisData, Base64FormattingOptions.InsertLineBreaks);
// symbol no string datas = System.Text.Encoding.Default.GetString(thisData);
string cur = "";
this.Invoke((MethodInvoker)delegate ()
     {
       richTextBox1.Text = Convert.ToBase64String(File.ReadAllBytes(path));
       cur = richTextBox1.Text;
       richTextBox1.Enabled = true;
     });
 // INVAL MAGIC   byte[] decompressed = Decompress(thisData); // it's not gzip compressed as a file
// string[] data = File.ReadAllLines(path); 
Regex encRex = new Regex("^([^;]+);(?:\\s*([^=]+)=((?<q>\"?)[^\"]*\\k<q>);?)*$", RegexOptions.IgnoreCase);
D Nikolz
  • 43
  • 8
  • Did you ever succeed in this? If so, can you update the topic? – El-Ahrairah Jan 18 '20 at 05:23
  • No I didn't, I found that CACHE file structure isn't common and Uni threw me into deep learning, so abandoned this project. An answer would still be appreciated by me. – D Nikolz Jan 20 '20 at 03:45

0 Answers0