The officially official Devuan Forum!

You are not logged in.

#1 2023-02-24 03:27:32

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

[SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

Chromium: chromium/stable-security
APT-Sources: http://deb.devuan.org/merged chimaera-security/main amd64
Version 110.0.5481.177 (Official Build) built on Debian 11.6, running on Debian 11.1 (64-bit)

A desire to be able to explore the contents of Chromium's cache led me to try to fix my Wine installation. Assistance to fix either would be appreciated.

First a brief on how this started, then details on each problem.

  1. 15 Jan: I ordered a Braun 3040s shaver from Amazon for £55.99

  2. 18 Feb: whilst investigating the cost of Guide Combs for the 3040s I discovered that the then-current cost of a 3040s at Amazon was £1100

  3. Today: re-checking the cost, the 3040s is £35

The above caused me to doubt #2 above. It seemed bizarre at the time, and now I doubted it totally. I knew that it would be stored within Chromium's history, but also knew that any attempt to access that history would replace the cache with the current page. How could I view the stored historic pages?

Exactly what I wanted was at EaseUS Chrome Cache Viewer as a free download, but with a big caveat: it was only available for Windows or Mac.

Wine was already installed on my Chimaera system, so I downloaded the EaseUS zip file & attempted to use wine to run it. Oh dear.

$ mkdir ChromeCache
$ cd ChromeCache
$ mv ~/Downloads/chromecacheview.zip ./
$ wine ChromeCacheView.exe -folder ~/.cache/chromium/Default/Cache
it looks like wine32 is missing, you should install it.
as root, please execute "apt-get install wine32"
it looks like wine32 is missing, you should install it.
as root, please execute "apt-get install wine32"
002b:err:module:__wine_process_init L"Z:\\home\\alexk\\Personal\\ChromeCache\\ChromeCacheView.exe" not supported on this system

It originally also told me to do # dpkg --add-architecture i386, and I cannot now reverse that instruction. My searching suggested that wine32 is now redundant since my amd64 system already contains provision for 32-bit wine. Are the suggestions above on installing wine32 now out-of-date?

My attempts to remedy the below may have it got me in deeper water, but here is the (seems to be misleading) original results:

$ sudo apt-get install wine32
[sudo] password for alexk: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libcurl4:i386 : Depends: libldap-2.4-2:i386 (>= 2.4.7) but it is not going to be installed
 libvkd3d1:i386 : Depends: libvulkan1:i386 (>= 1.1.70) but it is not going to be installed
 libwine:i386 : Depends: libldap-2.4-2:i386 (>= 2.4.7) but it is not going to be installed
                Recommends: libgl1:i386 but it is not installable
                Recommends: libglu1-mesa:i386 but it is not installable or
                            libglu1:i386
                Recommends: libsane1:i386 (>= 1.0.27) but it is not installable
                Recommends: libvulkan1:i386 (>= 1.2.131.2) but it is not going to be installed
                Recommends: libgl1-mesa-dri:i386 but it is not installable
E: Unable to correct problems, you have held broken packages.

I checked, and there are zero held packages.

Is anyone using WINE & knows how to escape these problems? Or, even better, does anyone know how to view or extract historic cache pages from Chromium?

2023-02-24: added Chromium version, etc.

Last edited by alexkemp (2023-02-24 12:14:59)

Offline

#2 2023-02-24 05:09:21

zapper
Member
Registered: 2017-05-29
Posts: 809  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

Not relevant persay, but which chromium is this btw? Regular, or ungoogled?

You can try compiling from source though if this is an issue.

I used to do that all the time on non-mainstream distros.

I recommend people do the same, if this issue comes up.

Though it might still be frustrating. If you have a lot of cpus and more than one comp, its wise to use one for compiling, probably recommended at a slower speed if you want to be extra careful regarding heat.

The other one, do whatever probably.

Worked for me many time.

Hope this helps somewhat.


Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term  If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!

Offline

#3 2023-02-24 09:38:35

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 529  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

For wine, I have this in my /etc/apt/sources.list.d/

I'm running Daedalus, one of these winehq links keeps my system up to date.

I only have it installed because Steam needed it to install a game.

"https://dl.winehq.org/wine-builds/debian/"

/etc/apt/sources.list.d/winehq-bullseye.sources

Types: deb
URIs: https://dl.winehq.org/wine-builds/debian
Suites: bullseye
Components: main
Architectures: amd64 i386
Signed-By: /etc/apt/keyrings/winehq-archive.key

/etc/apt/sources.list.d/winehq-bookworm.sources

Types: deb
URIs: https://dl.winehq.org/wine-builds/debian
Suites: bookworm
Components: main
Architectures: amd64 i386
Signed-By: /etc/apt/keyrings/winehq-archive.key

I hope this helps.

Have you thought about using a different browser to look at the cache?

All the best.


pic from 1993, new guitar day.

Offline

#4 2023-02-24 12:24:20

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

GlennW wrote:

Have you thought about using a different browser to look at the cache?

The Chromium cache is an encrypted binary mess of connected directories (specialised JSON for the ones I've looked at), with not a single html nor css file within them. Can you suggest a browser that *can* view them?

Last edited by alexkemp (2023-02-24 12:30:53)

Offline

#5 2023-02-24 16:18:20

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

Offline

#6 2023-02-24 18:26:13

delgado
Member
Registered: 2022-07-14
Posts: 141  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

As far as I remember

# dpkg --add-architecture i386
# apt install wine 

installed both, wine64 and wine32.
Indeet, it was impossible to get only wine64 without wine32 (trying to get away without i386-architecture).

EDIT: caution! My memory seems to trick me!
EDIT2: the above is true with apt's defaults or namely # apt install wine --install-recommends

Last edited by delgado (2023-02-25 12:13:30)

Offline

#7 2023-02-24 21:54:16

rolfie
Member
Registered: 2017-11-25
Posts: 1,011  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

As far as I remember when I installed wine a while ago, when you just specify # apt install wine you just get wine64, the additional architecture does not matter. i386 is pre-requisite to do an # apt install wine32.

Offline

#8 2023-02-24 21:55:07

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 529  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

alexkemp wrote:
GlennW wrote:

Have you thought about using a different browser to look at the cache?

The Chromium cache is an encrypted binary mess of connected directories (specialised JSON for the ones I've looked at), with not a single html nor css file within them. Can you suggest a browser that *can* view them?

No I can't suggest any... Just a thought.


pic from 1993, new guitar day.

Offline

#9 2023-02-25 00:12:45

andyprough
Member
Registered: 2019-10-19
Posts: 327  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

alexkemp wrote:

The Chromium cache is an encrypted binary mess of connected directories (specialised JSON for the ones I've looked at), with not a single html nor css file within them. Can you suggest a browser that *can* view them?

There's some instructions on using sqlite to view chrome history from 8 years ago on this thread: https://askubuntu.com/questions/624120/ … e-terminal

Don't know if that's the way the data is still stored, but might be worth a look to see if the instructions make any sense.

There's also a cool looking little python project on github that says it can retrieve and view browser history from any browser on any platform: https://github.com/browser-history/browser-history

I'd probably try the python one first.

Offline

#10 2023-02-25 10:27:18

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

andyprough wrote:

I'd probably try the python one first.

It says:

python package to retrieve (almost) any browser's history on (almost) any platform

I'm interested in neither the History (which I can obtain with a simple Ctrl-H) nor the Bookmarks, so fail to understand the point of installing that. I want to be able to view the historic pages in a browser, not the History.

Same with the askubuntu.com question:

Is it possible to view Google Chrome bookmarks and history from the terminal

The History is a binary file in SQLite format 3

Thanks for trying, Andy, but you appear to have misunderstood my query.

Offline

#11 2023-02-25 10:40:28

delgado
Member
Registered: 2022-07-14
Posts: 141  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

rolfie wrote:

As far as I remember when I installed wine a while ago, when you just specify # apt install wine you just get wine64, the additional architecture does not matter. i386 is pre-requisite to do an # apt install wine32.

Interesting, you archived what I wanted at the time, but could not get.

Sorry, I did not ment to spread confuision.

EDIT:
Tested on Chimaera, it depends on 'recommended install'.

# apt install wine --no-install-recommends

does not install wine32, while

# apt install wine --install-recommends
# apt install wine64 --install-recommends

does, if i386 architecture is added.

Last edited by delgado (2023-02-25 11:32:34)

Offline

#12 2023-02-25 14:43:54

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 188  
Website

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

alexkemp wrote:

I'm interested in neither the History (which I can obtain with a simple Ctrl-H) nor the Bookmarks, so fail to understand the point of installing that. I want to be able to view the historic pages in a browser, not the History.

Browsers do not store "historic pages" - in certain situations they store the single most recently requested version of a resource in a cache - this is performed at the point when a response is received, so if you requested the same URL yesterday as on the 18th then any previous cached version was already overwritten at that point.

However, I'd suggest it's very unlikely that Amazon caches search results for a week, so if you don't have a copy of the cache data made before it expired, it has likely already been cleaned up by a periodic cache expiry process.


3.1415P265E589T932E846R64338

Offline

#13 2023-02-25 16:28:41

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

boughtonp wrote:

I'd suggest it's very unlikely that Amazon caches search results for a week

$ cd ~/.cache/chromium/Default/Cache/Cache_Data
$ fgrep amazon * -l > amazon.txt
grep: index-dir: Is a directory
$ wc -l amazon.txt
588 amazon.txt
$ fgrep amazon * -l | xargs ls -ltr
grep: index-dir: Is a directory
-rw------- 1 alexk alexk   6640 Jan 14 10:40 a25a4684dc578add_0
-rw------- 1 alexk alexk   6283 Feb 16 11:25 53cb04645ec61dbe_0
-rw------- 1 alexk alexk  15666 Feb 17 23:58 e8f89e2a5b7a01f1_0
-rw------- 1 alexk alexk  13867 Feb 17 23:58 886a5cd11ba0631f_0
-rw------- 1 alexk alexk   5874 Feb 17 23:58 316a7542b7befa08_0
-rw------- 1 alexk alexk   8924 Feb 17 23:58 0178e5420f91ea0d_0
-rw------- 1 alexk alexk   7659 Feb 17 23:58 ad11df88c0edb21b_0
-rw------- 1 alexk alexk  10943 Feb 17 23:58 548924d727f4b76c_0
-rw------- 1 alexk alexk   6091 Feb 17 23:58 3f2cf4a8f4ed3da1_0
-rw------- 1 alexk alexk  11344 Feb 17 23:58 5bee7426f918804c_0
-rw------- 1 alexk alexk   7267 Feb 17 23:58 5602f4c5219938bd_0
-rw------- 1 alexk alexk  14755 Feb 17 23:58 847822115a578d5c_0
-rw------- 1 alexk alexk   5492 Feb 17 23:58 421a319a89da0977_0
-rw------- 1 alexk alexk   7717 Feb 17 23:58 21287a7168c435cf_0
-rw------- 1 alexk alexk   6705 Feb 17 23:58 467f6b3bbdaba59b_0
-rw------- 1 alexk alexk  11348 Feb 18 00:09 fe2bc889ad53c7e8_0
-rw------- 1 alexk alexk  12090 Feb 18 00:09 b9868882a8c66b57_0
-rw------- 1 alexk alexk   5113 Feb 18 00:21 705dafad26790491_0

Offline

#14 2023-02-25 16:40:08

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 188  
Website

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

Ok, well if those are search results that does surprise me.

What's the current blocker? Have you grepped those files for 3040s and 1100 ?


3.1415P265E589T932E846R64338

Offline

#15 2023-02-25 21:00:41

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

I *did* originally grep the files for '3040s' (not 1100) & found it in a number of dates (4 different dates if I remember correctly). I have a record in bash history only of 'Feb 18', 3 different files, due to specific checks made at the time. However, today *none* of the files contain '3040s', which is why in the abbreviated results (there are *far* more records after the last one above) I used 'amazon' as the search term.

Offline

#16 2023-02-25 22:53:24

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 188  
Website

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

alexkemp wrote:

However, today *none* of the files contain '3040s', which is why in the abbreviated results (there are *far* more records after the last one above) I used 'amazon' as the search term.

Ok, so you've not determined those files are related to the search results HTML response, and they may well be other things - scripts, styles, images, etc.

Unless the files are encrypted, a failure to find "3040s" probably means they have since expired and been removed (especially if it was returning results earlier).

Have you looked at any of the files to determine contents?

Try replacing the ls command for file (perhaps with -z), and then grep the results for "HTML" or "text"?

Last edited by boughtonp (2023-02-25 22:58:50)


3.1415P265E589T932E846R64338

Offline

#17 2023-02-26 00:56:35

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

boughtonp wrote:

Have you looked at any of the files to determine contents?

Yes. It's not easy, since they all give the same enigmatic response to file:

~/.cache/chromium/Default/Cache/Cache_Data$ file -z 00037beb6d874770_0
00037beb6d874770_0: data

Some refer to css files, some to image files, and so on. I've tried to find html files but that is difficult, as almost all files contain the text 'text/html' without actually containing any reference to such a file. Annoyingly, none seem to contain any actual css, png, html nor any other filetype content, though they do seem to contain packet headers. I'll try to illustrate:

$ hexdump 47c5717d1de790a5_0 -C
00000000  30 5c 72 a7 1b 6d fb fc  05 00 00 00 78 00 00 00  |0\r..m......x...|
00000010  31 0b 69 2c 00 00 00 00  31 2f 30 2f 5f 64 6b 5f  |1.i,....1/0/_dk_|
00000020  68 74 74 70 73 3a 2f 2f  79 6f 75 74 75 62 65 2e  |https://youtube.|
00000030  63 6f 6d 20 68 74 74 70  73 3a 2f 2f 79 6f 75 74  |com https://yout|
00000040  75 62 65 2e 63 6f 6d 20  68 74 74 70 73 3a 2f 2f  |ube.com https://|
00000050  77 77 77 2e 67 73 74 61  74 69 63 2e 63 6f 6d 2f  |www.gstatic.com/|
00000060  79 6f 75 74 75 62 65 2f  69 6d 67 2f 62 72 61 6e  |youtube/img/bran|
00000070  64 69 6e 67 2f 66 61 76  69 63 6f 6e 2f 66 61 76  |ding/favicon/fav|
00000080  69 63 6f 6e 5f 31 34 34  78 31 34 34 2e 70 6e 67  |icon_144x144.png|
00000090  89 50 4e 47 0d 0a 1a 0a  00 00 00 0d 49 48 44 52  |.PNG........IHDR|
000000a0  00 00 00 90 00 00 00 90  08 03 00 00 00 d0 98 12  |................|
000000b0  8a 00 00 00 63 50 4c 54  45 00 00 00 ff 00 00 ff  |....cPLTE.......|
000000c0  00 00 ff 00 00 ff 00 00  ff 00 00 ff 00 00 ff 00  |................|
# (snip)
00000390  00 fc 86 92 50 21 39 2f  00 e8 02 00 00 48 54 54  |....P!9/.....HTT|
000003a0  50 2f 31 2e 31 20 32 30  30 00 61 63 63 65 70 74  |P/1.1 200.accept|
000003b0  2d 72 61 6e 67 65 73 3a  62 79 74 65 73 00 63 72  |-ranges:bytes.cr|
000003c0  6f 73 73 2d 6f 72 69 67  69 6e 2d 72 65 73 6f 75  |oss-origin-resou|
000003d0  72 63 65 2d 70 6f 6c 69  63 79 3a 63 72 6f 73 73  |rce-policy:cross|
000003e0  2d 6f 72 69 67 69 6e 00  63 72 6f 73 73 2d 6f 72  |-origin.cross-or|
000003f0  69 67 69 6e 2d 6f 70 65  6e 65 72 2d 70 6f 6c 69  |igin-opener-poli|
00000400  63 79 2d 72 65 70 6f 72  74 2d 6f 6e 6c 79 3a 73  |cy-report-only:s|
00000410  61 6d 65 2d 6f 72 69 67  69 6e 3b 20 72 65 70 6f  |ame-origin; repo|
00000420  72 74 2d 74 6f 3d 22 73  74 61 74 69 63 2d 6f 6e  |rt-to="static-on|
00000430  2d 62 69 67 74 61 62 6c  65 22 00 72 65 70 6f 72  |-bigtable".repor|
00000440  74 2d 74 6f 3a 7b 22 67  72 6f 75 70 22 3a 22 73  |t-to:{"group":"s|
00000450  74 61 74 69 63 2d 6f 6e  2d 62 69 67 74 61 62 6c  |tatic-on-bigtabl|
00000460  65 22 2c 22 6d 61 78 5f  61 67 65 22 3a 32 35 39  |e","max_age":259|
00000470  32 30 30 30 2c 22 65 6e  64 70 6f 69 6e 74 73 22  |2000,"endpoints"|
00000480  3a 5b 7b 22 75 72 6c 22  3a 22 68 74 74 70 73 3a  |:[{"url":"https:|
00000490  2f 2f 63 73 70 2e 77 69  74 68 67 6f 6f 67 6c 65  |//csp.withgoogle|
000004a0  2e 63 6f 6d 2f 63 73 70  2f 72 65 70 6f 72 74 2d  |.com/csp/report-|
000004b0  74 6f 2f 73 74 61 74 69  63 2d 6f 6e 2d 62 69 67  |to/static-on-big|
000004c0  74 61 62 6c 65 22 7d 5d  7d 00 63 6f 6e 74 65 6e  |table"}]}.conten|
000004d0  74 2d 6c 65 6e 67 74 68  3a 37 32 39 00 78 2d 63  |t-length:729.x-c|
000004e0  6f 6e 74 65 6e 74 2d 74  79 70 65 2d 6f 70 74 69  |ontent-type-opti|
000004f0  6f 6e 73 3a 6e 6f 73 6e  69 66 66 00 73 65 72 76  |ons:nosniff.serv|
00000500  65 72 3a 73 66 66 65 00  78 2d 78 73 73 2d 70 72  |er:sffe.x-xss-pr|
00000510  6f 74 65 63 74 69 6f 6e  3a 30 00 64 61 74 65 3a  |otection:0.date:|
00000520  53 75 6e 2c 20 31 33 20  4d 61 72 20 32 30 32 32  |Sun, 13 Mar 2022|
00000530  20 31 36 3a 34 32 3a 33  39 20 47 4d 54 00 65 78  | 16:42:39 GMT.ex|
00000540  70 69 72 65 73 3a 4d 6f  6e 2c 20 31 33 20 4d 61  |pires:Mon, 13 Ma|
00000550  72 20 32 30 32 33 20 31  36 3a 34 32 3a 33 39 20  |r 2023 16:42:39 |
00000560  47 4d 54 00 63 61 63 68  65 2d 63 6f 6e 74 72 6f  |GMT.cache-contro|
00000570  6c 3a 70 75 62 6c 69 63  2c 20 6d 61 78 2d 61 67  |l:public, max-ag|
00000580  65 3d 33 31 35 33 36 30  30 30 00 61 67 65 3a 34  |e=31536000.age:4|
00000590  37 35 37 39 34 00 6c 61  73 74 2d 6d 6f 64 69 66  |75794.last-modif|
000005a0  69 65 64 3a 54 68 75 2c  20 30 33 20 4f 63 74 20  |ied:Thu, 03 Oct |
000005b0  32 30 31 39 20 31 30 3a  31 35 3a 30 30 20 47 4d  |2019 10:15:00 GM|
000005c0  54 00 63 6f 6e 74 65 6e  74 2d 74 79 70 65 3a 69  |T.content-type:i|
000005d0  6d 61 67 65 2f 70 6e 67  00 61 6c 74 2d 73 76 63  |mage/png.alt-svc|
000005e0  3a 68 33 3d 22 3a 34 34  33 22 3b 20 6d 61 3d 32  |:h3=":443"; ma=2|
000005f0  35 39 32 30 30 30 2c 68  33 2d 32 39 3d 22 3a 34  |592000,h3-29=":4|
00000600  34 33 22 3b 20 6d 61 3d  32 35 39 32 30 30 30 2c  |43"; ma=2592000,|
00000610  68 33 2d 51 30 35 30 3d  22 3a 34 34 33 22 3b 20  |h3-Q050=":443"; |
00000620  6d 61 3d 32 35 39 32 30  30 30 2c 68 33 2d 51 30  |ma=2592000,h3-Q0|
00000630  34 36 3d 22 3a 34 34 33  22 3b 20 6d 61 3d 32 35  |46=":443"; ma=25|
00000640  39 32 30 30 30 2c 68 33  2d 51 30 34 33 3d 22 3a  |92000,h3-Q043=":|
00000650  34 34 33 22 3b 20 6d 61  3d 32 35 39 32 30 30 30  |443"; ma=2592000|
00000660  2c 71 75 69 63 3d 22 3a  34 34 33 22 3b 20 6d 61  |,quic=":443"; ma|
00000670  3d 32 35 39 32 30 30 30  3b 20 76 3d 22 34 36 2c  |=2592000; v="46,|
00000680  34 33 22 00 00 03 00 00  00 c0 04 00 00 30 82 04  |43"..........0..|
00000690  bc 30 82 03 a4 a0 03 02  01 02 02 11 00 89 50 eb  |.0............P.|

The inevitable conclusion is that the actual content must be somewhere else within the labyrinth of dirs.

Offline

#18 2023-02-26 01:05:01

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

Obviously, somewhere in the Chromium code will be routines for accessing, exploring & extracting these cached files. I'm simply astonished that so few people (seemingly just one) have produced a Chrome cache viewer.

Offline

#19 2023-02-26 07:22:31

aluma
Member
Registered: 2022-10-26
Posts: 444  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

alexkemp wrote:

... I'm simply astonished that so few people (seemingly just one) have produced a Chrome cache viewer.

Probably because for the average user, the opposite task is more relevant - to clear the cache on exit. Anyway, some gurus give this advice for safety.

My Iridium and Firefox caches are placed in tmpfs, instead of the Firefox extension to clear the cache, just a desktop icon with this command.

In cases like yours, I just take a screenshot of the order page with prices, numbers, etc.

Last edited by aluma (2023-02-26 07:24:30)

Offline

#20 2023-02-26 12:16:44

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

This is fundamental info for the Chromium disk_cache.

This is the src dir for the Chromium disk_cache

Last edited by alexkemp (2023-02-26 12:29:58)

Offline

#21 2023-02-27 21:32:12

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

BeginnerForever at this StackOverflow page has a PHP script which, after just a couple of tweaks, will extract all JPEG + PNG files from the Chromium/Chrome dir to a dir. Fast & very impressive

There now follows my small update to that script. I've added a section for GIF files (those files get extracted, but do not work as image files):

#!/usr/bin/php
<?php
   // getCC (get Chrome Cache)
   // suggestion: save as ~/.getCC; chmod +x; chmod 700

   $dir  = "/home/alexk/.cache/chromium/Default/Cache/Cache_Data/"; // Chromium cache folder.
   $ppl  = "/home/alexk/Personal/ChromeCache/Files/";               // Place for extracted files
// $END  = "HTTP/1.1 200 OK";                                       // Search in cache-file (works, yet not in some files)
   $END  = "HTTP/1.1 200";                                          // Search in cache-file (works, and IS in all files)
   $FTL  = "";                                                      // Filetype lowercase
   $FTU  = "";                                                      // Filetype uppercase
   $MOFF = 0;                                                       // Offset of magic from file beginning

   $list = scandir( $dir );
   foreach( $list as $filename ) {

      if( is_file( $dir.$filename )) {
         $content = file_get_contents( $dir.$filename );
         if( strstr( $content, 'JFIF')) {
            $FTL  = "jpg";
            $FTU  = "JPEG";
            $MOFF    = 6;
            echo( $filename."  $FTU \n");
            $start   = ( strpos( $content, "JFIF", 0 ) - $MOFF );
            $end     =   strpos( $content, $END, 0 );
            $content =   substr( $content, $start, $end - $MOFF );
            $length =   strlen( $content );
            $wholenm =   $ppl.$filename.".$FTL";
            file_put_contents( $wholenm, $content );
//          echo( "Saving :".$wholenm." \n");
            echo( "start : $start \n");
            echo( "end   : $end \n");
            $diff = $end - $start;
            echo( "length: $length (s/b $diff)\n");
         }
         elseif( strstr( $content, "\211PNG")) {
            $FTL  = "png";
            $FTU  = "PNG";
            $MOFF    = 1;
            echo( $filename."  $FTU \n");
            $start   = ( strpos( $content, "$FTU", 0 ) - $MOFF );
            $end     =   strpos( $content, $END, 0 );
            $content =   substr( $content, $start, $end - $MOFF );
            $length =   strlen( $content );
            $wholenm = $ppl.$filename.".$FTL";
            file_put_contents( $wholenm, $content );
//          echo( "Saving :".$wholenm." \n");
            echo( "start : $start \n");
            echo( "end   : $end \n");
            $diff = $end - $start;
            echo( "length: $length (s/b $diff)\n");
         }
         elseif( strstr( $content, "GIF89a")) {
            $FTL  = "gif";
            $FTU  = "GIF";
            $MOFF    = 0;
            echo( $filename."  $FTU \n");
            $start  = ( strpos( $content, "GIF89a", 0 ) - $MOFF );
            $end    =   strpos( $content, $END, 0 );
            $newc   =   substr( $content, $start, $end );
            $length =   strlen( $newc );
            $wholenm = $ppl.$filename.".$FTL";
            file_put_contents( $wholenm, $newc );
            echo( "Saving :".$wholenm." \n");
            echo( "start : $start \n");
            echo( "end   : $end \n");
            $diff = $end - $start;
            echo( "length: $length (s/b $diff)\n");
         }
         else {
            echo( $filename."  UNKNOWN \n");
         }
      }
   }
?>

There are a couple of strange occurrences that I cannot explain nor fix, and have added some echo lines to try to debug it. I'm going to rewrite the script in BASH which, hopefully, will be more reliable. If so, I will not need WINE (hooray!).

  1. Line 8 has $END = "HTTP/1.1 200 OK"; & each section has $end = strpos( $content, $END, 0 );. I discovered that some files do not have an "OK" in the cache-file, yet they were found (not by grep) & the image correctly extracted. I cannot explain what is going on there.

  2. The file content is concatenated within the Cache_Data file immediately before the $END string. Somehow, none of the extracted files is the length that they should be. JPEG + PNG files do not seem to mind, but GIF files refuse to play. I put some echo lines into the script to try to debug what on earth is going on.

Here is the very end of the script text output, to try to give some sense of the difficulty:

ffa41e3d8b4e0cf9_0  PNG 
start : 150 
end   : 14212 
length: 14211 (s/b 14062)
ffa78518232ea9f2_0  PNG 
start : 170 
end   : 1417 
length: 1416 (s/b 1247)
ffad48f3aefb6cd7_0  GIF 
Saving :/home/alexk/Personal/ChromeCache/Files/ffad48f3aefb6cd7_0.gif 
start : 1089 
end   : 1183 
length: 1183 (s/b 94)
ffba1f5387a04a08_0  JPEG 
start : 166 
end   : 972 
length: 966 (s/b 806)
ffbf8448256da635_0  UNKNOWN 
ffc1ebd8d62551b6_0  GIF 
Saving :/home/alexk/Personal/ChromeCache/Files/ffc1ebd8d62551b6_0.gif 
start : 193 
end   : 288 
length: 288 (s/b 95)
ffc2019c23af2000_0  UNKNOWN 
ffc239239bc4e4a9_0  JPEG 
start : 195 
end   : 1920 
length: 1914 (s/b 1725)
ffc57d9b41cebadd_0  UNKNOWN 
ffcbd7258d6a0aea_0  UNKNOWN 
ffda4d6b8e2937fd_0  UNKNOWN 
ffdac4bf770719a1_0  UNKNOWN 
ffde560cb8ad0eaf_0  UNKNOWN 
fff42f6de6d58540_0  UNKNOWN 
fff530252c03d813_0  UNKNOWN 
fff55afc8b58e35f_0  UNKNOWN 
fff822c2bb27d828_0  GIF 
Saving :/home/alexk/Personal/ChromeCache/Files/fff822c2bb27d828_0.gif 
start : 202 
end   : 297 
length: 297 (s/b 95)
index  UNKNOWN

PHP seems to be unworkable now, so I'm going to switch to BASH.

Offline

#22 2023-02-28 02:25:53

zapper
Member
Registered: 2017-05-29
Posts: 809  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

Btw, when I said compiling is an option, I should clarify, I meant wine, not chromium or ungoogled chromium.

Wine actually isnt at all hard to compile, as long as you have the multilib stuff supposedly.


Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term  If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!

Offline

#23 2023-02-28 10:32:41

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

Mark Hindley in the bug report was able to get to the gates of success in installing wine32 on a vanilla chimaera, and has therefore fingered backports as the reason for the error on my system. That log-file reported a terrifyingly-large number of i386 packages to install as helpers to wine32.

I would like to give public thanks to Mark for his help so far, but I'm going to remove all traces of Wine & the i386 architecture from my system.

Offline

#24 2023-03-03 07:18:07

zapper
Member
Registered: 2017-05-29
Posts: 809  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

alexkemp wrote:

Mark Hindley in the bug report was able to get to the gates of success in installing wine32 on a vanilla chimaera, and has therefore fingered backports as the reason for the error on my system. That log-file reported a terrifyingly-large number of i386 packages to install as helpers to wine32.

I would like to give public thanks to Mark for his help so far, but I'm going to remove all traces of Wine & the i386 architecture from my system.

Wise considering the lack of security on wine.


Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term  If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!

Offline

#25 2023-03-05 02:34:28

alexkemp
Member
Registered: 2018-05-14
Posts: 278  

Re: [SOLVED] Help requested with WINE setup and/or Chromium Cache Searching

AlexKemp wrote:

I'm simply astonished that so few people (seemingly just one) have produced a Chrome cache viewer.

There *is* another on Github. It was a little heavyweight for me, so I spent a week learning PERL whilst writing a script to extract all the Chrome-cached files into a directory. ~100 lines. Below for your elucidation:

4pm update: +20 lines to fix ~2000 bad files
5pm update: added Brotli compression encoding; still not sure if that works ok
Mar 8 update: Brotli now works; ~150 active lines (+ ~10 debug lines commented out)

#!/usr/bin/perl
   # get Chrome Cache
   # suggestion: save as ~/.getCC; chmod +x; chmod 700

   # A PERL script to iterate through the Chromium/Chrome 'Cache_Data/'
   #+extract all http-delivered files stored within those data-files

   # 2023-03-08: bugfix: COUNT removed; LEN used instead
   #           +        (F_OFF used for BEG, not COUNT)
   #           +         brotli now works
   #           +        (no magic for brotli (a mistake imo))
   # 2023-03-07: bugfix: corrected miss on most magic files (my bad)
   #           +         excluded compound header fields to eliminate wrong values
   #             added $F_OFF (diff between HTTP-begin ($END - $LEN) & magic-begin ($BEG))
   #           + (*every* file with both $BEG & $LEN has diff == x34) (h-begin is bigger)
   #           + thus if no magic but LEN then BEG = END - LEN - 52
   #           +      if magic but no LEN then LEN = END - BEG - 52 (yes, this *does* happen)
   # 2023-03-05: bugfix: coded to exclude 711 zero-length files
   #           +         account for multiple-same-value $mime (fixes ~1000 gif + jpg files)
   #           +         added 'Content-Encoding:br' Brotli compression
   #           +        (you may need 'sudo apt install brotli' to view those files)

   use strict;
   use warnings;
   use autodie;
   use experimental qw( switch );

   # save algorithm:
   # 1) only save HTTP 200 files ($END)
   # 2) try first to set file beginning ($BEG) from magic bytes
   # 3) if (2) fails, set $BEG from $LEN; if no length, then ignore file
   # 4) extract section $BEG to $END from $IN file into $OUT dir
   # 5) touch file to conform with http header date

   # Stats 2023-03-06:
   # 10978 HTTP 200 from 23594 files in Cache_Data
   #     6 do NOT contain a MIME field
   # 10979 files saved to disk (real	1m23.219s)

   # Global CONSTANTS
   my $IN   = "/home/alexk/.cache/chromium/Default/Cache/Cache_Data/"; # Chromium cache folder.
   my $OUT  = "/home/alexk/Personal/ChromeCache/Files/";               # Place for extracted files
   my $HTTP = "HTTP/1.1 200";                                          # '200 OK' not in all files
   my $F_OFF= 52;                                                      # Offset of HTTP-begin from magic-begin (BEG) + LEN

   opendir( my $d, "$IN") or die "Cannot open directory $IN: $!\n";    # Open cache dir
   my @list 
      = grep { 
         !/^\.\.?$/                                                    # miss /. + /.. files
         && -f "$IN/$_"                                                # is a file (not dir, etc)
	} readdir( $d );
   closedir( $d );
   foreach my $f (@list) {                                             # Iterate through each cached data-file
#     my $f    = "0f0ce6df8548452e_0";
      # section variables
      my $BEG  = -1;                                                   # Extract begins (bytes)
      my $BROTLI = 0;                                                  # brotli encoding (0/1)
      my $END  = -1;                                                   # Extract ends   (bytes)
      my $GZIP = 0;                                                    # gzip encoding (0/1)
      my $magic = '';
      my $MIME = "";                                                   # content-type
      my $MOD  = "";                                                   # last-modified
      my $OFF  = -1;                                                   # Offset of magic from file beginning
      my $TLS  = "";                                                   # TLS==Three Letter Suffix
      my $LEN  = -1;                                                   # content-length
      open my $fhi, '<:raw', "$IN/$f" or die $!;
      read( $fhi, my $cache_buffer, -s "$IN/$f" );
      close( $fhi ) or die "could not close $IN/$f: $!";
      $END     = index( $cache_buffer, "$HTTP");                       # Check for presence of HTTP 200 OK header
      if( $END > -1 ) {                                                #+(and therefore std header fields)
         if( $cache_buffer =~ /\x00Content-Encoding:\s*br/i )   { $BROTLI = 1; }
         if( $cache_buffer =~ /\x00Content-Encoding:\s*gzip/i ) { $GZIP   = 1; }
         if( $cache_buffer =~ /\x00Content-Length:\s*(\d+)/i )  {
            $LEN  = $1;
            if( !$LEN ) { $LEN  = -1; }                                # yes, some pages have Content-Length:0
         }
         if( $cache_buffer =~ /\x00Last-Modified:\s*([ A-Za-z0-9,:]+)/i ) {
            $MOD = $1;                                                 # some web servers ignore case + introduce spaces!
         } else {
            if( $cache_buffer =~ /\x00Date:\s*([ A-Za-z0-9,:]+)/i ) {  # did page did not want to be cached? (Chromium did it anyway!)
               $MOD = $1;                                              # (all pages should have a date (or a Date))
            }
         }
         if( $cache_buffer =~ /\x00Content-Type:\s*([a-z-]+\/[a-z0-9.+-]+)/i ) {
            $MIME = $1;
         } # variable $1 NOT reset on failed match (v stupid)
         given( $MIME ) {
            when ('application/font-woff' )  { $magic = 'wOFF';                           $OFF = 0; $TLS = 'woff'; }
            when ('application/font-woff2')  { $magic = 'wOF2';                           $OFF = 0; $TLS = 'woff2'; }
            when ('application/javascript')  { $magic = "\x{1f}\x{8b}\x{08}";             $OFF = 0; $TLS = 'js'; }    # magic for gzip encoding
            when ('application/json')        { $magic = "\x{1f}\x{8b}\x{08}";             $OFF = 0; $TLS = 'json'; }
            when ('application/x-javascript'){ $magic = "\x{1f}\x{8b}\x{08}";             $OFF = 0; $TLS = 'js'; }
            when ('application/xml')         { $magic = "\x{1f}\x{8b}\x{08}";             $OFF = 0; $TLS = 'js'; }
            when ('binary/octet-stream')     { $magic = "GIF89a";                         $OFF = 0; $TLS = 'gif'; }
            when ('font/ttf')                { $magic = "\x{00}\x{01}\x{00}\x{00}\x{00}"; $OFF = 0; $TLS = 'ttf'; }
            when ('font/woff')               { $magic = 'wOFF';                           $OFF = 0; $TLS = 'woff'; }
            when ('font/woff2')              { $magic = 'wOF2';                           $OFF = 0; $TLS = 'woff2'; }
            when ('image/gif')               { $magic = 'GIF87a';                         $OFF = 0; $TLS = 'gif'; }
#           when ('image/gif')               { $magic = 'GIF89a';                         $OFF = 0; $TLS = 'gif'; }
            when ('image/jpeg')              { $magic = 'JFIF';                           $OFF = 6; $TLS = 'jpg'; }
#           when ('image/jpeg')              { $magic = 'Exif';                           $OFF = 6; $TLS = 'jpeg'; }
#           when ('image/jpeg')              { $magic = "\x{ff}\x{d8}\x{ff}\x{e0}";       $OFF = 6; $TLS = 'jpg'; }
            when ('image/png')               { $magic = "\x{89}PNG";                      $OFF = 0; $TLS = 'png'; }
            when ('image/svg+xml')           { $magic = "\x{1f}\x{8b}\x{08}";             $OFF = 0; $TLS = 'svg'; }
            when ('image/vnd.microsoft.icon'){ $magic = "\x{00}\x{00}\x{01}\x{00}";       $OFF = 0; $TLS = 'ico'; }
            when ('image/webp')              { $magic = 'RIFF';                           $OFF = 0; $TLS = 'webp'; }
            when ('text/css')                { $magic = "\x{1f}\x{8b}\x{08}";             $OFF = 0; $TLS = 'css'; }
            when ('text/fragment+html')      { $magic = "\x{1f}\x{8b}\x{08}";             $OFF = 0; $TLS = 'htm'; }
            when ('text/html')               { $magic = "\x{1f}\x{8b}\x{08}";             $OFF = 0; $TLS = 'html'; }
            when ('text/javascript')         { $magic = "\x{1f}\x{8b}\x{08}";             $OFF = 0; $TLS = 'js'; }
            when ('text/plain')              { $magic = "\x{1f}\x{8b}\x{08}";             $OFF = 0; $TLS = 'txt'; }
            when ('video/mp4')               { $magic = 'ftypisom';                       $OFF = 4; $TLS = 'mp4'; }   # most unlikely
            default                          { $magic = '';                               $OFF = 0; $TLS = ''; }
         }
         if( $magic ) {
            if( $magic eq 'GIF87a') {                                  # account for gif + jpeg multiple $magic
               $BEG = index( $cache_buffer, "$magic" );
               if( $BEG < 0 ) {
                  $magic = 'GIF89a';
                  $BEG   = index( $cache_buffer, "$magic" );
               }
            } elsif( $magic eq 'JFIF') {
               $BEG = index( $cache_buffer, "$magic" );
               if( $BEG < 0 ) {
                  $magic = 'Exif';
                  $TLS   = 'jpeg';
                  $BEG   = index( $cache_buffer, "$magic" );
                  if( $BEG < 0 ) {
                     $magic = "\x{ff}\x{d8}\x{ff}\x{e0}";
                     $TLS   = 'jpg';
                     $BEG   = index( $cache_buffer, "$magic" );
                  }
               }
            }
            $BEG   = index( $cache_buffer, "$magic" );
         }
#         # trying to decode where each file begins (determine common offsets)
#         if( $LEN < 1  &&  $BEG > -1 )  { }
#         if( $BEG > -1  &&  $LEN > -1 ) {
#            # at this point $BEG - $OFF == start of magic
#            #               $END        == start of $HTTP
#            #               $LEN        == length of content from header
#            my $mbeg = $BEG - $OFF;  my $mhex = sprintf("0x%X", $mbeg);
#            my $hbeg = $END - $LEN;  my $hhex = sprintf("0x%X", $hbeg);
#            my $diff = $hbeg - $mbeg;
#            my $dhex = sprintf("0x%X", $diff);
#            print "$MIME: $f; \$END/\$LEN=$END / $LEN; \$mbeg=$mbeg / $mhex; \$hbeg=$hbeg / $hhex; \$diff=$diff / $dhex; \n";
#        }
         if( $BEG > -1 ) {
            $BEG  -= $OFF;
            if( $LEN < 1 ) { $LEN = $END - $BEG - $F_OFF; }            # v rare, but happens
         } elsif( $LEN > -1 ) { $BEG = $END - $LEN - $F_OFF; }         # no magic (text, xml + brotli files)
         # suffixes (holy m$)
         if( $TLS ) {
            $TLS = ".$TLS";
            if( $GZIP || $BROTLI ) {                                   # account for different compression-encodings
               if( $GZIP ) { $TLS = "$TLS.gz"; } else { $TLS = "$TLS.br"; }
            }
         }
         # print the files out
         if( $BEG > -1 && $LEN > -1 ) {
            `dd if="$IN/$f" of="$OUT/$f$TLS" skip=$BEG count=$LEN iflag=skip_bytes,count_bytes status=none`;
            if( $MOD ) { `touch "$OUT/$f$TLS" -d "$MOD"`; }
#          print "$MIME: $f; \$TLS=$TLS; \$END=$END; \$BEG=$BEG; \$LEN=$LEN; \$MOD=$MOD; \n";
         }
      } # if( $END > -1 )                                              # other pages are most likely to be HTTP 204 No Content
   }

Last edited by alexkemp (2023-03-11 16:01:04)

Offline

Board footer