示例#1
0
def getAttributesLeafRec(alr_binary):
    keyLen = unpack_from(">H", alr_binary)[0]
    attKey = getAttributesKey(alr_binary[:2 + keyLen])
    rec_binary = alr_binary[2 + keyLen:]
    recordType = unpack_from(">I", rec_binary)[0]
    typeList = [
        0, getAttributesData, getAttributesForkData, getAttributesExtents
    ]
    Record = typeList[recordType / 0x10](rec_binary)
    return ss.BTRecord(attKey, Record)
示例#2
0
def getExtentsLeafRec(elf_binary):
    extKey = getExtentsKey(elf_binary[:12])
    rec_binary = elf_binary[12:]
    ext = []
    for i in range(8):
        temp = rec_binary[16 + 8 * i:16 + 8 * (i + 1)]
        e = getExtentDescriptor(temp)
        ext.append(e)

    return ss.BTRecord(extKey, ss.ExtentsDataRec(*ext))
示例#3
0
def getCatalogLeafRec(clk_binary):
    keyLen = unpack_from(">H", clk_binary)[0]
    catalKey = getCatalogKey(clk_binary[:2 + keyLen])
    rec_binary = clk_binary[2 + keyLen:]
    recordType = unpack_from(">H", rec_binary)[0]
    typeList = [
        0, getCatalogFolder, getCatalogFile, getCatalogThread, getCatalogThread
    ]
    Record = typeList[recordType](rec_binary)
    return ss.BTRecord(catalKey, Record)
示例#4
0
def getAttributesPointerRec(apr_binary):
    keyLen = unpack_from(">H", apr_binary)[0]
    attKey = getAttributesKey(apr_binary[:2 + keyLen])
    nodeNum = unpack_from(">I", apr_binary[2 + keyLen:])[0]
    return ss.BTRecord(attKey, ss.BTPointer(nodeNum))
示例#5
0
def getExtentsPointerRec(epr_binary):
    extKey = getExtentsKey(epr_binary[:12])
    nodeNum = unpack_from(">I", epr_binary[12:])[0]
    return ss.BTRecord(extKey, ss.BTPointer(nodeNum))
示例#6
0
def getCatalogPointerRec(cpr_binary):
    keyLen = unpack_from(">H", cpr_binary)[0]
    catalKey = getCatalogKey(cpr_binary[:2 + keyLen])
    nodeNum = unpack_from(">I", cpr_binary[2 + keyLen:])[0]

    return ss.BTRecord(catalKey, ss.BTPointer(nodeNum))