像chrome那样解压.crx文件

crx-unpack的Python项目详细描述


Package versionDocumentation StatusPython versions supportedLicense: MIT

此模块包含几个用于处理google chrome扩展文件(crxs)的实用程序,这些文件具有*.crx 文件扩展名。这个项目的目标是尽可能地模仿google chrome的功能 这些扩展已解包并安装。

文档

请在Read the Docs上查看此项目的完整文档。

安装

由于crx_unpackPyPI上可用,因此可以使用pip

$ pip install crx_unpack

CRX包格式的结构

本节介绍了crx文件的结构和内容。

https://developer.chrome.com/extensions/crx

包头

头包含作者的公钥和扩展的签名。签名是从zip文件生成的 使用sha-1和作者的私钥。报头需要一个4字节对齐的小尾数字节顺序。这个 下表按顺序描述.crx头的字段:

FieldTypeLengthValueDescription
magic numberchar[]32 bitsCr24Chrome requires this constant at the beginning of every ^{tt3}$ package.
versionunsigned int32 bits2The version of the ^{tt1}$ file format used (currently 2).
public key lengthunsigned int32 bitspubkey.lengthThe length of the RSA public key in bytes.
signature lengthunsigned int32 bitssig.lengthThe length of the signature in bytes.
public keybyte[]pubkey.lengthpubkey.contentsThe contents of the author’s RSA public key formatted as an X509 SubjectPublicKeyInfo block.
signaturebyte[]sig.lengthsig.contentsThe signature of the ZIP content using the author’s private key. The signature is created using the RSA algorithm with the SHA-1 hash function.

扩展内容

扩展名的zip文件追加到头后的*.crx包中。这个zip文件应该和 头中的签名是从中生成的。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java JNLP无法在浏览器中正确启动(与dtjava.js一起部署)   在执行下一个方法之前,java将等待线程执行结束   java如何将另一个LayoutManager应用于JComboBox?(多栏JComboBox尝试)   使用jPBC在java中实现双线性配对   java在使用@RequestMapping注释时获取请求的值(URL)   java如何控制流量   java如何获取IFC对象的绝对坐标?   java目标服务器无法使用htmlunit和tor响应异常   java需要帮助创建一个循环结构来运行我的程序   java有可能拥有一个Android APK并在应用程序中更改构建变体吗?   在Sphinx4中运行Ant的java   Java:从ArrayList获取子列表的有效方法   java如何使在循环内部创建的数组在循环外部工作?   apache poi通过java中的XSSF表从单元格读取日期值   安卓 java自己的SeqLock实现,避免spinlock会更好吗?   java的并发底层方法。util。同时发生的预定未来   java比较方法违反了它的一般约定,如何使它具有可传递性?   使用JAVA定向指定类的DB导出子类   一个方法中的java更改特定imageView