diff --git a/dissect/ntfs/secure.py b/dissect/ntfs/secure.py index 26eb86b..380186e 100644 --- a/dissect/ntfs/secure.py +++ b/dissect/ntfs/secure.py @@ -1,6 +1,7 @@ from __future__ import annotations import io +from functools import lru_cache from typing import BinaryIO, Iterator from uuid import UUID @@ -38,6 +39,8 @@ def __init__(self, record: MftRecord = None, sds: BinaryIO = None): if not hasattr(self.sds, "size"): self.sds.size = self.sds.seek(0, io.SEEK_END) + self.lookup = lru_cache(4096)(self.lookup) + def _iter_entries(self, offset: int = 0) -> Iterator[c_ntfs._SECURITY_DESCRIPTOR_HEADER]: """Iterate over all SDS entries, optionally starting from a specific offset.