Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
876 views
in Technique[技术] by (71.8m points)

compression - how to unpack resources.pak from google chrome?

There are bunch of interesting files accessible via chrome://resources/* using google chrome.

On linux That the content is in /opt/google/chrome/resources.pak. I know I can get the whole sources from http://chromium.googlecode.com/svn/trunk/ but I would like to unpack the resource.pak file.

file resources.pak reports just junk.

Just to be clear, the question is NOT where to get those resources from. The question is what is the resources.pak file format and how to unpack it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

taken from https://groups.google.com/a/chromium.org/forum/?fromgroups=#!topic/chromium-dev/agGjTt4Dmcw

4 byte version number
4 byte number of resources
1 byte encoding

For each resource:
2 byte resource id
4 byte resource offset in file

There is an extra resource entry at the end with ID 0 giving the end of the last resource (which is essentially the length of the file)

This python module can unpack and repack files:
data_pack.py from grit-i18n


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...