RAR Format Package
2023-11-8 23:15:54 Author: blog.cerbero.io(查看原文) 阅读量:13 收藏

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

The support includes encrypted archives and the inspection of the format structures.

The package is also exposed to the SDK:

from Pro.Core import *
from Pkg.RAR import *

def parseRARArchive(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = RARObject()
    if not obj.Load(c) or not obj.ParseArchive():
        return
    n = obj.GetEntryCount()
    print(n)
    for i in range(n):
        entry = obj.GetEntry(i)
        if entry == None:
            break
        # skip directories
        if not obj.IsFile(entry):
            continue
        print("file name:", entry.filename)
        # retrieves the file data as NTContainer
        fc = obj.GetEntryData(entry)

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