AR Format Package
2023-11-20 18:34:17 Author: blog.cerbero.io(查看原文) 阅读量:6 收藏

Skip to content

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

The AR archive format, originally devised for Unix systems, serves as a straightforward file archiving tool, combining multiple files into a single archive without inherent compression. It’s primarily used in Unix-like environments for storing static libraries (‘.a’ files), and is also a key component in the structure of DEB packages for Debian-based Linux distributions. Furthermore, the AR format finds its application in the Windows operating system as well, where it is used for ‘.lib’ files.

The package is also exposed to the SDK:

from Pro.Core import *
from Pkg.AR import *

def parseArArchive(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = ARObject()
    if not obj.Load(c) or not obj.ParseArchive():
        return
    entry = None
    while entry := obj.NextEntry(entry):
        print("Name:", entry.name)
        # retrieves the entry data as NTContainer
        c = obj.GetEntryData(entry)

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