XAR Format Package
2023-11-13 16:59:42 Author: blog.cerbero.io(查看原文) 阅读量:9 收藏

We have released the XAR Format package for all licenses of Cerbero Suite.

XAR (eXtensible ARchive format) is an archive file format which is used for software installation routines in macOS as well as browser extensions in Safari.

The support includes inspecting the format’s structures.

The package is also exposed to the SDK:

from Pro.Core import *
from Pkg.XAR import *

def parseXARArchive(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = XARObject()
    if not obj.Load(c) or not obj.ParseArchive():
        return
    entry = None
    while entry := obj.NextEntry(entry):
        # skip directories
        if obj.IsDirectory(entry):
            continue
        print("file name:", entry.path)
        # retrieves the file data as NTContainer
        fc = obj.GetEntryData(entry)

文章来源: https://blog.cerbero.io/?p=2851
如有侵权请联系:admin#unsafe.sh