mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-27 12:04:50 +02:00
Core: Initial addition of cache control
This commit is contained in:
@@ -3,14 +3,13 @@
|
||||
#
|
||||
|
||||
import collections
|
||||
import functools
|
||||
import logging
|
||||
import math
|
||||
import struct
|
||||
from typing import Any, Dict, Iterable, List, Optional, Tuple
|
||||
|
||||
from volatility import classproperty
|
||||
from volatility.framework import exceptions, interfaces, constants
|
||||
from volatility.framework import exceptions, interfaces, constants, caching
|
||||
from volatility.framework.configuration import requirements
|
||||
from volatility.framework.layers import linear
|
||||
|
||||
@@ -156,7 +155,7 @@ class Intel(linear.LinearlyMappedLayer):
|
||||
|
||||
return entry, position
|
||||
|
||||
@functools.lru_cache(1025)
|
||||
@caching.lru_cache(1025)
|
||||
def _get_valid_table(self, base_address: int) -> Optional[bytes]:
|
||||
"""Extracts the table, validates it and returns it if it's valid."""
|
||||
table = self._context.layers.read(self._base_layer, base_address, self.page_size)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import functools
|
||||
from typing import List, Optional, Tuple, Iterable
|
||||
|
||||
from volatility.framework import exceptions, interfaces
|
||||
from volatility.framework import exceptions, interfaces, caching
|
||||
|
||||
|
||||
class LinearlyMappedLayer(interfaces.layers.TranslationLayerInterface):
|
||||
@@ -28,7 +27,7 @@ class LinearlyMappedLayer(interfaces.layers.TranslationLayerInterface):
|
||||
# ## Read/Write functions for mapped pages
|
||||
# Redefine read here for speed reasons (so we don't call a processing method
|
||||
|
||||
@functools.lru_cache(maxsize = 512)
|
||||
@caching.lru_cache(maxsize = 512)
|
||||
def read(self, offset: int, length: int, pad: bool = False) -> bytes:
|
||||
"""Reads an offset for length bytes and returns 'bytes' (not 'str') of
|
||||
length size."""
|
||||
|
||||
@@ -6,7 +6,7 @@ import json
|
||||
import math
|
||||
from typing import Optional, Dict, Any, Tuple, List, Set
|
||||
|
||||
from volatility.framework import interfaces, exceptions, constants
|
||||
from volatility.framework import interfaces, exceptions, constants, caching
|
||||
from volatility.framework.layers import segmented
|
||||
from volatility.framework.symbols import intermed
|
||||
|
||||
@@ -212,7 +212,7 @@ class QemuSuspendLayer(segmented.NonLinearlySegmentedLayer):
|
||||
return (data * 0x1000)[:output_length]
|
||||
return data
|
||||
|
||||
@functools.lru_cache(maxsize = 512)
|
||||
@caching.lru_cache(maxsize = 512)
|
||||
def read(self, offset: int, length: int, pad: bool = False) -> bytes:
|
||||
return super().read(offset, length, pad)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user