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)
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))
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)
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))
def getExtentsPointerRec(epr_binary): extKey = getExtentsKey(epr_binary[:12]) nodeNum = unpack_from(">I", epr_binary[12:])[0] return ss.BTRecord(extKey, ss.BTPointer(nodeNum))
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))