Chromagnon icon indicating copy to clipboard operation
Chromagnon copied to clipboard

Unable to parse chrome Cache

Open nithinkumarscaler opened this issue 6 years ago • 3 comments

When i run python chromagnonCache.py ~/.cache/google-chrome/Default/Cache/ I get Invalid Chrome cache file. (Under the above directory there is index file.)

Traceback (most recent call last): File "chromagnonCache.py", line 103, in main() File "chromagnonCache.py", line 89, in main args.getattribute("Cache Directory"), args.u) File "/home/<>/<>/Chromagnon/chromagnon/cacheParse.py", line 58, in parse cacheBlock = CacheBlock(path + "index") File "/home/<>/<>/Chromagnon/chromagnon/cacheBlock.py", line 85, in init raise Exception("Invalid Chrome Cache File") Exception: Invalid Chrome Cache File

nithinkumarscaler avatar Jul 04 '18 13:07 nithinkumarscaler

When i printed the magicnumber, the output is: 2809289776

nithinkumarscaler avatar Jul 04 '18 13:07 nithinkumarscaler

I believe this is due to chrome code switching to "Very Simple HTTP Cache Backend" by default.

from the current index file, I was able to observe a magic that matches 0xfcfb6d1ba7725c30 which is the updated magic signature of the format.

Unfortunately I haven't got more time to look into parsing it, I

Refs:

  • https://www.chromium.org/developers/design-documents/network-stack/disk-cache/very-simple-backend
  • https://github.com/chromium/chromium/blob/4f9c35c3635144e2c2d1b87d09cbcf076d138b66/net/tools/cachetool/cachetool.cc
  • https://github.com/chromium/chromium/blob/2ca8c5037021c9d2ecc00b787d58a31ed8fc8bcb/net/disk_cache/simple/simple_entry_format.h

asfaltboy avatar Nov 04 '18 10:11 asfaltboy

As noted in the Chromium source, disk cache implementation, disk caches use different implementations on Windows/Linux OS.

Trying to export cache with this project will fail on Linux (because Chrome uses simple cache), however it still works on Windows.

mcebular avatar Apr 24 '19 13:04 mcebular