Skip to content

Commit 4f86b3f

Browse files
committed
Merge branch 'develop' into linux_hidden_modules
2 parents 722ccd5 + 73f8ddb commit 4f86b3f

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

volatility3/framework/symbols/linux/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ def _slot_to_nodep(self, slot) -> int:
615615

616616
return nodep
617617

618-
def _iter_node(self, nodep, height) -> int:
618+
def _iter_node(self, nodep, height) -> Iterator[int]:
619619
node = self.nodep_to_node(nodep)
620620
node_slots = node.slots
621621
for off in range(self.CHUNK_SIZE):
@@ -632,7 +632,7 @@ def _iter_node(self, nodep, height) -> int:
632632
for child_node in self._iter_node(nodep, height - 1):
633633
yield child_node
634634

635-
def get_entries(self, root: interfaces.objects.ObjectInterface) -> int:
635+
def get_entries(self, root: interfaces.objects.ObjectInterface) -> Iterator[int]:
636636
"""Walks the tree data structure
637637
638638
Args:
@@ -818,7 +818,7 @@ def __init__(
818818
self._page_cache = page_cache
819819
self._idstorage = IDStorage.choose_id_storage(context, kernel_module_name)
820820

821-
def get_cached_pages(self) -> interfaces.objects.ObjectInterface:
821+
def get_cached_pages(self) -> Iterator[interfaces.objects.ObjectInterface]:
822822
"""Returns all page cache contents
823823
824824
Yields:

volatility3/framework/symbols/linux/extensions/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626

2727
class module(generic.GenericIntelProcess):
2828

29-
def __init__(self, *args, **kwargs):
30-
super().__init__(*args, **kwargs)
31-
self._mod_mem_type = None # Initialize _mod_mem_type to None for memoization
32-
3329
def is_valid(self):
3430
"""Determine whether it is a valid module object by verifying the self-referential
3531
in module_kobject. This also confirms that the module is actively allocated and
@@ -61,8 +57,8 @@ def is_valid(self):
6157

6258
return True
6359

64-
@property
65-
def mod_mem_type(self):
60+
@functools.cached_property
61+
def mod_mem_type(self) -> Dict:
6662
"""Return the mod_mem_type enum choices if available or an empty dict if not"""
6763
# mod_mem_type and module_memory were added in kernel 6.4 which replaces
6864
# module_layout for storing the information around core_layout etc.
@@ -1331,7 +1327,7 @@ def is_equal(self, vfsmount_ptr) -> bool:
13311327
bool: 'True' if the given argument points to the the same 'vfsmount'
13321328
as 'self'.
13331329
"""
1334-
if type(vfsmount_ptr) == objects.Pointer:
1330+
if isinstance(vfsmount_ptr, objects.Pointer):
13351331
return self.vol.offset == vfsmount_ptr
13361332
else:
13371333
raise exceptions.VolatilityException(

0 commit comments

Comments
 (0)