import os import sys import codecs from datetime import datetime, timedelta from struct import unpack import dsz, dsz.version.checks.windows import ops, ops.cmd from ops.pprint import pprint def getsectionA(handle, offset, numentries): handle.seek(offset) sectionA = [] for i in range(0, numentries): sectionA.append(fixendian(handle.read(4), 4)) return sectionA def getsectionB(handle, offset, numentries): handle.seek(offset) sectionB = [] for i in range(0, numentries): val1 = fixendian(handle.read(4), 4) val2 = fixendian(handle.read(4), 4) val3 = fixendian(handle.read(4), 4) sectionB.append([val1, val2, val3]) return sectionB def getsectionC(handle, offset, length): handle.seek(offset) sectionC = [] (files, thing) = codecs.getdecoder('utf_16')(handle.read(length), 'replace') files = files.replace('\x00', '\n') sectionC = files.strip().split('\n') return sectionC def getsectionD(handle, offset, numvols, length, version): handle.seek(offset) sectionD = [] for i in range(0, numvols): data = {} data['labeloffset'] = unpack('