从十六进制格式解码 Firefox 浏览器缓存条目

Decoding Firefox browser cache entry from hex format

在 macOS 上的 Firefox 64 中,当我查看 about:cache 下的磁盘缓存条目之一时,我看到一个页面看起来类似于我在下面粘贴的代码。我已经删除了 "security-info" 之后的大部分长代码,除了最后的十六进制和 ascii 代码的前三行。

如何将文件的内容恢复为人类可读的格式?

我发现很多解决方案只需要 运行 Windows 下的工具,但我在 macOS 上。我还尝试将十六进制代码(例如第一行:00000000: 1f 8b 08 00 00 00 00 00 00 03 ed bd fb 72 db 48)保存到一个具有 UTF-8 编码和 UNIX 换行符的文件中,并以 .gzip 作为文件结尾然后解压它,但我得到的只是再次使用相同的十六进制代码。我需要删除开头的 00000000: 吗?使用其他文件格式?另一个文件结尾 and/or decoder?

Cache entry information
key:    https://www.some-site.com/
fetch count:    2
last fetched:   2018-12-16 20:17:21
last modified:  2018-12-17 06:31:53
expires:    Expired Immediately
Data size:  17911 B
Security:   This is a secure document.
strongly-framed:    1
security-info:  FnhllAKWRHGAlo+ESXykKAAAAAAAAAAAwAAAAAAAAEap ... (and so on)
request-method:     POST
request-Accept-Encoding:    gzip, deflate, br
request-User-Agent:     Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:64.0) Gecko/20100101 Firefox/64.0
response-head:  HTTP/1.1 200 OK
Server: Server
Date: Sun, 16 Dec 2018 19:17:14 GMT
Content-Type: text/html; charset=utf-8
Status: 200 OK
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Request-Id: 2K84AFOOBARX4FNG9D4
ETag: W/"76e8cacfoobar0b8be5"
Cache-Control: max-age=0, private, must-revalidate
X-Runtime: 0.300085
X-Content-Type-Options: nosniff, nosniff
Content-Encoding: gzip
x-amz-rid: 2K84AFOOBARX4FNG9D4
Vary: Accept-Encoding,User-Agent
original-response-headers:  Server: Server
Date: Sun, 16 Dec 2018 19:17:14 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200 OK
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Request-Id: 2K84AFOOBARX4FNG9D4
ETag: W/"76e8cacfoobar0b8be5"
Cache-Control: max-age=0, private, must-revalidate
X-Runtime: 0.300085
X-Content-Type-Options: nosniff
Content-Encoding: gzip
Set-Cookie: _session_id2=9f298foobarfb208b; path=/; expires=Mon, 17 Dec 2018 01:17:14 -0000; HttpOnly
x-amz-rid: 2K84AFOOBARX4FNG9D4
Vary: Accept-Encoding,User-Agent
net-response-time-onstart:  1266
net-response-time-onstop:   1274

00000000:  1f  8b  08  00  00  00  00  00  00  03  ed  bd  fb  72  db  48  .............r.H
00000010:  92  2f  fc  f7  f8  29  d0  9c  d9  96  fc  b5  78  27  75  b3  ./...)......x'u.
00000020:  25  1f  59  b6  dc  ee  76  bb  dd  96  3c  9e  6e  af  83  01  %.Y...v...<.n...
... (and so on)

您需要从冒号和点之间或右侧的任何内容中提取十六进制,并将其转换回二进制。然后,在所示的情况下,您将拥有一个可以通过 gzip 解压缩的 gzip 流。您可以使用 xxd -r -p 将十六进制转换为二进制。