diff --git a/oletools/record_base.py b/oletools/record_base.py index f30ef7f..6a41ae8 100644 --- a/oletools/record_base.py +++ b/oletools/record_base.py @@ -74,7 +74,6 @@ PARENT_DIR = os.path.normpath(os.path.dirname(os.path.dirname( if PARENT_DIR not in sys.path: sys.path.insert(0, PARENT_DIR) del PARENT_DIR -from oletools.common.errors import FileIsEncryptedError from oletools import oleid @@ -127,10 +126,9 @@ class OleRecordFile(olefile.OleFileIO): """ def open(self, filename, *args, **kwargs): - """Call OleFileIO.open, raise error if is encrypted.""" + """Call OleFileIO.open.""" #super(OleRecordFile, self).open(filename, *args, **kwargs) OleFileIO.open(self, filename, *args, **kwargs) - self.is_encrypted = oleid.OleID(self).check_encrypted().value @classmethod def stream_class_for_name(cls, stream_name): @@ -163,8 +161,7 @@ class OleRecordFile(olefile.OleFileIO): stream = clz(self._open(direntry.isectStart, direntry.size), direntry.size, None if is_orphan else direntry.name, - direntry.entry_type, - self.is_encrypted) + direntry.entry_type) yield stream stream.close() @@ -177,14 +174,13 @@ class OleRecordStream(object): abstract base class """ - def __init__(self, stream, size, name, stream_type, is_encrypted=False): + def __init__(self, stream, size, name, stream_type): self.stream = stream self.size = size self.name = name if stream_type not in ENTRY_TYPE2STR: raise ValueError('Unknown stream type: {0}'.format(stream_type)) self.stream_type = stream_type - self.is_encrypted = is_encrypted def read_record_head(self): """ read first few bytes of record to determine size and type @@ -213,9 +209,6 @@ class OleRecordStream(object): Stream must be positioned at start of records (e.g. start of stream). """ - if self.is_encrypted: - raise FileIsEncryptedError() - while True: # unpacking as in olevba._extract_vba pos = self.stream.tell()